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

crio container runtime crio_registries path fix #11030

Merged

Conversation

pedro-peter
Copy link
Contributor

@pedro-peter pedro-peter commented Mar 23, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:
when using the crio container runtime and enabling crio_registries:
https://github.com/kubernetes-sigs/kubespray/blob/master/docs/cri-o.md#allcrioyml

if the registry prefix or location variables contain paths (e.g. location: "my-registry/location/prod") the container-engine/cri-o : Cri-o | write registries configs task fails.

Which issue(s) this PR fixes:
Fixes #11029

Special notes for your reviewer:
the task:
https://github.com/kubernetes-sigs/kubespray/blob/master/roles/container-engine/cri-o/tasks/main.yaml#L158

replaces : -> _. This PR will do the same for /. I.E. replace / -> _

inventory:

vars:
  container_manager: crio
  # remap my-registry prod path -> testing
  crio_registries:
    - prefix: "my-registry/location/prod"
      insecure: false
      blocked: false
      location: "my-registry/location/testing"
      unqualified: false

will result in file:

ls /etc/containers/registries.conf.d
01-unqualified.conf  10-my-registry_location_prod_config.conf

Does this PR introduce a user-facing change?:

 fix crio registries config file when using slashes in the registry path

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 23, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 23, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @pedro-peter. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 23, 2024
@pedro-peter pedro-peter changed the title crio registry rewrite patch crio container runtime crio_registries path fix Mar 23, 2024
@pedro-peter
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 23, 2024
@yankay
Copy link
Member

yankay commented Mar 28, 2024

/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 Mar 28, 2024
@yankay
Copy link
Member

yankay commented Apr 2, 2024

Thanks @pedro-peter
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pedro-peter, 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2024
Copy link
Contributor

@VannTen VannTen left a comment

Choose a reason for hiding this comment

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

I think it should be better to have a dict instead of an array, and use the key for the filename instead of hijacking location or prefix like that. But it's not worth a breaking change (which it would be) so let's settle for regex_replace.

roles/container-engine/cri-o/tasks/main.yaml Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 8, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 8, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 8, 2024
Copy link

linux-foundation-easycla bot commented May 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: pedro-peter / name: peterw (0a01f54)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. labels May 8, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 8, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 8, 2024
@VannTen
Copy link
Contributor

VannTen commented May 8, 2024 via email

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 9, 2024
@pedro-peter
Copy link
Contributor Author

updated release note & rebased of master.

@VannTen
Copy link
Contributor

VannTen commented May 9, 2024

Please rebase, I don't think the cilium stuff is related ?

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 9, 2024
@VannTen
Copy link
Contributor

VannTen commented May 17, 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 May 17, 2024
@k8s-ci-robot k8s-ci-robot merged commit 0b464b5 into kubernetes-sigs:master May 17, 2024
62 checks passed
@pedro-peter
Copy link
Contributor Author

thanks @VannTen

itayporezky pushed a commit to itayporezky/kubespray that referenced this pull request May 19, 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. kind/bug Categorizes issue or PR as related to a bug. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
4 participants