-
Notifications
You must be signed in to change notification settings - Fork 158
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
Add pod and container name to log context #291
Conversation
94669fa
to
0594313
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.
For the Functions that use PodRunner, can we just set these values there?
pkg/function/restore_data.go
Outdated
@@ -176,6 +177,10 @@ func (*restoreDataFunc) Exec(ctx context.Context, tp param.TemplateParams, args | |||
} | |||
// Validate and get optional arguments | |||
restorePath, encryptionKey, pod, vols, backupTag, backupID, err := validateAndGetOptArgs(args) | |||
|
|||
if pod != "" { |
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.
doesn't this Function also use pod runner?
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.
It does, but the pod name set here is different than the one that is generated by pod runner.
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.
I would either drop this or rename the key since it's getting overwritten anyway
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.
Use a different key in order to tell apart the 2 pod names?
pkg/function/restore_data_all.go
Outdated
@@ -128,6 +129,7 @@ func (*restoreDataAllFunc) Exec(ctx context.Context, tp param.TemplateParams, ar | |||
output := make(map[string]interface{}) | |||
for _, pod := range pods { | |||
go func(pod string) { | |||
ctx = field.Context(ctx, field.PodNameKey, pod) |
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.
same here
Change Overview
Add pod name and container name to context in addition to actionset name and phase name
Pull request type
Please check the type of change your PR introduces: