Skip to content

Commit 36bbdd6

Browse files
authored
Merge pull request kubernetes#127466 from guozheng-shen/fix-return
endpointsLeasesResourceLock and configMapsLeasesResourceLock has been removed
2 parents 5fc4e71 + a302abb commit 36bbdd6

File tree

1 file changed

+4
-70
lines changed
  • staging/src/k8s.io/client-go/tools/leaderelection/resourcelock

1 file changed

+4
-70
lines changed

staging/src/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -35,74 +35,8 @@ const (
3535
endpointsResourceLock = "endpoints"
3636
configMapsResourceLock = "configmaps"
3737
LeasesResourceLock = "leases"
38-
// When using endpointsLeasesResourceLock, you need to ensure that
39-
// API Priority & Fairness is configured with non-default flow-schema
40-
// that will catch the necessary operations on leader-election related
41-
// endpoint objects.
42-
//
43-
// The example of such flow scheme could look like this:
44-
// apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
45-
// kind: FlowSchema
46-
// metadata:
47-
// name: my-leader-election
48-
// spec:
49-
// distinguisherMethod:
50-
// type: ByUser
51-
// matchingPrecedence: 200
52-
// priorityLevelConfiguration:
53-
// name: leader-election # reference the <leader-election> PL
54-
// rules:
55-
// - resourceRules:
56-
// - apiGroups:
57-
// - ""
58-
// namespaces:
59-
// - '*'
60-
// resources:
61-
// - endpoints
62-
// verbs:
63-
// - get
64-
// - create
65-
// - update
66-
// subjects:
67-
// - kind: ServiceAccount
68-
// serviceAccount:
69-
// name: '*'
70-
// namespace: kube-system
71-
endpointsLeasesResourceLock = "endpointsleases"
72-
// When using configMapsLeasesResourceLock, you need to ensure that
73-
// API Priority & Fairness is configured with non-default flow-schema
74-
// that will catch the necessary operations on leader-election related
75-
// configmap objects.
76-
//
77-
// The example of such flow scheme could look like this:
78-
// apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
79-
// kind: FlowSchema
80-
// metadata:
81-
// name: my-leader-election
82-
// spec:
83-
// distinguisherMethod:
84-
// type: ByUser
85-
// matchingPrecedence: 200
86-
// priorityLevelConfiguration:
87-
// name: leader-election # reference the <leader-election> PL
88-
// rules:
89-
// - resourceRules:
90-
// - apiGroups:
91-
// - ""
92-
// namespaces:
93-
// - '*'
94-
// resources:
95-
// - configmaps
96-
// verbs:
97-
// - get
98-
// - create
99-
// - update
100-
// subjects:
101-
// - kind: ServiceAccount
102-
// serviceAccount:
103-
// name: '*'
104-
// namespace: kube-system
105-
configMapsLeasesResourceLock = "configmapsleases"
38+
endpointsLeasesResourceLock = "endpointsleases"
39+
configMapsLeasesResourceLock = "configmapsleases"
10640
)
10741

10842
// LeaderElectionRecord is the record that is stored in the leader election annotation.
@@ -177,9 +111,9 @@ func New(lockType string, ns string, name string, coreClient corev1.CoreV1Interf
177111
}
178112
switch lockType {
179113
case endpointsResourceLock:
180-
return nil, fmt.Errorf("endpoints lock is removed, migrate to %s (using version v0.27.x)", endpointsLeasesResourceLock)
114+
return nil, fmt.Errorf("endpoints lock is removed, migrate to %s", LeasesResourceLock)
181115
case configMapsResourceLock:
182-
return nil, fmt.Errorf("configmaps lock is removed, migrate to %s (using version v0.27.x)", configMapsLeasesResourceLock)
116+
return nil, fmt.Errorf("configmaps lock is removed, migrate to %s", LeasesResourceLock)
183117
case LeasesResourceLock:
184118
return leaseLock, nil
185119
case endpointsLeasesResourceLock:

0 commit comments

Comments
 (0)