diff --git a/internal/pkg/handler/upgrade.go b/internal/pkg/handler/upgrade.go index a7b9bdcd..b87a8598 100644 --- a/internal/pkg/handler/upgrade.go +++ b/internal/pkg/handler/upgrade.go @@ -205,7 +205,6 @@ func doRollingUpgrade(config util.Config, collectors metrics.Collectors, recorde } func rollingUpgrade(clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy) error { - err := PerformAction(clients, config, upgradeFuncs, collectors, recorder, strategy) if err != nil { logrus.Errorf("Rolling upgrade for '%s' failed with error = %v", config.ResourceName, err) diff --git a/internal/pkg/handler/upgrade_test.go b/internal/pkg/handler/upgrade_test.go index 3a57783a..1d68a3ed 100644 --- a/internal/pkg/handler/upgrade_test.go +++ b/internal/pkg/handler/upgrade_test.go @@ -1441,18 +1441,16 @@ func TestRollingUpgradeForDeploymentWithConfigmapUsingArs(t *testing.T) { deploymentFuncs := GetDeploymentRollingUpgradeFuncs() collectors := getCollectors() - orgItemFunc := deploymentFuncs.ItemFunc - orgItemsFunc := deploymentFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 deploymentFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetDeploymentItem(client, namespace, name) } deploymentFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetDeploymentItems(client, namespace) } err := PerformAction(clients, config, deploymentFuncs, collectors, nil, invokeReloadStrategy) @@ -1492,18 +1490,16 @@ func TestRollingUpgradeForDeploymentWithPatchAndRetryUsingArs(t *testing.T) { assert.True(t, deploymentFuncs.SupportsPatch) assert.NotEmpty(t, deploymentFuncs.PatchTemplatesFunc().AnnotationTemplate) - orgItemFunc := deploymentFuncs.ItemFunc - orgItemsFunc := deploymentFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 deploymentFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetDeploymentItem(client, namespace, name) } deploymentFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetDeploymentItems(client, namespace) } patchCalled := 0 @@ -2238,18 +2234,16 @@ func TestRollingUpgradeForDaemonSetWithConfigmapUsingArs(t *testing.T) { daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs() collectors := getCollectors() - orgItemFunc := daemonSetFuncs.ItemFunc - orgItemsFunc := daemonSetFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 daemonSetFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetDaemonSetItem(client, namespace, name) } daemonSetFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetDaemonSetItems(client, namespace) } err := PerformAction(clients, config, daemonSetFuncs, collectors, nil, invokeReloadStrategy) @@ -2286,18 +2280,16 @@ func TestRollingUpgradeForDaemonSetWithPatchAndRetryUsingArs(t *testing.T) { config := getConfigWithAnnotations(envVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation) daemonSetFuncs := GetDaemonSetRollingUpgradeFuncs() - orgItemFunc := daemonSetFuncs.ItemFunc - orgItemsFunc := daemonSetFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 daemonSetFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetDaemonSetItem(client, namespace, name) } daemonSetFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetDaemonSetItems(client, namespace) } assert.True(t, daemonSetFuncs.SupportsPatch) @@ -2473,18 +2465,16 @@ func TestRollingUpgradeForStatefulSetWithConfigmapUsingArs(t *testing.T) { statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs() collectors := getCollectors() - orgItemFunc := statefulSetFuncs.ItemFunc - orgItemsFunc := statefulSetFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 statefulSetFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetStatefulSetItem(client, namespace, name) } statefulSetFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetStatefulSetItems(client, namespace) } err := PerformAction(clients, config, statefulSetFuncs, collectors, nil, invokeReloadStrategy) @@ -2521,18 +2511,16 @@ func TestRollingUpgradeForStatefulSetWithPatchAndRetryUsingArs(t *testing.T) { config := getConfigWithAnnotations(envVarPostfix, arsConfigmapName, shaData, options.ConfigmapUpdateOnChangeAnnotation, options.ConfigmapReloaderAutoAnnotation) statefulSetFuncs := GetStatefulSetRollingUpgradeFuncs() - orgItemFunc := statefulSetFuncs.ItemFunc - orgItemsFunc := statefulSetFuncs.ItemsFunc itemCalled := 0 itemsCalled := 0 statefulSetFuncs.ItemFunc = func(client kube.Clients, namespace string, name string) (runtime.Object, error) { itemCalled++ - return orgItemFunc(client, namespace, name) + return callbacks.GetStatefulSetItem(client, namespace, name) } statefulSetFuncs.ItemsFunc = func(client kube.Clients, namespace string) []runtime.Object { itemsCalled++ - return orgItemsFunc(client, namespace) + return callbacks.GetStatefulSetItems(client, namespace) } assert.True(t, statefulSetFuncs.SupportsPatch)