This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make garbage-collection labelling resource-specific #1798
Merged
2opremio
merged 2 commits into
fluxcd:master
from
2opremio:make-gc-labelling-resource-specific
Mar 7, 2019
Merged
Make garbage-collection labelling resource-specific #1798
2opremio
merged 2 commits into
fluxcd:master
from
2opremio:make-gc-labelling-resource-specific
Mar 7, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c7303e4
to
a2ca569
Compare
This prevents unintended delitions from happening if/when cluster object labels are copied around. I also, changed some names and tweaked comments a bit.
a2ca569
to
a085d5b
Compare
squaremo
approved these changes
Mar 6, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct to me. Can we have a test that resources with duplicated labels don't get collected?
Sure, I will add one tomorrow
…On Wed, Mar 6, 2019, 19:36 Michael Bridgen ***@***.***> wrote:
***@***.**** approved this pull request.
Looks correct to me. Can we have a test that resources with duplicated
labels don't get collected?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1798 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACQOJBW9Tz-5GNI4ZFzah9ofwtXchKMhks5vUAq-gaJpZM4bhcKy>
.
|
rndstr
reviewed
Mar 7, 2019
// To prevent deleting objects with copied labels | ||
// an object-specific mark is created (by including its identifier). | ||
hasher.Write([]byte(resourceID)) | ||
return "sha256:" + base64.RawURLEncoding.EncodeToString(hasher.Sum(nil)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the colon :
is not allowed in the k8s version we have running:
ts=2019-03-07T20:07:59.874086773Z caller=sync.go:482 component=cluster method=Sync cmd="kubectl apply -f -" took=1.260555818s err="running kubectl: The Secret \"my-secret\" is invalid: metadata.labels: Invalid value: \"sha256:XmUQTWgJCpTt_vgSxwB113djqIlbulw_bNcdVL9zNmk\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')" output=
will create an issue with more information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prevents unintended delitions from happening if/when cluster object labels
are copied around.
I also changed some names and tweaked comments a bit.
Fixes #1787
Disclaimer: I haven't tested it (yet)