Skip to content

Commit 177d275

Browse files
authored
Moved some functions to common package (#988)
* separate methods * basic refactoring * moved common code to util package to use it in gateway * common check for argo rollouts * made code compilable with latest changes on master * Moved options to separate package and created CommandLineOptions instance that will be in sync with options values. * reverted extra changes * initialize CommandLineOptions with default options in module init * wait for paused at annotation before checking deployment paused * moved things around to fix things * reverted unnecessary changes * reverted rolling_upgrade changes * reverted extra change * additional checks in reloader * refactor: ShouldReloadInternal method. It will be called by Reloader ShouldReload has some additional resource/namespace filter checks which are not needed for Reloader * added test cases * moved config to sharable packae * moved resource selector and label selctor methods * fixed pipeline * removed map.yaml * removed vague comment
1 parent 9b2af6f commit 177d275

14 files changed

Lines changed: 153 additions & 157 deletions

File tree

internal/pkg/cmd/reloader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ func startReloader(cmd *cobra.Command, args []string) {
133133
namespaceLabelSelector := ""
134134

135135
if isGlobal {
136-
namespaceLabelSelector, err = util.GetNamespaceLabelSelector()
136+
namespaceLabelSelector, err = common.GetNamespaceLabelSelector(options.NamespaceSelectors)
137137
if err != nil {
138138
logrus.Fatal(err)
139139
}
140140
}
141141

142-
resourceLabelSelector, err := util.GetResourceLabelSelector()
142+
resourceLabelSelector, err := common.GetResourceLabelSelector(options.ResourceSelectors)
143143
if err != nil {
144144
logrus.Fatal(err)
145145
}

internal/pkg/controller/controller_test.go

Lines changed: 37 additions & 36 deletions
Large diffs are not rendered by default.

internal/pkg/handler/create.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/sirupsen/logrus"
55
"github.com/stakater/Reloader/internal/pkg/metrics"
66
"github.com/stakater/Reloader/internal/pkg/options"
7-
"github.com/stakater/Reloader/internal/pkg/util"
7+
"github.com/stakater/Reloader/pkg/common"
88
v1 "k8s.io/api/core/v1"
99
"k8s.io/client-go/tools/record"
1010
)
@@ -33,13 +33,13 @@ func (r ResourceCreatedHandler) Handle() error {
3333
}
3434

3535
// GetConfig gets configurations containing SHA, annotations, namespace and resource name
36-
func (r ResourceCreatedHandler) GetConfig() (util.Config, string) {
36+
func (r ResourceCreatedHandler) GetConfig() (common.Config, string) {
3737
var oldSHAData string
38-
var config util.Config
38+
var config common.Config
3939
if _, ok := r.Resource.(*v1.ConfigMap); ok {
40-
config = util.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
40+
config = common.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
4141
} else if _, ok := r.Resource.(*v1.Secret); ok {
42-
config = util.GetSecretConfig(r.Resource.(*v1.Secret))
42+
config = common.GetSecretConfig(r.Resource.(*v1.Secret))
4343
} else {
4444
logrus.Warnf("Invalid resource: Resource should be 'Secret' or 'Configmap' but found, %v", r.Resource)
4545
}

internal/pkg/handler/delete.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stakater/Reloader/internal/pkg/metrics"
1111
"github.com/stakater/Reloader/internal/pkg/options"
1212
"github.com/stakater/Reloader/internal/pkg/testutil"
13-
"github.com/stakater/Reloader/internal/pkg/util"
13+
"github.com/stakater/Reloader/pkg/common"
1414

1515
v1 "k8s.io/api/core/v1"
1616
"k8s.io/apimachinery/pkg/runtime"
@@ -42,33 +42,33 @@ func (r ResourceDeleteHandler) Handle() error {
4242
}
4343

4444
// GetConfig gets configurations containing SHA, annotations, namespace and resource name
45-
func (r ResourceDeleteHandler) GetConfig() (util.Config, string) {
45+
func (r ResourceDeleteHandler) GetConfig() (common.Config, string) {
4646
var oldSHAData string
47-
var config util.Config
47+
var config common.Config
4848
if _, ok := r.Resource.(*v1.ConfigMap); ok {
49-
config = util.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
49+
config = common.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
5050
} else if _, ok := r.Resource.(*v1.Secret); ok {
51-
config = util.GetSecretConfig(r.Resource.(*v1.Secret))
51+
config = common.GetSecretConfig(r.Resource.(*v1.Secret))
5252
} else {
5353
logrus.Warnf("Invalid resource: Resource should be 'Secret' or 'Configmap' but found, %v", r.Resource)
5454
}
5555
return config, oldSHAData
5656
}
5757

58-
func invokeDeleteStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
58+
func invokeDeleteStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
5959
if options.ReloadStrategy == constants.AnnotationsReloadStrategy {
6060
return removePodAnnotations(upgradeFuncs, item, config, autoReload)
6161
}
6262

6363
return removeContainerEnvVars(upgradeFuncs, item, config, autoReload)
6464
}
6565

66-
func removePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
66+
func removePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
6767
config.SHAValue = testutil.GetSHAfromEmptyData()
6868
return updatePodAnnotations(upgradeFuncs, item, config, autoReload)
6969
}
7070

71-
func removeContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
71+
func removeContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
7272
envVar := getEnvVarName(config.ResourceName, config.Type)
7373
container := getContainerUsingResource(upgradeFuncs, item, config, autoReload)
7474

internal/pkg/handler/handler.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package handler
22

3-
import (
4-
"github.com/stakater/Reloader/internal/pkg/util"
5-
)
3+
import "github.com/stakater/Reloader/pkg/common"
64

75
// ResourceHandler handles the creation and update of resources
86
type ResourceHandler interface {
97
Handle() error
10-
GetConfig() (util.Config, string)
8+
GetConfig() (common.Config, string)
119
}

internal/pkg/handler/update.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/stakater/Reloader/internal/pkg/metrics"
66
"github.com/stakater/Reloader/internal/pkg/options"
77
"github.com/stakater/Reloader/internal/pkg/util"
8+
"github.com/stakater/Reloader/pkg/common"
89
v1 "k8s.io/api/core/v1"
910
"k8s.io/client-go/tools/record"
1011
)
@@ -36,15 +37,15 @@ func (r ResourceUpdatedHandler) Handle() error {
3637
}
3738

3839
// GetConfig gets configurations containing SHA, annotations, namespace and resource name
39-
func (r ResourceUpdatedHandler) GetConfig() (util.Config, string) {
40+
func (r ResourceUpdatedHandler) GetConfig() (common.Config, string) {
4041
var oldSHAData string
41-
var config util.Config
42+
var config common.Config
4243
if _, ok := r.Resource.(*v1.ConfigMap); ok {
4344
oldSHAData = util.GetSHAfromConfigmap(r.OldResource.(*v1.ConfigMap))
44-
config = util.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
45+
config = common.GetConfigmapConfig(r.Resource.(*v1.ConfigMap))
4546
} else if _, ok := r.Resource.(*v1.Secret); ok {
4647
oldSHAData = util.GetSHAfromSecret(r.OldResource.(*v1.Secret).Data)
47-
config = util.GetSecretConfig(r.Resource.(*v1.Secret))
48+
config = common.GetSecretConfig(r.Resource.(*v1.Secret))
4849
} else {
4950
logrus.Warnf("Invalid resource: Resource should be 'Secret' or 'Configmap' but found, %v", r.Resource)
5051
}

internal/pkg/handler/upgrade.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func GetArgoRolloutRollingUpgradeFuncs() callbacks.RollingUpgradeFuncs {
138138
}
139139
}
140140

141-
func sendUpgradeWebhook(config util.Config, webhookUrl string) error {
141+
func sendUpgradeWebhook(config common.Config, webhookUrl string) error {
142142
logrus.Infof("Changes detected in '%s' of type '%s' in namespace '%s', Sending webhook to '%s'",
143143
config.ResourceName, config.Type, config.Namespace, webhookUrl)
144144

@@ -169,7 +169,7 @@ func sendWebhook(url string) (string, []error) {
169169
return buffer.String(), nil
170170
}
171171

172-
func doRollingUpgrade(config util.Config, collectors metrics.Collectors, recorder record.EventRecorder, invoke invokeStrategy) error {
172+
func doRollingUpgrade(config common.Config, collectors metrics.Collectors, recorder record.EventRecorder, invoke invokeStrategy) error {
173173
clients := kube.GetClients()
174174

175175
err := rollingUpgrade(clients, config, GetDeploymentRollingUpgradeFuncs(), collectors, recorder, invoke)
@@ -203,7 +203,7 @@ func doRollingUpgrade(config util.Config, collectors metrics.Collectors, recorde
203203
return nil
204204
}
205205

206-
func rollingUpgrade(clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy) error {
206+
func rollingUpgrade(clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy) error {
207207
err := PerformAction(clients, config, upgradeFuncs, collectors, recorder, strategy)
208208
if err != nil {
209209
logrus.Errorf("Rolling upgrade for '%s' failed with error = %v", config.ResourceName, err)
@@ -212,7 +212,7 @@ func rollingUpgrade(clients kube.Clients, config util.Config, upgradeFuncs callb
212212
}
213213

214214
// PerformAction invokes the deployment if there is any change in configmap or secret data
215-
func PerformAction(clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy) error {
215+
func PerformAction(clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy) error {
216216
items := upgradeFuncs.ItemsFunc(clients, config.Namespace)
217217

218218
for _, item := range items {
@@ -249,7 +249,7 @@ func retryOnConflict(backoff wait.Backoff, fn func(_ bool) error) error {
249249
return err
250250
}
251251

252-
func upgradeResource(clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy, resource runtime.Object, fetchResource bool) error {
252+
func upgradeResource(clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, recorder record.EventRecorder, strategy invokeStrategy, resource runtime.Object, fetchResource bool) error {
253253
accessor, err := meta.Accessor(resource)
254254
if err != nil {
255255
return err
@@ -403,7 +403,7 @@ func getContainerWithEnvReference(containers []v1.Container, resourceName string
403403
return nil
404404
}
405405

406-
func getContainerUsingResource(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) *v1.Container {
406+
func getContainerUsingResource(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) *v1.Container {
407407
volumes := upgradeFuncs.VolumesFunc(item)
408408
containers := upgradeFuncs.ContainersFunc(item)
409409
initContainers := upgradeFuncs.InitContainersFunc(item)
@@ -464,24 +464,24 @@ type InvokeStrategyResult struct {
464464
Patch *Patch
465465
}
466466

467-
type invokeStrategy func(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult
467+
type invokeStrategy func(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult
468468

469-
func invokeReloadStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
469+
func invokeReloadStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
470470
if options.ReloadStrategy == constants.AnnotationsReloadStrategy {
471471
return updatePodAnnotations(upgradeFuncs, item, config, autoReload)
472472
}
473473
return updateContainerEnvVars(upgradeFuncs, item, config, autoReload)
474474
}
475475

476-
func updatePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
476+
func updatePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
477477
container := getContainerUsingResource(upgradeFuncs, item, config, autoReload)
478478
if container == nil {
479479
return InvokeStrategyResult{constants.NoContainerFound, nil}
480480
}
481481

482482
// Generate reloaded annotations. Attaching this to the item's annotation will trigger a rollout
483483
// Note: the data on this struct is purely informational and is not used for future updates
484-
reloadSource := util.NewReloadSourceFromConfig(config, []string{container.Name})
484+
reloadSource := common.NewReloadSourceFromConfig(config, []string{container.Name})
485485
annotations, patch, err := createReloadedAnnotations(&reloadSource, upgradeFuncs)
486486
if err != nil {
487487
logrus.Errorf("Failed to create reloaded annotations for %s! error = %v", config.ResourceName, err)
@@ -508,7 +508,7 @@ func getReloaderAnnotationKey() string {
508508
)
509509
}
510510

511-
func createReloadedAnnotations(target *util.ReloadSource, upgradeFuncs callbacks.RollingUpgradeFuncs) (map[string]string, []byte, error) {
511+
func createReloadedAnnotations(target *common.ReloadSource, upgradeFuncs callbacks.RollingUpgradeFuncs) (map[string]string, []byte, error) {
512512
if target == nil {
513513
return nil, nil, errors.New("target is required")
514514
}
@@ -543,7 +543,7 @@ func getEnvVarName(resourceName string, typeName string) string {
543543
return constants.EnvVarPrefix + util.ConvertToEnvVarName(resourceName) + "_" + typeName
544544
}
545545

546-
func updateContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
546+
func updateContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
547547
envVar := getEnvVarName(config.ResourceName, config.Type)
548548
container := getContainerUsingResource(upgradeFuncs, item, config, autoReload)
549549

internal/pkg/handler/upgrade_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/stakater/Reloader/internal/pkg/options"
1818
"github.com/stakater/Reloader/internal/pkg/testutil"
1919
"github.com/stakater/Reloader/internal/pkg/util"
20+
"github.com/stakater/Reloader/pkg/common"
2021
"github.com/stakater/Reloader/pkg/kube"
2122
"github.com/stretchr/testify/assert"
2223
v1 "k8s.io/api/core/v1"
@@ -1488,13 +1489,13 @@ func teardownErs() {
14881489

14891490
}
14901491

1491-
func getConfigWithAnnotations(resourceType string, name string, shaData string, annotation string, typedAutoAnnotation string) util.Config {
1492+
func getConfigWithAnnotations(resourceType string, name string, shaData string, annotation string, typedAutoAnnotation string) common.Config {
14921493
ns := ersNamespace
14931494
if options.ReloadStrategy == constants.AnnotationsReloadStrategy {
14941495
ns = arsNamespace
14951496
}
14961497

1497-
return util.Config{
1498+
return common.Config{
14981499
Namespace: ns,
14991500
ResourceName: name,
15001501
SHAValue: shaData,
@@ -1511,7 +1512,7 @@ func getCollectors() metrics.Collectors {
15111512
var labelSucceeded = prometheus.Labels{"success": "true"}
15121513
var labelFailed = prometheus.Labels{"success": "false"}
15131514

1514-
func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
1515+
func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
15151516
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
15161517
time.Sleep(5 * time.Second)
15171518
if err != nil {
@@ -1529,7 +1530,7 @@ func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Client
15291530
}
15301531
}
15311532

1532-
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
1533+
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
15331534
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
15341535
upgradeFuncs.PatchFunc = func(client kube.Clients, namespace string, resource runtime.Object, patchType patchtypes.PatchType, bytes []byte) error {
15351536
assert.Equal(t, patchtypes.StrategicMergePatchType, patchType)
@@ -2909,7 +2910,7 @@ func TestIgnoreAnnotationNoReloadUsingErs(t *testing.T) {
29092910
}
29102911
}
29112912

2912-
func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
2913+
func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
29132914
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
29142915
time.Sleep(5 * time.Second)
29152916
if err != nil {
@@ -2926,7 +2927,7 @@ func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Client
29262927
}
29272928
}
29282929

2929-
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
2930+
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
29302931
assert.NotEmpty(t, upgradeFuncs.PatchTemplatesFunc().DeleteEnvVarTemplate)
29312932

29322933
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)

internal/pkg/leadership/leadership_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/stakater/Reloader/internal/pkg/metrics"
1717
"github.com/stakater/Reloader/internal/pkg/options"
1818
"github.com/stakater/Reloader/internal/pkg/testutil"
19-
"github.com/stakater/Reloader/internal/pkg/util"
19+
"github.com/stakater/Reloader/pkg/common"
2020
"github.com/stakater/Reloader/pkg/kube"
2121
)
2222

@@ -159,7 +159,7 @@ func TestRunLeaderElectionWithControllers(t *testing.T) {
159159
// Verifying deployment update
160160
logrus.Infof("Verifying pod envvars has been created")
161161
shaData := testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, testutil.Namespace, configmapName, "www.stakater.com")
162-
config := util.Config{
162+
config := common.Config{
163163
Namespace: testutil.Namespace,
164164
ResourceName: configmapName,
165165
SHAValue: shaData,
@@ -186,7 +186,7 @@ func TestRunLeaderElectionWithControllers(t *testing.T) {
186186
// Verifying that the deployment was not updated as leadership has been lost
187187
logrus.Infof("Verifying pod envvars has not been updated")
188188
shaData = testutil.ConvertResourceToSHA(testutil.ConfigmapResourceType, testutil.Namespace, configmapName, "www.stakater.com/new")
189-
config = util.Config{
189+
config = common.Config{
190190
Namespace: testutil.Namespace,
191191
ResourceName: configmapName,
192192
SHAValue: shaData,

internal/pkg/testutil/kube.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/stakater/Reloader/internal/pkg/metrics"
2222
"github.com/stakater/Reloader/internal/pkg/options"
2323
"github.com/stakater/Reloader/internal/pkg/util"
24+
"github.com/stakater/Reloader/pkg/common"
2425
"github.com/stakater/Reloader/pkg/kube"
2526
appsv1 "k8s.io/api/apps/v1"
2627
batchv1 "k8s.io/api/batch/v1"
@@ -733,7 +734,7 @@ func GetResourceSHAFromAnnotation(podAnnotations map[string]string) string {
733734
return ""
734735
}
735736

736-
var last util.ReloadSource
737+
var last common.ReloadSource
737738
bytes := []byte(annotationJson)
738739
err := json.Unmarshal(bytes, &last)
739740
if err != nil {
@@ -1058,7 +1059,7 @@ func RandSeq(n int) string {
10581059
}
10591060

10601061
// VerifyResourceEnvVarUpdate verifies whether the rolling upgrade happened or not
1061-
func VerifyResourceEnvVarUpdate(clients kube.Clients, config util.Config, envVarPostfix string, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
1062+
func VerifyResourceEnvVarUpdate(clients kube.Clients, config common.Config, envVarPostfix string, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
10621063
items := upgradeFuncs.ItemsFunc(clients, config.Namespace)
10631064
for _, i := range items {
10641065
containers := upgradeFuncs.ContainersFunc(i)
@@ -1104,7 +1105,7 @@ func VerifyResourceEnvVarUpdate(clients kube.Clients, config util.Config, envVar
11041105
}
11051106

11061107
// VerifyResourceEnvVarRemoved verifies whether the rolling upgrade happened or not and all Envvars SKAKATER_name_CONFIGMAP/SECRET are removed
1107-
func VerifyResourceEnvVarRemoved(clients kube.Clients, config util.Config, envVarPostfix string, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
1108+
func VerifyResourceEnvVarRemoved(clients kube.Clients, config common.Config, envVarPostfix string, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
11081109
items := upgradeFuncs.ItemsFunc(clients, config.Namespace)
11091110
for _, i := range items {
11101111
containers := upgradeFuncs.ContainersFunc(i)
@@ -1153,7 +1154,7 @@ func VerifyResourceEnvVarRemoved(clients kube.Clients, config util.Config, envVa
11531154
}
11541155

11551156
// VerifyResourceAnnotationUpdate verifies whether the rolling upgrade happened or not
1156-
func VerifyResourceAnnotationUpdate(clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
1157+
func VerifyResourceAnnotationUpdate(clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs) bool {
11571158
items := upgradeFuncs.ItemsFunc(clients, config.Namespace)
11581159
for _, i := range items {
11591160
podAnnotations := upgradeFuncs.PodAnnotationsFunc(i)

0 commit comments

Comments
 (0)