From 783b8ba7c8a24871c79405a58c362941aaae2aa3 Mon Sep 17 00:00:00 2001 From: janiskemper <63146658+janiskemper@users.noreply.github.com> Date: Thu, 4 Jul 2024 10:28:12 +0200 Subject: [PATCH] :bug: Add correct K8s version in metadata.yaml (#141) We have overwritten the K8s version of the new cluster stack release by the one in the old release. This commit makes sure that we don't overwrite it. Signed-off-by: janiskemper --- pkg/cmd/create.go | 6 +++--- .../valencia/cluster-addon/metrics-server/overwrite.yaml | 9 ++++----- .../docker/valencia/cluster-class/Chart.yaml | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pkg/cmd/create.go b/pkg/cmd/create.go index e49f983a..3be38632 100644 --- a/pkg/cmd/create.go +++ b/pkg/cmd/create.go @@ -135,9 +135,6 @@ func GetCreateOptions(ctx context.Context, clusterStackPath string) (*CreateOpti return nil, fmt.Errorf("failed to create new github client: %w", err) } - // update the metadata kubernetes version with the csctl.yaml config - createOption.Metadata.Versions.Kubernetes = config.Config.KubernetesVersion - latestRepoRelease, err := github.GetLatestReleaseFromRemoteRepository(ctx, mode, config, gc) if err != nil { return nil, fmt.Errorf("failed to get latest release form remote repository: %w", err) @@ -159,6 +156,9 @@ func GetCreateOptions(ctx context.Context, clusterStackPath string) (*CreateOpti if err != nil { return nil, fmt.Errorf("failed to handle stable mode: %w", err) } + + // update the metadata kubernetes version with the csctl.yaml config + createOption.Metadata.Versions.Kubernetes = config.Config.KubernetesVersion } case customMode: if clusterStackVersion == "" { diff --git a/tests/cluster-stacks/docker/valencia/cluster-addon/metrics-server/overwrite.yaml b/tests/cluster-stacks/docker/valencia/cluster-addon/metrics-server/overwrite.yaml index e0033983..30a4ded9 100644 --- a/tests/cluster-stacks/docker/valencia/cluster-addon/metrics-server/overwrite.yaml +++ b/tests/cluster-stacks/docker/valencia/cluster-addon/metrics-server/overwrite.yaml @@ -1,5 +1,4 @@ -values: | - metrics-server: - commonLabels: - domain: "{{ .Cluster.spec.controlPlaneEndpoint.host }}" - clusterAddonVersion: "v2" +metrics-server: + commonLabels: + domain: "{{ .Cluster.spec.controlPlaneEndpoint.host }}" + clusterAddonVersion: "v2" diff --git a/tests/cluster-stacks/docker/valencia/cluster-class/Chart.yaml b/tests/cluster-stacks/docker/valencia/cluster-class/Chart.yaml index 233c1344..b78304b5 100644 --- a/tests/cluster-stacks/docker/valencia/cluster-class/Chart.yaml +++ b/tests/cluster-stacks/docker/valencia/cluster-class/Chart.yaml @@ -1,11 +1,11 @@ apiVersion: v2 description: | This chart installs and configures: - * Docker Ferrol Cluster Class + * Docker Valencia Cluster Class maintainers: - name: Syself email: info@syself.com url: https://github.com/syself -name: docker-ferrol-1-27-cluster-class +name: docker-valencia-1-27-cluster-class type: application version: << .ClusterAddonVersion >>