Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Provide 'append_hash' for ConfigMaps and Secrets #196

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

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

willthames
Copy link
Contributor

kubectl --append-hash adds a hash value to the name of a configmap
or secret so that they can be used immutably.

Using the same algorithms here, consumers of the dynamic client
can ask for a hash to be appended to a configmap or secret name.

To generate the hash requires the data, so get and delete
have been backwardly compatibly updated to accept parameters to
generate the hash

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 27, 2018
@openshift-ci-robot
Copy link

Hi @willthames. Thanks for your PR.

I'm waiting for a openshift 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.

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.

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 27, 2018
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 29, 2018
@willthames
Copy link
Contributor Author

Looks like tests are failing because it's testing against kubernetes 7.0.0

I've rebased my PR on #197 for now - this PR will then make sense to review after #197 is merged

@fabianvf
Copy link
Member

@willthames, merged #197, can you rebase?

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 29, 2018
@willthames
Copy link
Contributor Author

@fabianvf rebased now

@fabianvf fabianvf self-requested a review August 31, 2018 16:10
@fabianvf
Copy link
Member

hmm... I can see the benefit to adding the functionality that will allow the user to generate the hash, and then have them pass the new name into a get/create/delete/patch/replace call, but I'd prefer to keep the implementation of those main CRUD calls as generic as possible. How do you feel about taking out the changes to the dynamic client itself but leaving all the helpers + tests (and maybe adding a definition mutating function as well)?

@willthames
Copy link
Contributor Author

@fabianvf - I can quite understand those concerns, that all sounds reasonable to me, but I don't understand what you mean about adding a definition mutating function - what would that look like/do?

@fabianvf
Copy link
Member

fabianvf commented Sep 1, 2018

@willthames, sorry, that was pretty unclear phrasing on my part. I meant a function that takes an object definition and returns an object definition with the hash appended to the name, like what you currently have inside the CRUD functions.

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 3, 2018
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 3, 2018
@willthames
Copy link
Contributor Author

The problem with the name helper function is that you have to know beforehand whether the hash has already been added or not. It's easier to just update the name at that point to be name + hash rather than have a separate function.

I think I'm fine with how this is now - let me know

kubectl --append-hash adds a hash value to the name of a configmap
or secret so that they can be used immutably.

Using the same algorithms here, consumers of the dynamic client
can generate the same hash that they can then append to a
configmap or secret name.
@fabianvf fabianvf merged commit 2465ae3 into openshift:master Sep 12, 2018
@fabianvf
Copy link
Member

/cherrypick release-0.7

@openshift-cherrypick-robot

@fabianvf: new pull request created: #216

In response to this:

/cherrypick release-0.7

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.

@fabianvf
Copy link
Member

sweet I wasn't sure if we'd get the bot cherrypick stuff

willthames added a commit to willthames/openshift-restclient-python that referenced this pull request Nov 22, 2018
kubectl --append-hash adds a hash value to the name of a configmap
or secret so that they can be used immutably.

Using the same algorithms here, consumers of the dynamic client
can generate the same hash that they can then append to a
configmap or secret name.
willthames added a commit to willthames/openshift-restclient-python that referenced this pull request Nov 22, 2019
kubectl --append-hash adds a hash value to the name of a configmap
or secret so that they can be used immutably.

Using the same algorithms here, consumers of the dynamic client
can generate the same hash that they can then append to a
configmap or secret name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants