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

[containerd] add config support override_path #10776

Conversation

yankay
Copy link
Member

@yankay yankay commented Jan 5, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

override_path is the config of contained, ref : https://github.com/containerd/containerd/blob/main/docs/hosts.md#override_path-field

It's useful to configure registry mirrors , ref https://microk8s.io/docs/registry-private#configure-registry-mirrors-7

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

[containerd] add config support `override_path`

@k8s-ci-robot k8s-ci-robot requested a review from bozzo January 5, 2024 12:20
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yankay

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 requested a review from holmsten January 5, 2024 12:20
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 5, 2024
@yankay
Copy link
Member Author

yankay commented Jan 12, 2024

HI @VannTen @floryut

Would you please help to review the PR :-)

Comment on lines 8 to 10
{% if mirror.override_path is defined %}
override_path = {{ mirror.override_path | default('false') | string | lower }}
{% endif %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd drop the if.

Suggested change
{% if mirror.override_path is defined %}
override_path = {{ mirror.override_path | default('false') | string | lower }}
{% endif %}
override_path = {{ mirror.override_path | default('false') | string | lower }}

false is containerd default, so that's consistent.

(In fact I'd drop the if on skip_verify as well ^)

Copy link
Member Author

@yankay yankay Jan 16, 2024

Choose a reason for hiding this comment

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

Thanks @VannTen

After thinking about the idea twice, there is a problem.

If "the if be dropped", every host.toml file will contain

skip_verify = false
override_path = false

although the skip_verify and override_path is not defined.
It's not necessary, and it makes the config file simpler.

So, I think the original PR is reasonable, and it keeps the same with skip_verify, making the code easier to read.

How about you think about that :-)

@VannTen
Copy link
Contributor

VannTen commented Jan 16, 2024 via email

@yankay yankay force-pushed the add-containerd-config-override_path branch from df95f42 to fd6f63b Compare January 16, 2024 09:30
@yankay
Copy link
Member Author

yankay commented Jan 16, 2024

After thinking about the idea twice, there is a problem. If "the if be dropped", every host.toml file will contain skip_verify = false override_path = false although the skip_verify and override_path is not defined.
Yeah, but those are false by default.
It's not necessary, and it makes the config file simpler.
Making the resulting config file simpler does not really buy anything, you could even argue that's having explicit settings is self-documenting. OTOH, making the template simpler help for future modifications and debugging.

Thanks for suggestion :-) 🤝🤝🤝

Got it. The code has been changed.

@VannTen
Copy link
Contributor

VannTen commented Jan 16, 2024

Might want to rebase to get the vagrant fix 👍

@yankay yankay force-pushed the add-containerd-config-override_path branch from fd6f63b to 975cbc3 Compare January 16, 2024 09:47
@VannTen
Copy link
Contributor

VannTen commented Jan 16, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit a0a2f40 into kubernetes-sigs:master Jan 16, 2024
65 checks passed
@yankay yankay mentioned this pull request Jan 19, 2024
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
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. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants