From 45d7569c6eb30a70291f94491d6689bb45100f83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 01:18:21 +0000 Subject: [PATCH 1/2] CLOUD-727: Bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.4 to 1.20.5. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.4...v1.20.5) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c93d90598..83b000d79 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/onsi/ginkgo/v2 v2.22.2 github.com/onsi/gomega v1.36.2 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/client_golang v1.20.5 github.com/robfig/cron/v3 v3.0.1 go.uber.org/zap v1.27.0 golang.org/x/sync v0.10.0 diff --git a/go.sum b/go.sum index 0dede28ac..ce8d0cd06 100644 --- a/go.sum +++ b/go.sum @@ -152,8 +152,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= From b87b3828d831389a3eec92a2a9a0dd552f5b73d7 Mon Sep 17 00:00:00 2001 From: Natalia Marukovich Date: Thu, 16 Jan 2025 22:08:45 +0100 Subject: [PATCH 2/2] K8SPXC-1466 default container annotation (#1934) * [K8SPXC-1466 default container annotation * fix names * update tests * add version * check if annotations nil --- e2e-tests/functions | 1 + pkg/pxc/statefulset.go | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/e2e-tests/functions b/e2e-tests/functions index ec9549928..b73f6794b 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -478,6 +478,7 @@ compare_kubectl() { del(.. | select(has("percona.com/env-secret-config-hash"))."percona.com/env-secret-config-hash") | del(.. | select(has("percona.com/ssl-hash"))."percona.com/ssl-hash") | del(.. | select(has("percona.com/ssl-internal-hash"))."percona.com/ssl-internal-hash") | + del(.. | select(has("kubectl.kubernetes.io/default-container"))."kubectl.kubernetes.io/default-container") | del(.spec.volumeClaimTemplates[].spec.volumeMode | select(. == "Filesystem")) | del(.. | select(has("healthCheckNodePort")).healthCheckNodePort) | del(.. | select(has("nodePort")).nodePort) | diff --git a/pkg/pxc/statefulset.go b/pkg/pxc/statefulset.go index 260767cf6..4d9bce2a4 100644 --- a/pkg/pxc/statefulset.go +++ b/pkg/pxc/statefulset.go @@ -32,9 +32,8 @@ func StatefulSet(ctx context.Context, cl client.Client, sfs api.StatefulApp, pod TerminationGracePeriodSeconds: podSpec.TerminationGracePeriodSeconds, RuntimeClassName: podSpec.RuntimeClassName, } - if cr.CompareVersionWith("1.5.0") >= 0 { - pod.ServiceAccountName = podSpec.ServiceAccountName - } + + pod.ServiceAccountName = podSpec.ServiceAccountName secrets := secret.Name pod.Affinity = PodAffinity(podSpec.Affinity, sfs) pod.TopologySpreadConstraints = PodTopologySpreadConstraints(podSpec.TopologySpreadConstraints, sfs.Labels()) @@ -120,6 +119,14 @@ func StatefulSet(ctx context.Context, cl client.Client, sfs api.StatefulApp, pod } } + customAnnotations := podSpec.Annotations + if cr.CompareVersionWith("1.17.0") >= 0 { + if customAnnotations == nil { + customAnnotations = make(map[string]string) + } + customAnnotations["kubectl.kubernetes.io/default-container"] = sfs.Labels()[naming.LabelAppKubernetesComponent] + } + obj := sfs.StatefulSet() obj.Spec = appsv1.StatefulSetSpec{ Replicas: &podSpec.Size, @@ -130,7 +137,7 @@ func StatefulSet(ctx context.Context, cl client.Client, sfs api.StatefulApp, pod Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: customLabels, - Annotations: podSpec.Annotations, + Annotations: customAnnotations, }, Spec: pod, },