From f43be932004524d1b776e3add47c4121a2343003 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:16:14 +0200 Subject: [PATCH] wip Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com> --- cli/internal/cmd/init_test.go | 4 ++-- cli/internal/helm/helm_test.go | 11 ----------- cli/internal/state/BUILD.bazel | 2 ++ cli/internal/state/state.go | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cli/internal/cmd/init_test.go b/cli/internal/cmd/init_test.go index c7dc3c324a..2d53e423c1 100644 --- a/cli/internal/cmd/init_test.go +++ b/cli/internal/cmd/init_test.go @@ -801,7 +801,7 @@ type stubShowInfrastructure struct { showInfraErr error } -func (s *stubShowInfrastructure) ShowInfrastructure(_ context.Context, csp cloudprovider.Provider) (state.Infrastructure, error) { +func (s *stubShowInfrastructure) ShowInfrastructure(context.Context, cloudprovider.Provider) (state.Infrastructure, error) { return state.Infrastructure{}, s.showInfraErr } @@ -809,6 +809,6 @@ type stubAttestationApplier struct { applyErr error } -func (a *stubAttestationApplier) ApplyJoinConfig(_ context.Context, _ config.AttestationCfg, _ []byte) error { +func (a *stubAttestationApplier) ApplyJoinConfig(context.Context, config.AttestationCfg, []byte) error { return a.applyErr } diff --git a/cli/internal/helm/helm_test.go b/cli/internal/helm/helm_test.go index e7acdff86a..9b3f836151 100644 --- a/cli/internal/helm/helm_test.go +++ b/cli/internal/helm/helm_test.go @@ -226,17 +226,6 @@ func TestHelmApply(t *testing.T) { } } -func fakeInfraOutput(csp cloudprovider.Provider) state.Infrastructure { - switch csp { - case cloudprovider.AWS: - return state.Infrastructure{} - case cloudprovider.GCP: - return state.Infrastructure{GCP: &state.GCP{}} - default: - panic("invalid csp") - } -} - func getActionReleaseNames(actions []applyAction) []string { releaseActionNames := []string{} for _, action := range actions { diff --git a/cli/internal/state/BUILD.bazel b/cli/internal/state/BUILD.bazel index 1d8c7d634c..83960d3b61 100644 --- a/cli/internal/state/BUILD.bazel +++ b/cli/internal/state/BUILD.bazel @@ -7,6 +7,7 @@ go_library( importpath = "github.com/edgelesssys/constellation/v2/cli/internal/state", visibility = ["//cli:__subpackages__"], deps = [ + "//cli/internal/clusterid", "//internal/config", "//internal/file", "@cat_dario_mergo//:mergo", @@ -18,6 +19,7 @@ go_test( srcs = ["state_test.go"], embed = [":state"], deps = [ + "//cli/internal/clusterid", "//internal/constants", "//internal/file", "@com_github_spf13_afero//:afero", diff --git a/cli/internal/state/state.go b/cli/internal/state/state.go index 47f5e85dd5..f0fc3aca1f 100644 --- a/cli/internal/state/state.go +++ b/cli/internal/state/state.go @@ -114,7 +114,7 @@ func (s *State) Merge(other *State) (*State, error) { return s, nil } -// GetClusterName returns the name of the cluster. +// ClusterName returns the name of the cluster. func (s *State) ClusterName(cfg *config.Config) string { return cfg.Name + "-" + s.Infrastructure.UID }