Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Nov 5, 2024
1 parent a120552 commit f583a9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 11 additions & 0 deletions pkg/handlers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,17 @@ func updateAppConfig(updateApp *apptypes.App, sequence int64, configGroups []kot
updateAppConfigResponse.Error = "failed to get downstream version status"
return updateAppConfigResponse, err
}

if sequence == 0 && status == storetypes.VersionPending {
// we're in the initial config page and the app is now ready to be deployed
if err := version.DeployVersion(updateApp.ID, sequence); err != nil {
updateAppConfigResponse.Error = "failed to deploy"
return updateAppConfigResponse, err
}
updateAppConfigResponse.Success = true
return updateAppConfigResponse, nil
}

if status == storetypes.VersionPendingPreflight {
if err := preflight.Run(updateApp.ID, updateApp.Slug, int64(sequence), updateApp.IsAirgap, skipPreflights, archiveDir); err != nil {
updateAppConfigResponse.Error = errors.Cause(err).Error()
Expand Down
7 changes: 2 additions & 5 deletions pkg/store/kotsstore/version_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/replicatedhq/kots/pkg/k8sutil"
kotsadmconfig "github.com/replicatedhq/kots/pkg/kotsadmconfig"
"github.com/replicatedhq/kots/pkg/kotsutil"
"github.com/replicatedhq/kots/pkg/logger"
"github.com/replicatedhq/kots/pkg/persistence"
rendertypes "github.com/replicatedhq/kots/pkg/render/types"
"github.com/replicatedhq/kots/pkg/secrets"
Expand Down Expand Up @@ -240,11 +241,6 @@ func (s *KOTSStore) GetEmbeddedClusterConfigForVersion(appID string, sequence in

// GetAppVersionArchive will fetch the archive and extract it into the given dstPath directory name
func (s *KOTSStore) GetAppVersionArchive(appID string, sequence int64, dstPath string) error {
// too noisy
// logger.Debug("getting app version archive",
// zap.String("appID", appID),
// zap.Int64("sequence", sequence))

path := fmt.Sprintf("%s/%d.tar.gz", appID, sequence)
bundlePath, err := filestore.GetStore().ReadArchive(path)
if err != nil {
Expand Down Expand Up @@ -762,6 +758,7 @@ func (s *KOTSStore) determineDownstreamVersionStatus(a *apptypes.App, sequence i
return types.VersionUnknown, errors.Wrap(err, "failed to check strict preflights from spec")
}
if hasStrictPreflights {
logger.Warnf("preflights will not be skipped, strict preflights are set to true")
return types.VersionPendingPreflight, nil
}
}
Expand Down

0 comments on commit f583a9c

Please sign in to comment.