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

Uninstallation of selinux packages in container-engine docker reset.yml #11055

Closed
liofko opened this issue Apr 4, 2024 · 7 comments · Fixed by #11075
Closed

Uninstallation of selinux packages in container-engine docker reset.yml #11055

liofko opened this issue Apr 4, 2024 · 7 comments · Fixed by #11075
Assignees

Comments

@liofko
Copy link

liofko commented Apr 4, 2024

While installing, seems like the "Remove docker package" task in "container-engine/docker/tasks/reset.yml" is removing all the packages which start with "container" (e.g. container-selinux, containers-common) and not only the ones starting with "containerd".
This is probably due to the python regex with handle "*" as "Zero or more occurrences" in '^containerd*', so the "d" is not a must.
containerd_package: "{{ ansible_facts.packages.keys() | select('search', '^containerd*') }}"

Is it a bug or the intention was to remove all the "container*" packages (if so, its problematic since removing container-selinux is uninstalling other important packages as selinux-policy) ?

Thanks

@KubeKyrie
Copy link
Contributor

Uninstalling selinux-policy is not expected, maybe it's bug.

@KubeKyrie
Copy link
Contributor

Oh, the packages which start with "container" could not be matched in ^containerd*

@liofko
Copy link
Author

liofko commented Apr 8, 2024

In my case it matched
Since the * means no "d" at all as well (Zero or more occurrences)

For enforcing containerd, maybe its should be '+' ?
containerd_package: "{{ ansible_facts.packages.keys() | select('search', '^containerd+') }}"

@KubeKyrie
Copy link
Contributor

@liofko Could you please provide some screenshots to verify the existence of this problem?

@liofko
Copy link
Author

liofko commented Apr 11, 2024

Hi,
This is the output in my case:
TASK [container-engine/docker : Docker | Remove docker package] ****************
ok: [node1] => (item=docker-compose-plugin)
ok: [node1] => (item=docker-buildx-plugin)
ok: [node1] => (item=docker-ce-cli)
ok: [node1] => (item=docker-ce-rootless-extras)
ok: [node1] => (item=docker-ce)
ok: [node1] => (item=container-selinux)
ok: [node1] => (item=containers-common)
ok: [node1] => (item=containerd.io)
Wednesday 03 April 2024 11:19:10 +0300 (0:00:42.913) 0:02:07.868 *******
Wednesday 03 April 2024 11:19:10 +0300 (0:00:00.158) 0:02:08.027 *******
Wednesday 03 April 2024 11:19:10 +0300 (0:00:00.106) 0:02:08.133 *******

After changing '^containerd*' to '^containerd+' Its deleted only "containerd.io"

@KubeKyrie
Copy link
Contributor

KubeKyrie commented Apr 11, 2024

@liofko Good catch!
Have to say, it surprised me. I will open an PR to fix it later.

@KubeKyrie
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants