-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDP-280012: Add http dry run transport for Atlas #2026
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just to clarify my understanding of the feature; this is going to be used to we can create all of the Atlas API calls we would make, but without actually sending them, letting us preview what a change would do?
@@ -121,48 +127,58 @@ func (p *ProductionProvider) Client(ctx context.Context, secretRef *client.Objec | |||
return c, secretData.OrgID, err | |||
} | |||
|
|||
func (p *ProductionProvider) SdkClient(ctx context.Context, secretRef *client.ObjectKey, log *zap.SugaredLogger) (*admin.APIClient, string, error) { | |||
secretData, err := getSecrets(ctx, p.k8sClient, secretRef, &p.globalSecretRef) | |||
func (p *ProductionProvider) SdkClient(ctx context.Context, secretRef *client.ObjectKey, log *zap.SugaredLogger) (*adminv20231115008.APIClient, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is it worth mentioning why this is a special case? or maybe even marking this method as deprecated to encourage always using SdkClientSet in future?
} | ||
var transport http.RoundTripper = digest.NewTransport(secretData.PublicKey, secretData.PrivateKey) | ||
transport = p.newDryRunTransport(transport) | ||
transport = httputil.NewLoggingTransport(log, false, transport) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we will be logging all of the SDK Atlas API calls? This will be lovely for debugging
This adds a dry run transport towards Atlas calls. Note that this contribution is a no-op for now. The operator starts in non-dry-run mode.
All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if there is one).