Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
  • Loading branch information
ywk253100 committed Jan 8, 2024
1 parent 314c587 commit 60fe4ad
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pkg/install/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ func TestDeployment(t *testing.T) {

deploy = Deployment("velero", WithEnableInformerCache())
assert.Len(t, deploy.Spec.Template.Spec.Containers[0].Args, 2)
assert.Equal(t, "--enable-informer-cache=false", deploy.Spec.Template.Spec.Containers[0].Args[1])
assert.Equal(t, "--enable-informer-cache=true", deploy.Spec.Template.Spec.Containers[0].Args[1])
}
4 changes: 2 additions & 2 deletions test/e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ UPLOADER_TYPE ?=

SNAPSHOT_MOVE_DATA ?= false
DATA_MOVER_PLUGIN ?=
DISABLE_INFORMER_CACHE ?= false
ENABLE_INFORMER_CACHE ?= true


.PHONY:ginkgo
Expand Down Expand Up @@ -157,7 +157,7 @@ run: ginkgo
-standby-cluster-plugins=$(STANDBY_CLUSTER_PLUGINS) \
-standby-cluster-object-store-provider=$(STANDBY_CLUSTER_OBJECT_STORE_PROVIDER) \
-debug-velero-pod-restart=$(DEBUG_VELERO_POD_RESTART) \
-disable-informer-cache=$(DISABLE_INFORMER_CACHE)
-enable-informer-cache=$(ENABLE_INFORMER_CACHE)


build: ginkgo
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func init() {
flag.StringVar(&VeleroCfg.StandbyClusterPlugins, "standby-cluster-plugins", "", "plugins provider for standby cluster.")
flag.StringVar(&VeleroCfg.StandbyClusterOjbectStoreProvider, "standby-cluster-object-store-provider", "", "object store provider for standby cluster.")
flag.BoolVar(&VeleroCfg.DebugVeleroPodRestart, "debug-velero-pod-restart", false, "a switch for debugging velero pod restart.")
flag.BoolVar(&VeleroCfg.DisableInformerCache, "disable-informer-cache", false, "a switch for disable informer cache.")
flag.BoolVar(&VeleroCfg.EnableInformerCache, "enable-informer-cache", true, "a switch for enable informer cache.")
}

var _ = Describe("[APIGroup][APIVersion] Velero tests with various CRD API group versions", APIGropuVersionsTest)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ func MigrationTest(useVolumeSnapshots bool, veleroCLI2Version VeleroCLI2Version)
OriginVeleroCfg.Plugins = ""
//TODO: Remove this setting when migration path is from 1.13 to higher version
//TODO: or self, because version 1.12 and older versions have no this parameter.
OriginVeleroCfg.WithoutDisableInformerCacheParam = true
OriginVeleroCfg.DisableInformerCache = false
OriginVeleroCfg.WithoutEnableInformerCacheParam = false
OriginVeleroCfg.EnableInformerCache = true
}
Expect(VeleroInstall(context.Background(), &OriginVeleroCfg, false)).To(Succeed())
if veleroCLI2Version.VeleroVersion != "self" {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
}
//TODO: Remove this setting when upgrade path is from 1.13 to higher
//TODO: version, or self version 1.12 and older versions have no this parameter.
tmpCfgForOldVeleroInstall.WithoutDisableInformerCacheParam = true
tmpCfgForOldVeleroInstall.DisableInformerCache = false
tmpCfgForOldVeleroInstall.WithoutEnableInformerCacheParam = false
tmpCfgForOldVeleroInstall.EnableInformerCache = true

Expect(VeleroInstall(context.Background(), &tmpCfgForOldVeleroInstall, false)).To(Succeed())
Expect(CheckVeleroVersion(context.Background(), tmpCfgForOldVeleroInstall.VeleroCLI,
Expand Down
4 changes: 2 additions & 2 deletions test/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ type VeleroConfig struct {
StandbyClusterOjbectStoreProvider string
DebugVeleroPodRestart bool
IsUpgradeTest bool
WithoutDisableInformerCacheParam bool
DisableInformerCache bool
WithoutEnableInformerCacheParam bool
EnableInformerCache bool
}

type VeleroCfgInPerf struct {
Expand Down
18 changes: 9 additions & 9 deletions test/util/velero/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ const (
// we provide more install options other than the standard install.InstallOptions in E2E test
type installOptions struct {
*install.Options
RegistryCredentialFile string
RestoreHelperImage string
VeleroServerDebugMode bool
WithoutDisableInformerCacheParam bool
RegistryCredentialFile string
RestoreHelperImage string
VeleroServerDebugMode bool
WithoutEnableInformerCacheParam bool
}

func VeleroInstall(ctx context.Context, veleroCfg *VeleroConfig, isStandbyCluster bool) error {
Expand Down Expand Up @@ -131,7 +131,7 @@ func VeleroInstall(ctx context.Context, veleroCfg *VeleroConfig, isStandbyCluste
veleroInstallOptions.VeleroPodCPURequest = veleroCfg.VeleroPodCPURequest
veleroInstallOptions.VeleroPodMemLimit = veleroCfg.VeleroPodMemLimit
veleroInstallOptions.VeleroPodMemRequest = veleroCfg.VeleroPodMemRequest
veleroInstallOptions.DisableInformerCache = veleroCfg.DisableInformerCache
veleroInstallOptions.EnableInformerCache = veleroCfg.EnableInformerCache

err = installVeleroServer(ctx, veleroCfg.VeleroCLI, veleroCfg.CloudProvider, &installOptions{
Options: veleroInstallOptions,
Expand Down Expand Up @@ -248,11 +248,11 @@ func installVeleroServer(ctx context.Context, cli, cloudProvider string, options
args = append(args, "--plugins", options.Plugins.String())
}

if !options.WithoutDisableInformerCacheParam {
if options.DisableInformerCache {
args = append(args, "--disable-informer-cache=true")
if !options.WithoutEnableInformerCacheParam {
if options.EnableInformerCache {
args = append(args, "--enable-informer-cache=true")
} else {
args = append(args, "--disable-informer-cache=false")
args = append(args, "--enable-informer-cache=false")
}
}

Expand Down

0 comments on commit 60fe4ad

Please sign in to comment.