kubernetes-sigs / kubespray

Deploy a Production Ready Kubernetes Cluster
Apache License 2.0
16.2k stars 6.49k forks source link

fix task naming in bootstrap-os #11714

Closed ErikJiang closed 4 days ago

ErikJiang commented 6 days ago

What type of PR is this?

/kind bug

What this PR does / why we need it:

The naming of some task files in bootstrap-os doesn't match the ID values in the actual os-release file, which will cause the related OS tasks not to be executed.

# nerdctl run --rm clearlinux:latest cat /etc/os-release |grep "^ID="
ID=clear-linux-os

# nerdctl run --rm redhat/ubi8:8.10 cat /etc/os-release |grep "^ID="
ID="rhel"

Which issue(s) this PR fixes:

Fixes #11712

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix task naming in bootstrap-os
MrFreezeex commented 6 days ago

Does this apply in those other places:

❯ find | grep -E '(redhat|clearlinux)'
./roles/container-engine/docker/vars/redhat-7.yml
./roles/container-engine/docker/vars/clearlinux.yml
./roles/container-engine/docker/vars/redhat.yml
./roles/bootstrap-os/tasks/clearlinux.yml
./roles/bootstrap-os/tasks/redhat.yml
./roles/kubernetes-apps/helm/vars/redhat-7.yml
./roles/kubernetes-apps/helm/vars/redhat.yml
./roles/adduser/vars/redhat.yml
./roles/network_plugin/calico/vars/redhat-9.yml
./roles/network_plugin/calico/vars/redhat.yml

too?

ErikJiang commented 5 days ago

@MrFreezeex It currently seems that only the bootstrap-os role parses the os-release file to identify different OS distributions. In contrast, other roles primarily differentiate based on ansible_distribution. Therefore, only the bootstrap-os role needs to be modified. The reason why the bootstrap-os role does not use the ansible_distribution method remains unclear. I suspect the information obtained through ansible_distribution may not fully meet the requirements for identifying different OS within bootstrap-os.

VannTen commented 4 days ago

/ok-to-test /approve

k8s-ci-robot commented 4 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ErikJiang, MrFreezeex, VannTen

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/kubespray/blob/master/OWNERS)~~ [VannTen] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
VannTen commented 4 days ago

/retest

VannTen commented 4 days ago

/cherrypick release-2.25 /cherrypick release-2.26

k8s-infra-cherrypick-robot commented 4 days ago

@VannTen: new pull request created: #11718

In response to [this](https://github.com/kubernetes-sigs/kubespray/pull/11714#issuecomment-2481394628): >/cherrypick release-2.25 >/cherrypick release-2.26 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
k8s-infra-cherrypick-robot commented 4 days ago

@VannTen: new pull request created: #11719

In response to [this](https://github.com/kubernetes-sigs/kubespray/pull/11714#issuecomment-2481394628): >/cherrypick release-2.25 >/cherrypick release-2.26 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.