-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix orphan bulk decrypt traces #10037
Conversation
87414cd
to
2537fd9
Compare
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.
This looks good to me in general. See my comments for details.
2537fd9
to
390f551
Compare
@@ -510,7 +514,7 @@ func newImportCmd() *cobra.Command { | |||
}, imports) | |||
|
|||
if generateCode { | |||
deployment, err := getCurrentDeploymentForStack(s) | |||
deployment, err := getCurrentDeploymentForStack(ctx, s) |
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.
s.Import above can take ctx instead of commandContext() as well
@@ -76,7 +77,7 @@ func newStackImportCmd() *cobra.Command { | |||
// We do, however, now want to unmarshal the json.RawMessage into a real, typed deployment. We do this so | |||
// we can check that the deployment doesn't contain resources from a stack other than the selected one. This | |||
// catches errors wherein someone imports the wrong stack's deployment (which can seriously hork things). | |||
snapshot, err := stack.DeserializeUntypedDeployment(&deployment, stack.DefaultSecretsProvider) | |||
snapshot, err := stack.DeserializeUntypedDeployment(ctx, &deployment, stack.DefaultSecretsProvider) |
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.
Again, there's a call to s.ImportDeployment below which can take ctx instead of commandContext()
Description
Currently opentracing spans generated by the HTTP client when calling BulkDecrypt endpoint are not parented correctly. This seems to be an issue with not propagating
context.Context
through the code correctly. I took a stab at propagating it and I can see the spans snapping back into place.Since we're changing interfaces under
sdk/
this is a breaking change. It can be fixed by injectingcontext.Background()
at the call sites.Example project:
Fixes # (issue)
Checklist