Skip to content

Commit

Permalink
placeholderHelmInstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Jul 31, 2023
1 parent a861b1c commit 420927a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 2 additions & 4 deletions cli/internal/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,8 @@ func (i *initCmd) initialize(cmd *cobra.Command, newDialer func(validator atls.V
if err != nil {
return err
}
if i.helmInstaller != nil {
if err := i.helmInstaller.Install(cmd.Context(), provider, masterSecret, idFile, serviceAccURI, releases); err != nil {
return fmt.Errorf("installing Helm charts: %w", err)
}
if err := i.helmInstaller.Install(cmd.Context(), provider, masterSecret, idFile, serviceAccURI, releases); err != nil {
return fmt.Errorf("installing Helm charts: %w", err)
}
cmd.Println(bufferedOutput.String())
return nil
Expand Down
12 changes: 11 additions & 1 deletion cli/internal/cmd/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/edgelesssys/constellation/v2/internal/cloud/gcpshared"
"github.com/edgelesssys/constellation/v2/internal/config"
"github.com/edgelesssys/constellation/v2/internal/constants"
helminstaller "github.com/edgelesssys/constellation/v2/internal/deploy/helm"
"github.com/edgelesssys/constellation/v2/internal/file"
"github.com/edgelesssys/constellation/v2/internal/grpc/atlscredentials"
"github.com/edgelesssys/constellation/v2/internal/grpc/dialer"
Expand Down Expand Up @@ -174,7 +175,7 @@ func TestInitialize(t *testing.T) {
ctx, cancel := context.WithTimeout(ctx, 4*time.Second)
defer cancel()
cmd.SetContext(ctx)
i := &initCmd{log: logger.NewTest(t), spinner: &nopSpinner{}}
i := &initCmd{log: logger.NewTest(t), spinner: &nopSpinner{}, helmInstaller: &placeholderHelmInstaller{}}
err := i.initialize(cmd, newDialer, fileHandler, &stubLicenseClient{}, stubAttestationFetcher{})

if tc.wantErr {
Expand Down Expand Up @@ -666,3 +667,12 @@ func (c stubInitClient) Recv() (*initproto.InitResponse, error) {

return res, err
}

type placeholderHelmInstaller struct{}

func (i *placeholderHelmInstaller) Install(_ context.Context, _ cloudprovider.Provider, _ uri.MasterSecret,
_ clusterid.File,
_ string, _ *helminstaller.Releases,
) error {
return nil
}
1 change: 0 additions & 1 deletion internal/deploy/helm/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func NewInstaller(kubeconfig string, logger debugLog) (*Installer, error) {
}

// InstallChart is the generic install function for helm charts.
// When timeout is nil, the default timeout is used.
func (h *Installer) InstallChart(ctx context.Context, release Release) error {
return h.InstallChartWithValues(ctx, release, nil)
}
Expand Down

0 comments on commit 420927a

Please sign in to comment.