Skip to content

Commit

Permalink
Allow embedded cluster installs to complete if config values are pass…
Browse files Browse the repository at this point in the history
…ed in (#4971)

* automatically deploy embedded cluster apps with provided config values

* expand comment

* undo logic changes

* add admin-console confirm-management command

* actually include the command

* f

* return to 'deploy the app if --config-values are set in embedded cluster'
  • Loading branch information
laverya authored Nov 4, 2024
1 parent 6bb64d1 commit eab4439
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
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

0 comments on commit eab4439

Please sign in to comment.