From 7b77d459f3b96257554e1b791f73ed92b30c96b4 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Thu, 24 Oct 2024 09:38:00 +0200 Subject: [PATCH] fix(clustertool): fix scale2flux missing 2 keys --- clustertool/pkg/fluxhandler/helmrelease.go | 6 ++++-- clustertool/pkg/scale/scale2flux.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/clustertool/pkg/fluxhandler/helmrelease.go b/clustertool/pkg/fluxhandler/helmrelease.go index 0cbf62af1ae..d69b3c9fdeb 100644 --- a/clustertool/pkg/fluxhandler/helmrelease.go +++ b/clustertool/pkg/fluxhandler/helmrelease.go @@ -47,8 +47,10 @@ type Metadata struct { } type HelmRelease struct { - Metadata Metadata `yaml:"metadata,omitempty"` - Spec Spec `yaml:"spec,omitempty"` + APIVersion string `yaml:"apiVersion"` + Kind string `yaml:"kind"` + Metadata Metadata `yaml:"metadata,omitempty"` + Spec Spec `yaml:"spec,omitempty"` } func LoadHelmRelease(filename string) (*HelmRelease, error) { diff --git a/clustertool/pkg/scale/scale2flux.go b/clustertool/pkg/scale/scale2flux.go index 8462a9105aa..abcde4aee28 100644 --- a/clustertool/pkg/scale/scale2flux.go +++ b/clustertool/pkg/scale/scale2flux.go @@ -308,6 +308,8 @@ func GenerateHelmValuesFromJSON(inputFile string, outputFile string) error { // Populate HelmRelease structure helmRelease := fluxhandler.HelmRelease{ + APIVersion: "helm.toolkit.fluxcd.io/v2", // default value + Kind: "HelmRelease", // default value Metadata: fluxhandler.Metadata{ Name: radarrConfig.Name, Namespace: radarrConfig.Namespace,