Skip to content

Commit

Permalink
Init Helm capabilities in upgrade service (#4783)
Browse files Browse the repository at this point in the history
* Init Helm capabilities in upgrade service

* init in bootstrap
  • Loading branch information
sgalsaleh authored Jul 26, 2024
1 parent 3829fb0 commit 3e5b5e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions pkg/upgradeservice/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ import (

"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/archives"
"github.com/replicatedhq/kots/pkg/k8sutil"
identity "github.com/replicatedhq/kots/pkg/kotsadmidentity"
"github.com/replicatedhq/kots/pkg/kotsutil"
"github.com/replicatedhq/kots/pkg/logger"
"github.com/replicatedhq/kots/pkg/pull"
registrytypes "github.com/replicatedhq/kots/pkg/registry/types"
upgradepreflight "github.com/replicatedhq/kots/pkg/upgradeservice/preflight"
"github.com/replicatedhq/kots/pkg/upgradeservice/task"
"github.com/replicatedhq/kots/pkg/upgradeservice/types"
"github.com/replicatedhq/kots/pkg/util"
)

func bootstrap(params types.UpgradeServiceParams) (finalError error) {
if err := k8sutil.InitHelmCapabilities(); err != nil {
return errors.Wrap(err, "failed to init helm capabilities")
}
if err := upgradepreflight.Init(); err != nil {
return errors.Wrap(err, "failed to init preflight")
}
if params.AppIsAirgap {
if err := pullArchiveFromAirgap(params); err != nil {
return errors.Wrap(err, "failed to pull archive from airgap")
Expand Down
4 changes: 0 additions & 4 deletions pkg/upgradeservice/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func Serve(params types.UpgradeServiceParams) error {
return errors.Wrap(err, "failed to bootstrap")
}

if err := upgradepreflight.Init(); err != nil {
return errors.Wrap(err, "failed to init preflight")
}

r := mux.NewRouter()
r.Use(handlers.ParamsMiddleware(params))

Expand Down

0 comments on commit 3e5b5e5

Please sign in to comment.