@@ -12,6 +12,10 @@ import (
12
12
"time"
13
13
14
14
"github.com/deckhouse/deckhouse/pkg/log"
15
+ "github.com/gofrs/uuid/v5"
16
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
17
+ "k8s.io/client-go/tools/leaderelection"
18
+
15
19
"github.com/flant/addon-operator/pkg"
16
20
"github.com/flant/addon-operator/pkg/addon-operator/converge"
17
21
"github.com/flant/addon-operator/pkg/app"
@@ -42,9 +46,6 @@ import (
42
46
"github.com/flant/shell-operator/pkg/task/queue"
43
47
fileUtils "github.com/flant/shell-operator/pkg/utils/file"
44
48
"github.com/flant/shell-operator/pkg/utils/measure"
45
- "github.com/gofrs/uuid/v5"
46
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
47
- "k8s.io/client-go/tools/leaderelection"
48
49
)
49
50
50
51
const (
@@ -986,7 +987,7 @@ func (op *AddonOperator) DrainModuleQueues(modName string) {
986
987
}
987
988
988
989
// ParallelTasksHandler handles limited types of tasks in parallel queues.
989
- func (op * AddonOperator ) ParallelTasksHandler (ctx context.Context , t sh_task.Task ) queue.TaskResult {
990
+ func (op * AddonOperator ) ParallelTasksHandler (_ context.Context , t sh_task.Task ) queue.TaskResult {
990
991
taskLogLabels := t .GetLogLabels ()
991
992
taskLogEntry := utils .EnrichLoggerWithLabels (op .Logger , taskLogLabels )
992
993
var res queue.TaskResult
@@ -1612,15 +1613,14 @@ func (op *AddonOperator) handleQueueSynchronizationPhase(
1612
1613
syncTask := op .createSynchronizationTask (t , hook , info , hm )
1613
1614
1614
1615
// Sort tasks by queue destination and wait requirements
1615
- if syncTask .GetQueueName () == t .GetQueueName () {
1616
+ if syncTask .GetQueueName () == t .GetQueueName () { //nolint: gocritic
1616
1617
mainSyncTasks = append (mainSyncTasks , syncTask )
1617
1618
} else if info .KubernetesBinding .WaitForSynchronization {
1618
1619
parallelSyncTasksToWait = append (parallelSyncTasksToWait , syncTask )
1619
1620
} else {
1620
1621
parallelSyncTasks = append (parallelSyncTasks , syncTask )
1621
1622
}
1622
1623
})
1623
-
1624
1624
if err != nil {
1625
1625
logEntry .Error ("Failed to enable Kubernetes bindings" , log .Err (err ))
1626
1626
return queue.TaskResult {Status : queue .Fail }
@@ -1949,7 +1949,7 @@ func (op *AddonOperator) combineModuleHookBindingContexts(
1949
1949
func (op * AddonOperator ) executeModuleHook (
1950
1950
t sh_task.Task ,
1951
1951
module * modules.BasicModule ,
1952
- hook * hooks.ModuleHook ,
1952
+ _ * hooks.ModuleHook ,
1953
1953
hm task.HookMetadata ,
1954
1954
logEntry * log.Logger ,
1955
1955
metricLabels map [string ]string ,
@@ -1968,7 +1968,6 @@ func (op *AddonOperator) executeModuleHook(
1968
1968
// Run the hook and capture value checksums
1969
1969
beforeChecksum , afterChecksum , err := op .ModuleManager .RunModuleHook (
1970
1970
hm .ModuleName , hm .HookName , hm .BindingType , hm .BindingContext , t .GetLogLabels ())
1971
-
1972
1971
// Handle hook execution errors
1973
1972
if err != nil {
1974
1973
if hm .AllowFailure {
0 commit comments