From 0ce0710cd2f2d70ad78098e7d1ca3dae0463eaac Mon Sep 17 00:00:00 2001 From: "Nathan S. Martins" Date: Thu, 23 Nov 2023 19:25:21 -0300 Subject: [PATCH] adding needs-hash annotation --- go.mod | 2 +- go.sum | 4 ++-- pkg/function.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3157505..247f4e1 100644 --- a/go.mod +++ b/go.mod @@ -101,5 +101,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect ) diff --git a/go.sum b/go.sum index 02d3e87..be90bbb 100644 --- a/go.sum +++ b/go.sum @@ -404,8 +404,8 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= +k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/kyaml v0.15.0 h1:ynlLMAxDhrY9otSg5GYE2TcIz31XkGZ2Pkj7SdolD84= diff --git a/pkg/function.go b/pkg/function.go index ce227b9..9c32f24 100644 --- a/pkg/function.go +++ b/pkg/function.go @@ -69,6 +69,7 @@ func Ksops(items []*yaml.RNode) ([]*yaml.RNode, error) { var node *yaml.RNode node, err = yaml.Parse(string(secret)) + _ = node.SetAnnotations(map[string]string{"kustomize.config.k8s.io/needs-hash": "true"}) if err != nil { return nil, fmt.Errorf("failed parse secret into yaml file %s: %w\n", file, err) }