From 1e5743a16c7621607138d63b9cf2a3e3009de638 Mon Sep 17 00:00:00 2001 From: Gianluca Mardente Date: Tue, 9 Jun 2026 08:46:32 +0200 Subject: [PATCH] (chore) prepare for release v1.11.0 --- .github/workflows/main.yaml | 4 +-- api/v1beta1/common_types.go | 2 +- .../lib.projectsveltos.io_classifiers.yaml | 2 +- ...projectsveltos.io_clusterhealthchecks.yaml | 2 +- .../lib.projectsveltos.io_rolerequests.yaml | 2 +- go.mod | 16 ++++----- go.sum | 36 +++++++++---------- hack/tools/go.mod | 21 +++++------ lib/crd/classifiers.go | 2 +- lib/crd/clusterhealthchecks.go | 2 +- lib/crd/rolerequests.go | 2 +- lib/deployer/applier.go | 11 +++--- lib/deployer/utils.go | 5 +-- lib/pullmode/apis.go | 2 ++ ...ion_classifiers.lib.projectsveltos.io.yaml | 2 +- ...terhealthchecks.lib.projectsveltos.io.yaml | 2 +- ...on_rolerequests.lib.projectsveltos.io.yaml | 2 +- 17 files changed, 57 insertions(+), 58 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e422618..4a31b50 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Set up Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Set up Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index eb80e4a..3689112 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -116,7 +116,7 @@ type ClusterInfo struct { // Cluster references the Cluster Cluster corev1.ObjectReference `json:"cluster"` - // Hash represents the hash of the Classifier currently deployed + // Hash represents the hash of the resource currently deployed // in the Cluster Hash []byte `json:"hash"` diff --git a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml index 76dff5e..76e2a43 100644 --- a/config/crd/bases/lib.projectsveltos.io_classifiers.yaml +++ b/config/crd/bases/lib.projectsveltos.io_classifiers.yaml @@ -309,7 +309,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml b/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml index d062854..a217c2c 100644 --- a/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml +++ b/config/crd/bases/lib.projectsveltos.io_clusterhealthchecks.yaml @@ -286,7 +286,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml b/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml index 02d2276..d9553fb 100644 --- a/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml +++ b/config/crd/bases/lib.projectsveltos.io_rolerequests.yaml @@ -195,7 +195,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/go.mod b/go.mod index 338872d..7a7adb3 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/projectsveltos/lua-utils/glua-sprig v0.0.0-20251212200258-2b3cdcb7c0f5 github.com/projectsveltos/lua-utils/glua-strings v0.0.0-20251212200258-2b3cdcb7c0f5 github.com/yuin/gopher-lua v1.1.2 - golang.org/x/text v0.37.0 + golang.org/x/text v0.38.0 k8s.io/api v0.36.1 k8s.io/apiextensions-apiserver v0.36.1 k8s.io/apimachinery v0.36.1 @@ -80,16 +80,16 @@ require ( go.opentelemetry.io/otel/trace v1.43.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.50.0 // indirect + golang.org/x/crypto v0.51.0 // indirect golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.53.0 // indirect + golang.org/x/mod v0.36.0 // indirect + golang.org/x/net v0.54.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.43.0 // indirect - golang.org/x/term v0.42.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/term v0.43.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/tools v0.45.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect diff --git a/go.sum b/go.sum index d13befe..aef9bd3 100644 --- a/go.sum +++ b/go.sum @@ -111,12 +111,8 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.28.3 h1:4JvMdwtFU0imd8fHx25OJXoDMRexnf8v5NHKYSTTji4= -github.com/onsi/ginkgo/v2 v2.28.3/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/ginkgo/v2 v2.29.0 h1:rfh+ZFjgJhYWRoIqVf3Uwx/W20yLrcrE2h2GmYVRaag= github.com/onsi/ginkgo/v2 v2.29.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= -github.com/onsi/gomega v1.40.0 h1:Vtol0e1MghCD2ZVIilPDIg44XSL9l2QAn8ZNaljWcJc= -github.com/onsi/gomega v1.40.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/onsi/gomega v1.41.0 h1:OwKp4pXNgVxf6sCplzYo794OFNuoL2q2SBMU5NSWOjA= github.com/onsi/gomega v1.41.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -190,28 +186,28 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= -golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 h1:fQsdNF2N+/YewlRZiricy4P1iimyPKZ/xwniHj8Q2a0= golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93/go.mod h1:EPRbTFwzwjXj9NpYyyrvenVh9Y+GFeEvMNh7Xuz7xgU= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= -golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= -golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= +golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= -golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= -golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= +golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0= gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 h1:VPWxll4HlMw1Vs/qXtN7BvhZqsS9cdAittCNvVENElA= diff --git a/hack/tools/go.mod b/hack/tools/go.mod index a9b6a39..66695cf 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -12,6 +12,15 @@ require ( ) require ( + cloud.google.com/go/compute/metadata v0.3.0 // indirect + github.com/Masterminds/semver/v3 v3.4.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/fatih/color v1.19.0 // indirect + github.com/fxamacker/cbor/v2 v2.9.1 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-openapi/jsonpointer v0.23.1 // indirect + github.com/go-openapi/jsonreference v0.21.5 // indirect + github.com/go-openapi/swag v0.26.0 // indirect github.com/go-openapi/swag/cmdutils v0.26.0 // indirect github.com/go-openapi/swag/conv v0.26.0 // indirect github.com/go-openapi/swag/fileutils v0.26.0 // indirect @@ -23,18 +32,6 @@ require ( github.com/go-openapi/swag/stringutils v0.26.0 // indirect github.com/go-openapi/swag/typeutils v0.26.0 // indirect github.com/go-openapi/swag/yamlutils v0.26.0 // indirect -) - -require ( - cloud.google.com/go/compute/metadata v0.3.0 // indirect - github.com/Masterminds/semver/v3 v3.4.0 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/fatih/color v1.19.0 // indirect - github.com/fxamacker/cbor/v2 v2.9.1 // indirect - github.com/go-logr/logr v1.4.3 // indirect - github.com/go-openapi/jsonpointer v0.23.1 // indirect - github.com/go-openapi/jsonreference v0.21.5 // indirect - github.com/go-openapi/swag v0.26.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gobuffalo/flect v1.0.3 // indirect github.com/google/gnostic-models v0.7.1 // indirect diff --git a/lib/crd/classifiers.go b/lib/crd/classifiers.go index 4bd3d1b..223c235 100644 --- a/lib/crd/classifiers.go +++ b/lib/crd/classifiers.go @@ -327,7 +327,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/lib/crd/clusterhealthchecks.go b/lib/crd/clusterhealthchecks.go index be5023e..38ed934 100644 --- a/lib/crd/clusterhealthchecks.go +++ b/lib/crd/clusterhealthchecks.go @@ -304,7 +304,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/lib/crd/rolerequests.go b/lib/crd/rolerequests.go index 0047a24..6147448 100644 --- a/lib/crd/rolerequests.go +++ b/lib/crd/rolerequests.go @@ -213,7 +213,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/lib/deployer/applier.go b/lib/deployer/applier.go index bb00d71..77cd0ea 100644 --- a/lib/deployer/applier.go +++ b/lib/deployer/applier.go @@ -174,13 +174,16 @@ func GetUnstructured(section []byte, logger logr.Logger) ([]*unstructured.Unstru return policies, nil } +var ( + reCommentLine = regexp.MustCompile(`(?m)^\s*#([^#].*?)$`) + reEmptyLine = regexp.MustCompile(`(?m)^\s*$`) +) + // removeCommentsAndEmptyLines removes any line containing just YAML comments // and any empty lines func removeCommentsAndEmptyLines(text string) string { - commentLine := regexp.MustCompile(`(?m)^\s*#([^#].*?)$`) - result := commentLine.ReplaceAllString(text, "") - emptyLine := regexp.MustCompile(`(?m)^\s*$`) - result = emptyLine.ReplaceAllString(result, "") + result := reCommentLine.ReplaceAllString(text, "") + result = reEmptyLine.ReplaceAllString(result, "") return result } diff --git a/lib/deployer/utils.go b/lib/deployer/utils.go index 3c32bfa..23f3339 100644 --- a/lib/deployer/utils.go +++ b/lib/deployer/utils.go @@ -228,6 +228,9 @@ func ValidateObjectForUpdate(ctx context.Context, dr dynamic.ResourceInterface, // getReferenceInfo extracts the kind, namespace, and name from object annotations // and falls back to labels if the annotations are missing or the annotation map is nil. func getReferenceInfo(object *unstructured.Unstructured) (kind, namespace, name string, tier int32) { + const defaultTier = 100 + tier = int32(defaultTier) + // 1. Attempt to get info from Annotations annotations := object.GetAnnotations() if annotations != nil { @@ -235,8 +238,6 @@ func getReferenceInfo(object *unstructured.Unstructured) (kind, namespace, name namespace = annotations[ReferenceNamespaceAnnotation] name = annotations[ReferenceNameAnnotation] - const defaultTier = 100 - tier := int32(defaultTier) tierStr, tierOk := annotations[ReferenceTierAnnotation] if tierOk { tier64, err := strconv.ParseInt(tierStr, 10, 32) diff --git a/lib/pullmode/apis.go b/lib/pullmode/apis.go index 355aab0..8594d2e 100644 --- a/lib/pullmode/apis.go +++ b/lib/pullmode/apis.go @@ -307,6 +307,8 @@ func CommitStagedResourcesForDeployment(ctx context.Context, c client.Client, return err } + manager.clearBundles(clusterNamespace, clusterName, requestorName, requestorFeature) + // If ConfigurationGroup is updated, we might have stale configurationBundles. Contininuing // on the ClusterSummary example, previously ClusterSummary was referencing ConfigMap1 now it // references ConfigMap2. So find and delete all stale ConfigurationBundles. diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml index bd70b28..7023b15 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_classifiers.lib.projectsveltos.io.yaml @@ -308,7 +308,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml index 6b036c2..9e16aab 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_clusterhealthchecks.lib.projectsveltos.io.yaml @@ -285,7 +285,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string diff --git a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml index 894a328..e0b9ad0 100644 --- a/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml +++ b/manifests/apiextensions.k8s.io_v1_customresourcedefinition_rolerequests.lib.projectsveltos.io.yaml @@ -194,7 +194,7 @@ spec: type: string hash: description: |- - Hash represents the hash of the Classifier currently deployed + Hash represents the hash of the resource currently deployed in the Cluster format: byte type: string