Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow embedded cluster installs to complete if config values are passed in #4971

Merged
10 changes: 8 additions & 2 deletions pkg/airgap/airgap.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,14 @@ func CreateAppFromAirgap(opts CreateAirgapAppOpts) (finalError error) {
}

if status == storetypes.VersionPendingClusterManagement {
// if pending cluster management, we don't want to deploy the app
return nil
if configFile != "" {
// if there is a config file, then we should proceed with the installation normally, not wait for the user
// to click through the UI to add nodes and configure the app
status = storetypes.VersionPendingConfig
} else {
// if pending cluster management, we don't want to deploy the app
return nil
}
}

hasStrictPreflights, err := store.GetStore().HasStrictPreflights(a.ID, newSequence)
Expand Down
2 changes: 2 additions & 0 deletions pkg/kotsadmconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func IsUnsetItem(item kotsv1beta1.ConfigItem) bool {
return true
}

// NeedsConfiguration returns true if the app has required config values that are not set
func NeedsConfiguration(appSlug string, sequence int64, isAirgap bool, kotsKinds *kotsutil.KotsKinds, registrySettings registrytypes.RegistrySettings) (bool, error) {
log := logger.NewCLILogger(os.Stdout)

Expand Down Expand Up @@ -166,6 +167,7 @@ func UpdateAppConfigValues(values map[string]kotsv1beta1.ConfigValue, configGrou
return values
}

// this is where config values that are passed to the install command are read from
func ReadConfigValuesFromInClusterSecret() (string, error) {
log := logger.NewCLILogger(os.Stdout)

Expand Down
10 changes: 8 additions & 2 deletions pkg/online/online.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,14 @@ func CreateAppFromOnline(opts CreateOnlineAppOpts) (_ *kotsutil.KotsKinds, final
}

if status == storetypes.VersionPendingClusterManagement {
// if pending cluster management, we don't want to deploy the app
return kotsKinds, nil
if configFile != "" {
// if there is a config file, then we should proceed with the installation normally, not wait for the user
// to click through the UI to add nodes and configure the app
status = storetypes.VersionPendingConfig
} else {
// if pending cluster management, we don't want to deploy the app
return kotsKinds, nil
}
}

hasStrictPreflights, err := store.GetStore().HasStrictPreflights(opts.PendingApp.ID, newSequence)
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func HomeDir() string {
}

func IsEmbeddedCluster() bool {
return os.Getenv("EMBEDDED_CLUSTER_ID") != ""
return EmbeddedClusterID() != ""
}

func EmbeddedClusterID() string {
Expand Down
Loading