Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dobrerazvan committed Mar 13, 2024
1 parent b5f3e5a commit 3878a0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ func main() {
// same watched namespaces will return the same hash so only one operator will be active
h := md5.New()
io.WriteString(h, namespaces)

Check failure on line 137 in main.go

View workflow job for this annotation

GitHub Actions / Build

Error return value of `io.WriteString` is not checked (errcheck)
leaderElectionHash := fmt.Sprintf("%x", h.Sum(nil))
leaderElectionID := fmt.Sprintf("%s-%x", "controller-leader-election-helper", h.Sum(nil))
setupLog.Info("Using leader electrion id", "LeaderElectionID", leaderElectionID, "watched namespaces", namespaceList)

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
LeaderElection: enableLeaderElection,
LeaderElectionID: fmt.Sprintf("%s-%s", "controller-leader-election-helper", leaderElectionHash),
LeaderElectionID: leaderElectionID,
WebhookServer: webhook.NewServer(webhook.Options{
Port: webhookServerPort,
CertDir: webhookCertDir,
Expand Down

0 comments on commit 3878a0b

Please sign in to comment.