mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
uniquify resource lock identities
This commit is contained in:
@@ -33,6 +33,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/util/uuid"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apiserver/pkg/server/healthz"
|
||||
"k8s.io/client-go/informers"
|
||||
@@ -169,6 +170,8 @@ func Run(s *options.CloudControllerManagerServer) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// add a uniquifier so that two processes on the same host don't accidentally both become active
|
||||
id = id + "_" + string(uuid.NewUUID())
|
||||
|
||||
// Lock required for leader election
|
||||
rl, err := resourcelock.New(s.LeaderElection.ResourceLock,
|
||||
|
||||
Reference in New Issue
Block a user