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

Set k8s default container label #15694

Merged
merged 9 commits into from
Jan 16, 2025
Merged

Set k8s default container label #15694

merged 9 commits into from
Jan 16, 2025

Conversation

konstfish
Copy link
Contributor

@konstfish konstfish commented Jan 14, 2025

Fixes #15391

Proposed Changes

  • Add the kubectl.kubernetes.io/default-container annotation to Pods, pointing to the user-container. This ensures kubectl will always select the correct container by default when interacting with kubectl logs, kubectl exec, etc.

Release Note

Add default container annotation to Pods created by the reconciler

Copy link

linux-foundation-easycla bot commented Jan 14, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@knative-prow knative-prow bot requested review from izabelacg and skonto January 14, 2025 13:36
Copy link

knative-prow bot commented Jan 14, 2025

Welcome @konstfish! It looks like this is your first PR to knative/serving 🎉

@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 14, 2025
Copy link

knative-prow bot commented Jan 14, 2025

Hi @konstfish. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@konstfish
Copy link
Contributor Author

Some more notes on this, I was unsure if I should put this behind some sort of feature gate, but I'd be happy to as about ~12 tests were affected by these changes. Fix for now was just to include the extra annotation in the want (in https://github.com/knative/serving/pull/15694/files#diff-d93eacd83502ff2061608160378ff8c5c8b199fed97cd44e2b1ab73f419b9aab & https://github.com/knative/serving/pull/15694/files#diff-508e07fc6207ae8956d33f7753a1407b85885edff3135849635263501ed77fd5) but I feel like this isn't really the cleanest solution. Would love some feedback on that!

@dprotaso
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.84%. Comparing base (dd48437) to head (f1547df).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15694      +/-   ##
==========================================
+ Coverage   80.81%   80.84%   +0.02%     
==========================================
  Files         222      222              
  Lines       18034    18035       +1     
==========================================
+ Hits        14574    14580       +6     
+ Misses       3088     3085       -3     
+ Partials      372      370       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

go.mod Outdated Show resolved Hide resolved
pkg/reconciler/revision/resources/imagecache_test.go Outdated Show resolved Hide resolved
pkg/reconciler/revision/resources/meta.go Outdated Show resolved Hide resolved
pkg/reconciler/revision/resources/meta_test.go Outdated Show resolved Hide resolved
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2025
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 16, 2025
@konstfish konstfish requested a review from dprotaso January 16, 2025 21:31
Copy link
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good - one more minor change

pkg/reconciler/revision/resources/meta_test.go Outdated Show resolved Hide resolved
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 16, 2025
@dprotaso
Copy link
Member

/lgtm
/approve

thanks for the changes

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2025
Copy link

knative-prow bot commented Jan 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, konstfish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2025
@knative-prow knative-prow bot merged commit a5988eb into knative:main Jan 16, 2025
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set k8s default container label
2 participants