mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 04:55:22 +00:00
Add param disable informer cache for velero installation
Signed-off-by: danfengl <danfengl@vmware.com>
This commit is contained in:
@@ -104,6 +104,7 @@ UPLOADER_TYPE ?=
|
||||
|
||||
SNAPSHOT_MOVE_DATA ?= false
|
||||
DATA_MOVER_PLUGIN ?=
|
||||
DISABLE_INFORMER_CACHE ?= false
|
||||
|
||||
|
||||
.PHONY:ginkgo
|
||||
@@ -155,7 +156,9 @@ run: ginkgo
|
||||
-standby-cluster-cloud-provider=$(STANDBY_CLUSTER_CLOUD_PROVIDER) \
|
||||
-standby-cluster-plugins=$(STANDBY_CLUSTER_PLUGINS) \
|
||||
-standby-cluster-object-store-provider=$(STANDBY_CLUSTER_OBJECT_STORE_PROVIDER) \
|
||||
-debug-velero-pod-restart=$(DEBUG_VELERO_POD_RESTART)
|
||||
-debug-velero-pod-restart=$(DEBUG_VELERO_POD_RESTART) \
|
||||
-disable-informer-cache=$(DISABLE_INFORMER_CACHE)
|
||||
|
||||
|
||||
build: ginkgo
|
||||
mkdir -p $(OUTPUT_DIR)
|
||||
|
||||
@@ -94,6 +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.")
|
||||
}
|
||||
|
||||
var _ = Describe("[APIGroup][APIVersion] Velero tests with various CRD API group versions", APIGropuVersionsTest)
|
||||
|
||||
@@ -165,6 +165,10 @@ func MigrationTest(useVolumeSnapshots bool, veleroCLI2Version VeleroCLI2Version)
|
||||
OriginVeleroCfg.VeleroImage = ""
|
||||
OriginVeleroCfg.RestoreHelperImage = ""
|
||||
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
|
||||
}
|
||||
Expect(VeleroInstall(context.Background(), &OriginVeleroCfg, false)).To(Succeed())
|
||||
if veleroCLI2Version.VeleroVersion != "self" {
|
||||
|
||||
@@ -145,6 +145,10 @@ func BackupUpgradeRestoreTest(useVolumeSnapshots bool, veleroCLI2Version VeleroC
|
||||
tmpCfgForOldVeleroInstall.UseRestic = !useVolumeSnapshots
|
||||
tmpCfgForOldVeleroInstall.UseNodeAgent = false
|
||||
}
|
||||
//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
|
||||
|
||||
Expect(VeleroInstall(context.Background(), &tmpCfgForOldVeleroInstall, false)).To(Succeed())
|
||||
Expect(CheckVeleroVersion(context.Background(), tmpCfgForOldVeleroInstall.VeleroCLI,
|
||||
|
||||
@@ -85,6 +85,8 @@ type VeleroConfig struct {
|
||||
StandbyClusterOjbectStoreProvider string
|
||||
DebugVeleroPodRestart bool
|
||||
IsUpgradeTest bool
|
||||
WithoutDisableInformerCacheParam bool
|
||||
DisableInformerCache bool
|
||||
}
|
||||
|
||||
type VeleroCfgInPerf struct {
|
||||
|
||||
@@ -50,9 +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
|
||||
RegistryCredentialFile string
|
||||
RestoreHelperImage string
|
||||
VeleroServerDebugMode bool
|
||||
WithoutDisableInformerCacheParam bool
|
||||
}
|
||||
|
||||
func VeleroInstall(ctx context.Context, veleroCfg *VeleroConfig, isStandbyCluster bool) error {
|
||||
@@ -130,6 +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
|
||||
|
||||
err = installVeleroServer(ctx, veleroCfg.VeleroCLI, veleroCfg.CloudProvider, &installOptions{
|
||||
Options: veleroInstallOptions,
|
||||
@@ -245,6 +247,15 @@ func installVeleroServer(ctx context.Context, cli, cloudProvider string, options
|
||||
if len(options.Plugins) > 0 {
|
||||
args = append(args, "--plugins", options.Plugins.String())
|
||||
}
|
||||
|
||||
if !options.WithoutDisableInformerCacheParam {
|
||||
if options.DisableInformerCache {
|
||||
args = append(args, "--disable-informer-cache=true")
|
||||
} else {
|
||||
args = append(args, "--disable-informer-cache=false")
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("Start to install Azure VolumeSnapshotClass ...")
|
||||
if len(options.Features) > 0 {
|
||||
args = append(args, "--features", options.Features)
|
||||
|
||||
Reference in New Issue
Block a user