Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <[email protected]>
  • Loading branch information
Pavel Okhlopkov committed Oct 24, 2024
1 parent 13db9c7 commit 28b91af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/addon-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"log"
"log/slog"
"os"
"strings"
Expand Down Expand Up @@ -133,7 +134,7 @@ func runHAMode(ctx context.Context, operator *addon_operator.AddonOperator) {

identity := fmt.Sprintf("%s.%s.%s.pod", podName, strings.ReplaceAll(podIP, ".", "-"), podNs)

if err := operator.WithLeaderElector(&leaderelection.LeaderElectionConfig{
err := operator.WithLeaderElector(&leaderelection.LeaderElectionConfig{
// Create a leaderElectionConfig for leader election
Lock: &resourcelock.LeaseLock{
LeaseMeta: v1.ObjectMeta{
Expand Down Expand Up @@ -171,9 +172,8 @@ func runHAMode(ctx context.Context, operator *addon_operator.AddonOperator) {
go func() {
<-ctx.Done()
unilogger.Info("Context canceled received")
err := syscall.Kill(1, syscall.SIGUSR2)
if err := syscall.Kill(1, syscall.SIGUSR2); err != nil {
log.Fatalf("Couldn't shutdown addon-operator: %s\n", err)
log.Fatalf("Couldn't shutdown addon-operator: %s\n", err.Error())
}
}()

Expand Down
1 change: 1 addition & 0 deletions pkg/helm_resources_manager/helm_resources_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/flant/kube-client/manifest"
log "github.com/flant/shell-operator/pkg/unilogger"
"k8s.io/apimachinery/pkg/labels"
cr_cache "sigs.k8s.io/controller-runtime/pkg/cache"
)

type HelmResourcesManager interface {
Expand Down

0 comments on commit 28b91af

Please sign in to comment.