File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
pkg/apis/sharding/v1alpha1 Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,6 @@ limitations under the License.
1616
1717package v1alpha1
1818
19- import (
20- "crypto/sha256"
21- "encoding/hex"
22-
23- "k8s.io/utils/strings"
24- )
25-
2619// This file contains API-related constants for the sharding implementation, e.g. well-known annotations and labels.
2720
2821const (
@@ -51,26 +44,15 @@ const (
5144 // IdentityShardLeaseController is the identity that the shardlease controller uses to acquire leases of unavailable
5245 // shards.
5346 IdentityShardLeaseController = "shardlease-controller"
54-
55- delimiter = "-"
5647)
5748
5849// LabelShard returns the label on sharded objects that holds the name of the responsible shard within a ring.
5950func LabelShard (ringName string ) string {
60- return LabelShardPrefix + RingSuffix ( ringName )
51+ return LabelShardPrefix + ringName
6152}
6253
6354// LabelDrain returns the label on sharded objects that instructs the responsible shard within a ring to stop reconciling
6455// the object and remove both the shard and drain label.
6556func LabelDrain (ringName string ) string {
66- return LabelDrainPrefix + RingSuffix (ringName )
67- }
68-
69- // RingSuffix returns the label key for a given ring name that is appended to a qualified prefix.
70- func RingSuffix (ringName string ) string {
71- keyHash := sha256 .Sum256 ([]byte (ringName ))
72- hexHash := hex .EncodeToString (keyHash [:])
73-
74- // the label part after the "/" must not exceed 63 characters, cut off at 63 characters
75- return strings .ShortenString (hexHash [:8 ]+ delimiter + ringName , 63 )
57+ return LabelDrainPrefix + ringName
7658}
You can’t perform that action at this time.
0 commit comments