Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Replace ':' with '.' in GC mark
Browse files Browse the repository at this point in the history
A valid Kubernetes label may only contain alphanumeric characters, '-',
'_' or '.', and must start and end with an alphanumeric character (e.g.
'MyValue',  or 'my_value',  or '12345'.
  • Loading branch information
hiddeco committed Mar 7, 2019
1 parent c9cda8a commit b7c9537
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cluster/kubernetes/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ func makeGCMark(syncSetName, resourceID string) string {
// 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))
// The prefix is in part to make sure it's a valid (Kubernetes)
return "sha256." + base64.RawURLEncoding.EncodeToString(hasher.Sum(nil))
}

// --- internal types for keeping track of syncing
Expand Down

0 comments on commit b7c9537

Please sign in to comment.