From caa1a5fdb8ee1b66c3d3b28571c2ef7847f4de7e Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Wed, 6 Nov 2024 10:17:47 +0100 Subject: [PATCH] fix(clustertool): use different yaml lib --- clustertool/go.mod | 4 ++-- clustertool/pkg/fluxhandler/helmrelease.go | 2 +- clustertool/pkg/fluxhandler/helmrepo.go | 2 +- clustertool/pkg/fluxhandler/sshsecretgen.go | 2 +- clustertool/pkg/helper/talhelperextract.go | 2 +- clustertool/pkg/helper/yamlutil.go | 2 +- clustertool/pkg/initfiles/initfiles.go | 2 +- clustertool/pkg/kubectlcmds/apply.go | 2 +- clustertool/pkg/scale/scale2flux.go | 2 +- clustertool/pkg/sops/checkencrypt.go | 2 +- clustertool/pkg/sops/loadsops.go | 2 +- clustertool/pkg/talhelperutil/extractfromtalconfig.go | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/clustertool/go.mod b/clustertool/go.mod index d51e93626dd8d..599781441d56e 100644 --- a/clustertool/go.mod +++ b/clustertool/go.mod @@ -20,6 +20,7 @@ require ( github.com/siderolabs/talos/pkg/machinery v1.9.0-alpha.0 github.com/spf13/cobra v1.8.1 golang.org/x/crypto v0.28.0 + gopkg.in/yaml.v3 v3.0.1 helm.sh/helm/v3 v3.16.2 k8s.io/api v0.31.2 k8s.io/apimachinery v0.31.2 @@ -27,7 +28,6 @@ require ( sigs.k8s.io/controller-runtime v0.19.1 sigs.k8s.io/kustomize/api v0.18.0 sigs.k8s.io/kustomize/kyaml v0.18.1 - sigs.k8s.io/yaml v1.4.0 ) replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16 @@ -274,7 +274,6 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.31.1 // indirect k8s.io/apiserver v0.31.1 // indirect k8s.io/cli-runtime v0.31.1 // indirect @@ -286,4 +285,5 @@ require ( oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/clustertool/pkg/fluxhandler/helmrelease.go b/clustertool/pkg/fluxhandler/helmrelease.go index b801461c60171..d69b3c9fdeb25 100644 --- a/clustertool/pkg/fluxhandler/helmrelease.go +++ b/clustertool/pkg/fluxhandler/helmrelease.go @@ -9,7 +9,7 @@ import ( "sync" "github.com/rs/zerolog/log" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) type HelmChart struct { diff --git a/clustertool/pkg/fluxhandler/helmrepo.go b/clustertool/pkg/fluxhandler/helmrepo.go index 0429b5f1afd37..94f2dc4a71318 100644 --- a/clustertool/pkg/fluxhandler/helmrepo.go +++ b/clustertool/pkg/fluxhandler/helmrepo.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/rs/zerolog/log" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) type HelmRepoMetadata struct { diff --git a/clustertool/pkg/fluxhandler/sshsecretgen.go b/clustertool/pkg/fluxhandler/sshsecretgen.go index b62104b6fb409..4cc61ee81b0ca 100644 --- a/clustertool/pkg/fluxhandler/sshsecretgen.go +++ b/clustertool/pkg/fluxhandler/sshsecretgen.go @@ -16,8 +16,8 @@ import ( "github.com/truecharts/public/clustertool/pkg/helper" "golang.org/x/crypto/ssh" + "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/yaml" ) // Define a struct to map the YAML content diff --git a/clustertool/pkg/helper/talhelperextract.go b/clustertool/pkg/helper/talhelperextract.go index a8503be149c67..8b202f94e0143 100644 --- a/clustertool/pkg/helper/talhelperextract.go +++ b/clustertool/pkg/helper/talhelperextract.go @@ -4,7 +4,7 @@ import ( "path" "strings" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) // Node represents a node structure in the YAML file. diff --git a/clustertool/pkg/helper/yamlutil.go b/clustertool/pkg/helper/yamlutil.go index 97fbc3e083048..54d5803dcac02 100644 --- a/clustertool/pkg/helper/yamlutil.go +++ b/clustertool/pkg/helper/yamlutil.go @@ -4,7 +4,7 @@ import ( "bytes" "io" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) // Encoder is a custom encoder for YAML that writes to an io.Writer. diff --git a/clustertool/pkg/initfiles/initfiles.go b/clustertool/pkg/initfiles/initfiles.go index 937fbcb30a4c2..3a844cf15f223 100644 --- a/clustertool/pkg/initfiles/initfiles.go +++ b/clustertool/pkg/initfiles/initfiles.go @@ -13,7 +13,7 @@ import ( "time" "github.com/rs/zerolog/log" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" age "filippo.io/age" "github.com/truecharts/public/clustertool/pkg/fluxhandler" diff --git a/clustertool/pkg/kubectlcmds/apply.go b/clustertool/pkg/kubectlcmds/apply.go index ac0f16964403a..5c9c032810ba9 100644 --- a/clustertool/pkg/kubectlcmds/apply.go +++ b/clustertool/pkg/kubectlcmds/apply.go @@ -9,6 +9,7 @@ import ( "path/filepath" "github.com/rs/zerolog/log" + "gopkg.in/yaml.v3" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/homedir" @@ -16,7 +17,6 @@ import ( "sigs.k8s.io/kustomize/api/krusty" "sigs.k8s.io/kustomize/kyaml/filesys" "sigs.k8s.io/kustomize/kyaml/kio" - "sigs.k8s.io/yaml" ) // getKubeClient initializes and returns a controller-runtime client.Client diff --git a/clustertool/pkg/scale/scale2flux.go b/clustertool/pkg/scale/scale2flux.go index 8d0b6c8162e70..abcde4aee2879 100644 --- a/clustertool/pkg/scale/scale2flux.go +++ b/clustertool/pkg/scale/scale2flux.go @@ -12,7 +12,7 @@ import ( "github.com/rs/zerolog/log" "github.com/truecharts/public/clustertool/pkg/fluxhandler" "github.com/truecharts/public/clustertool/pkg/helper" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) type RadarrConfig struct { diff --git a/clustertool/pkg/sops/checkencrypt.go b/clustertool/pkg/sops/checkencrypt.go index 1092f2499208a..5aaf5d06df6ef 100644 --- a/clustertool/pkg/sops/checkencrypt.go +++ b/clustertool/pkg/sops/checkencrypt.go @@ -9,7 +9,7 @@ import ( "github.com/rs/zerolog/log" "github.com/truecharts/public/clustertool/pkg/helper" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) // EncrFileData holds information about a file and its encryption status. diff --git a/clustertool/pkg/sops/loadsops.go b/clustertool/pkg/sops/loadsops.go index 8bba70fa752d3..77a7565b329aa 100644 --- a/clustertool/pkg/sops/loadsops.go +++ b/clustertool/pkg/sops/loadsops.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "github.com/rs/zerolog/log" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) type SopsConfig struct { diff --git a/clustertool/pkg/talhelperutil/extractfromtalconfig.go b/clustertool/pkg/talhelperutil/extractfromtalconfig.go index 9e64df76618ca..ab9d547f430f2 100644 --- a/clustertool/pkg/talhelperutil/extractfromtalconfig.go +++ b/clustertool/pkg/talhelperutil/extractfromtalconfig.go @@ -6,7 +6,7 @@ import ( "github.com/rs/zerolog/log" "github.com/truecharts/public/clustertool/pkg/helper" - "sigs.k8s.io/yaml" + "gopkg.in/yaml.v3" ) // Node represents the structure of each node in the YAML file