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

Use replace() for Services instead of patch() #128

Merged
merged 1 commit into from
Oct 16, 2020
Merged

Conversation

seleznev
Copy link
Collaborator

k8s-handle uses patch() API call for Services because of historical reason (looks like kubectl didn't support replace for services some years ago) and can't delete labels/annotations from the Services:

2020-10-13 06:25:37 INFO:k8s_handle.k8s.provisioner:Service "test-service" already exists, replace it
2020-10-13 06:25:37 WARNING:k8s_handle.k8s.provisioner:
       ___
    .-'   `-.
   /  \   /  \\     Please pay attention to service annotations!
  .   o\ /o   .    The next annotation(s) missing in template:
  |___  ^  ___|    "test-annotation"
      |___|        They won\'t be deleted after service apply.
      |||||

I propose to start using replace() for Services because kubernetes client works well for now.

@seleznev seleznev added the enhancement New feature or request label Oct 13, 2020
@seleznev seleznev self-assigned this Oct 13, 2020
# WORKAROUND https://github.com/kubernetes-client/gen/issues/52, https://github.com/kubernetes-client/python/issues/1098
# WORKAROUND:
# - https://github.com/kubernetes-client/gen/issues/52
# - https://github.com/kubernetes-client/python/issues/1098
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tox argued about "too long line".

@seleznev seleznev requested review from a user and nevlkv October 14, 2020 03:10
Copy link
Collaborator

@furiousassault furiousassault left a comment

Choose a reason for hiding this comment

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

LGTM

@seleznev seleznev merged commit 6d4895d into master Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants