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

fix: TELCO-887 Cleanup annotations #25

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

markbeierl
Copy link

On remove event, the library needs to also remove the networks annotation, and drop privileges

Description

Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • N/A I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • N/A Any dependent changes have been merged and published in downstream modules
  • I have bumped the version of the library

@markbeierl markbeierl requested a review from a team as a code owner December 14, 2023 19:06
On remove event, the library needs to also remove the networks annotation,
and drop privileges
@markbeierl markbeierl force-pushed the TELCO-887-annotation-cleanup branch from 3694e34 to b2ff67c Compare December 14, 2023 19:07
Copy link
Contributor

@Gmerold Gmerold left a comment

Choose a reason for hiding this comment

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

Do we need to do this? We're about to remove the StatefulSet so why do we care to revert the patch on the container?
It's clear that we need to cleanup NADs, which belong to the namespace, but security context and annotations belong to the container we're removing.

@markbeierl
Copy link
Author

Do we need to do this? We're about to remove the StatefulSet so why do we care to revert the patch on the container? It's clear that we need to cleanup NADs, which belong to the namespace, but security context and annotations belong to the container we're removing.

We are not necessarily removing the statefulset. If you scale the unit down to 0, and then scale it back up, this prevents the pod from restarting as the annotations cannot be satisfied and Juju loses control of the pod, resulting in the need for --force removal

@markbeierl
Copy link
Author

@Gmerold
Copy link
Contributor

Gmerold commented Dec 15, 2023

Do we need to do this? We're about to remove the StatefulSet so why do we care to revert the patch on the container? It's clear that we need to cleanup NADs, which belong to the namespace, but security context and annotations belong to the container we're removing.

We are not necessarily removing the statefulset. If you scale the unit down to 0, and then scale it back up, this prevents the pod from restarting as the annotations cannot be satisfied and Juju loses control of the pod, resulting in the need for --force removal

Ups :D

Copy link
Collaborator

@gruyaume gruyaume left a comment

Choose a reason for hiding this comment

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

Looks good besides the nitpick on the unit test name

@markbeierl markbeierl requested a review from gruyaume December 15, 2023 19:23
@markbeierl markbeierl merged commit 01b8674 into main Dec 19, 2023
8 checks passed
@markbeierl markbeierl deleted the TELCO-887-annotation-cleanup branch December 19, 2023 15:55
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 this pull request may close these issues.

3 participants