Skip to content

Commit

Permalink
Check correct local mode feature flag when starting data manager pod. (
Browse files Browse the repository at this point in the history
…#227)

This is a cherry-pick from the master branch #225

On the vanilla cluster, the data manager install code checks for the feature
flag to determine if data manager pods need to be initialized. We were checking
for the wrong flag (local-mode) instead of the new EnableLocalMode flag. This
change fixes the issue.

Testing: Manual test with local mode on vanilla setup.

Signed-off-by: Swati Gupta <[email protected]>
  • Loading branch information
swgupta-vmw authored Nov 9, 2020
1 parent 1eb3786 commit c5b5406
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/datamgr/cli/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ func (o *InstallOptions) Run(c *cobra.Command, f client.Factory) error {
fmt.Printf("Failed to decipher velero feature flags: %v, assuming none.\n", err)
}
features.Enable(featureFlags...)
if features.IsEnabled(constants.VSphereLocalModeFlag) {
fmt.Printf("Detected %s feature flag, setting local mode \n", constants.VSphereLocalModeFlag)
if features.IsEnabled(constants.VSphereLocalModeFeature) {
fmt.Printf("Detected %s feature flag, setting local mode \n", constants.VSphereLocalModeFeature)
skipDataMgr = true
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func CreateFeatureStateConfigMap(features []string, f client.Factory, veleroNs s
featureData[constants.VSphereLocalModeFlag] = strconv.FormatBool(false)
// Update the falgs based on velero feature flags.
featuresString := strings.Join(features[:], ",")
if strings.Contains(featuresString, "EnableLocalMode") {
if strings.Contains(featuresString, constants.VSphereLocalModeFeature) {
featureData[constants.VSphereLocalModeFlag] = strconv.FormatBool(true)
}
featureConfigMap.Data = featureData
Expand Down
1 change: 1 addition & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const (
// feature flog constants
const (
VSphereLocalModeFlag = "local-mode"
VSphereLocalModeFeature = "EnableLocalMode"
)

const (
Expand Down

0 comments on commit c5b5406

Please sign in to comment.