Skip to content

Conversation

huhouhua
Copy link
Contributor

@huhouhua huhouhua commented Jun 29, 2025

Fixes #17463

This PR fixes the imageMinimumGCAge and imageMaximumGCAge parsing failure issue. This is because these two parameters are specified using the kubelet command line, and the kubelet command line itself does not provide these two parameters, so we need to write these two parameters into the kubelet file

Changes:

  1. Change the type of imageMaximumGCAge and imageMinimumGCAge to metav1.Duration
  2. Returns useful error messages when parsing fails
  3. Added unit tests to cover valid and invalid cases

Copy link

linux-foundation-easycla bot commented Jun 29, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: huhouhua / name: Kevin Berger (c41bf2c)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @huhouhua!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot 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 Jun 29, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @huhouhua. Thanks for your PR.

I'm waiting for a kubernetes 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.

@k8s-ci-robot k8s-ci-robot added area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 29, 2025
Copy link
Member

@hakman hakman left a comment

Choose a reason for hiding this comment

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

Hi @huhouhua, thanks for your contribution. I've added a few small comments that should simplify the PR. Please let me know if you have any questions.

@k8s-ci-robot k8s-ci-robot 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 Jun 30, 2025
@huhouhua huhouhua requested a review from hakman June 30, 2025 08:42
@hakman
Copy link
Member

hakman commented Jun 30, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot 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 Jun 30, 2025
@hakman
Copy link
Member

hakman commented Jun 30, 2025

/test pull-kops-e2e-cni-amazonvpc

@hakman
Copy link
Member

hakman commented Jun 30, 2025

Issue is unrelated to current fix:
/overide pull-kops-e2e-cni-amazonvpc

@hakman
Copy link
Member

hakman commented Jun 30, 2025

/override pull-kops-e2e-cni-amazonvpc

@k8s-ci-robot
Copy link
Contributor

@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-cni-amazonvpc

In response to this:

/override pull-kops-e2e-cni-amazonvpc

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.

@hakman
Copy link
Member

hakman commented Jun 30, 2025

@huhouhua Thanks, this looks great.
Would you mind squashing the commits as the final step?

…ge in kubelet config

- add unit tests for image GC duration
- change the string type of the image GC field to metav1.Duration
- remove unnecessary comments
@huhouhua huhouhua force-pushed the fix-kubelet-parse-imagegc-args branch from 7123323 to c41bf2c Compare June 30, 2025 15:40
@huhouhua
Copy link
Contributor Author

@huhouhua Thanks, this looks great. Would you mind squashing the commits as the final step?

I have merged

@hakman
Copy link
Member

hakman commented Jun 30, 2025

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2025
@hakman
Copy link
Member

hakman commented Jun 30, 2025

/override pull-kops-e2e-cni-amazonvpc

@k8s-ci-robot
Copy link
Contributor

@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-cni-amazonvpc

In response to this:

/override pull-kops-e2e-cni-amazonvpc

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.

@hakman
Copy link
Member

hakman commented Jun 30, 2025

/override pull-kops-e2e-cni-amazonvpc

@k8s-ci-robot
Copy link
Contributor

@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-cni-amazonvpc

In response to this:

/override pull-kops-e2e-cni-amazonvpc

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.

@hakman
Copy link
Member

hakman commented Jun 30, 2025

/override pull-kops-e2e-k8s-gce-cilium

@k8s-ci-robot
Copy link
Contributor

@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-k8s-gce-cilium

In response to this:

/override pull-kops-e2e-k8s-gce-cilium

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.

@k8s-ci-robot k8s-ci-robot merged commit 2f3a7b6 into kubernetes:master Jun 30, 2025
26 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Jun 30, 2025
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. area/api area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

Setting imageMaximumGCAge makes kubelet not starting
3 participants