From 3e5b5e543f405e6ff5d900ad441f6dc8a6e303de Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Fri, 26 Jul 2024 11:24:18 -0700 Subject: [PATCH] Init Helm capabilities in upgrade service (#4783) * Init Helm capabilities in upgrade service * init in bootstrap --- pkg/upgradeservice/bootstrap.go | 8 ++++++++ pkg/upgradeservice/server.go | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/upgradeservice/bootstrap.go b/pkg/upgradeservice/bootstrap.go index 7109de06f6..954f520831 100644 --- a/pkg/upgradeservice/bootstrap.go +++ b/pkg/upgradeservice/bootstrap.go @@ -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") diff --git a/pkg/upgradeservice/server.go b/pkg/upgradeservice/server.go index 08899e6627..914249c4ab 100644 --- a/pkg/upgradeservice/server.go +++ b/pkg/upgradeservice/server.go @@ -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))