Skip to content

Commit 9457135

Browse files
committed
moved config to sharable packae
1 parent 9d08c81 commit 9457135

File tree

14 files changed

+3629
-417
lines changed

14 files changed

+3629
-417
lines changed

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: 13 additions & 13 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
@@ -264,7 +264,7 @@ func upgradeResource(clients kube.Clients, config util.Config, upgradeFuncs call
264264
}
265265
annotations := upgradeFuncs.AnnotationsFunc(resource)
266266
podAnnotations := upgradeFuncs.PodAnnotationsFunc(resource)
267-
result := common.ShouldReloadInternal(config, upgradeFuncs.ResourceType, annotations, podAnnotations, common.GetCommandLineOptions())
267+
result := common.ShouldReload(config, upgradeFuncs.ResourceType, annotations, podAnnotations, common.GetCommandLineOptions())
268268

269269
if !result.ShouldReload {
270270
logrus.Debugf("No changes detected in '%s' of type '%s' in namespace '%s'", config.ResourceName, config.Type, config.Namespace)
@@ -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)
@@ -452,24 +452,24 @@ type InvokeStrategyResult struct {
452452
Patch *Patch
453453
}
454454

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

457-
func invokeReloadStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
457+
func invokeReloadStrategy(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
458458
if options.ReloadStrategy == constants.AnnotationsReloadStrategy {
459459
return updatePodAnnotations(upgradeFuncs, item, config, autoReload)
460460
}
461461
return updateContainerEnvVars(upgradeFuncs, item, config, autoReload)
462462
}
463463

464-
func updatePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
464+
func updatePodAnnotations(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
465465
container := getContainerUsingResource(upgradeFuncs, item, config, autoReload)
466466
if container == nil {
467467
return InvokeStrategyResult{constants.NoContainerFound, nil}
468468
}
469469

470470
// Generate reloaded annotations. Attaching this to the item's annotation will trigger a rollout
471471
// Note: the data on this struct is purely informational and is not used for future updates
472-
reloadSource := util.NewReloadSourceFromConfig(config, []string{container.Name})
472+
reloadSource := common.NewReloadSourceFromConfig(config, []string{container.Name})
473473
annotations, patch, err := createReloadedAnnotations(&reloadSource, upgradeFuncs)
474474
if err != nil {
475475
logrus.Errorf("Failed to create reloaded annotations for %s! error = %v", config.ResourceName, err)
@@ -496,7 +496,7 @@ func getReloaderAnnotationKey() string {
496496
)
497497
}
498498

499-
func createReloadedAnnotations(target *util.ReloadSource, upgradeFuncs callbacks.RollingUpgradeFuncs) (map[string]string, []byte, error) {
499+
func createReloadedAnnotations(target *common.ReloadSource, upgradeFuncs callbacks.RollingUpgradeFuncs) (map[string]string, []byte, error) {
500500
if target == nil {
501501
return nil, nil, errors.New("target is required")
502502
}
@@ -531,7 +531,7 @@ func getEnvVarName(resourceName string, typeName string) string {
531531
return constants.EnvVarPrefix + util.ConvertToEnvVarName(resourceName) + "_" + typeName
532532
}
533533

534-
func updateContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config util.Config, autoReload bool) InvokeStrategyResult {
534+
func updateContainerEnvVars(upgradeFuncs callbacks.RollingUpgradeFuncs, item runtime.Object, config common.Config, autoReload bool) InvokeStrategyResult {
535535
envVar := getEnvVarName(config.ResourceName, config.Type)
536536
container := getContainerUsingResource(upgradeFuncs, item, config, autoReload)
537537

internal/pkg/handler/upgrade_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/stakater/Reloader/internal/pkg/options"
1717
"github.com/stakater/Reloader/internal/pkg/testutil"
1818
"github.com/stakater/Reloader/internal/pkg/util"
19+
"github.com/stakater/Reloader/pkg/common"
1920
"github.com/stakater/Reloader/pkg/kube"
2021
"github.com/stretchr/testify/assert"
2122
"k8s.io/apimachinery/pkg/api/errors"
@@ -1486,13 +1487,13 @@ func teardownErs() {
14861487

14871488
}
14881489

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

1495-
return util.Config{
1496+
return common.Config{
14961497
Namespace: ns,
14971498
ResourceName: name,
14981499
SHAValue: shaData,
@@ -1509,7 +1510,7 @@ func getCollectors() metrics.Collectors {
15091510
var labelSucceeded = prometheus.Labels{"success": "true"}
15101511
var labelFailed = prometheus.Labels{"success": "false"}
15111512

1512-
func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
1513+
func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
15131514
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
15141515
time.Sleep(5 * time.Second)
15151516
if err != nil {
@@ -1527,7 +1528,7 @@ func testRollingUpgradeInvokeDeleteStrategyArs(t *testing.T, clients kube.Client
15271528
}
15281529
}
15291530

1530-
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
1531+
func testRollingUpgradeWithPatchAndInvokeDeleteStrategyArs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
15311532
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
15321533
upgradeFuncs.PatchFunc = func(client kube.Clients, namespace string, resource runtime.Object, patchType patchtypes.PatchType, bytes []byte) error {
15331534
assert.Equal(t, patchtypes.StrategicMergePatchType, patchType)
@@ -2907,7 +2908,7 @@ func TestIgnoreAnnotationNoReloadUsingErs(t *testing.T) {
29072908
}
29082909
}
29092910

2910-
func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config util.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
2911+
func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Clients, config common.Config, upgradeFuncs callbacks.RollingUpgradeFuncs, collectors metrics.Collectors, envVarPostfix string) {
29112912
err := PerformAction(clients, config, upgradeFuncs, collectors, nil, invokeDeleteStrategy)
29122913
time.Sleep(5 * time.Second)
29132914
if err != nil {
@@ -2924,7 +2925,7 @@ func testRollingUpgradeInvokeDeleteStrategyErs(t *testing.T, clients kube.Client
29242925
}
29252926
}
29262927

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

29302931
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)