Skip to content
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: use generate name in logs if pod name is empty #706

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

aramase
Copy link
Member

@aramase aramase commented Jan 17, 2023

Signed-off-by: Anish Ramasekar [email protected]

Reason for Change:

For static pods, the pod name is not empty. For pods created as part of Deployments, ReplicaSet, etc, the name is empty and generate name exists.

I0117 22:08:19.736489       1 webhook.go:114] handler "msg"="received pod mutation request pod.GetName()" "namespace"="default" "pod"="" "podName"="" "service-account"="wi"
I0117 22:08:19.736518       1 webhook.go:115] handler "msg"="received pod mutation request pod.GetGenerateName()" "namespace"="default" "pod"="" "podName"="nginx-deployment-84d95667b8-" "service-account"="wi"

Actual log with this change

I0117 23:13:27.617001       1 webhook.go:142] handler "msg"="pod not labeled or service account not annotated, skipping mutation" "namespace"="default" "pod"="nginx-deployment-85996f8dbd- (prefix)" "service-account"="default"

Requirements

  • squashed commits
  • included documentation
  • added unit tests and e2e tests (if applicable).

Issue Fixed:

fixes #688

Please answer the following questions with yes/no:

Does this change contain code from or inspired by another project? If so, did you notify the maintainers and provide attribution?

  • yes
  • no

Notes for Reviewers:

@aramase aramase requested a review from enj January 17, 2023 22:31
pkg/webhook/webhook.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing pod name in log pod not labeled or service account not annotated
2 participants