From c52784d73f7649fa8a165446713e43f883804833 Mon Sep 17 00:00:00 2001 From: paurosello Date: Fri, 1 Sep 2023 08:11:37 +0200 Subject: [PATCH] Rename function (#1644) * Rename function * changelog --- CHANGELOG.md | 1 + service/controller/key/cilium.go | 2 +- service/controller/resource/clusterconfigmap/desired.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f308786..82ed2ce71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Propagate `global.podSecurityStandards.enforced` value set to `true` for PSS migration +- Rename function for better readbility. ## [5.7.1] - 2023-08-03 diff --git a/service/controller/key/cilium.go b/service/controller/key/cilium.go index 97459881a..da68892d5 100644 --- a/service/controller/key/cilium.go +++ b/service/controller/key/cilium.go @@ -11,7 +11,7 @@ func ForceDisableCiliumKubeProxyReplacement(cluster apiv1beta1.Cluster) bool { return found && v == "true" } -func AWSEniModeEnabled(cluster apiv1beta1.Cluster) bool { +func CiliumEniModeEnabled(cluster apiv1beta1.Cluster) bool { mode, found := cluster.Annotations[annotation.CiliumIpamModeAnnotation] if !found { // we default to 'kubernetes' mode diff --git a/service/controller/resource/clusterconfigmap/desired.go b/service/controller/resource/clusterconfigmap/desired.go index 65aa4a7bd..c3102a3ea 100644 --- a/service/controller/resource/clusterconfigmap/desired.go +++ b/service/controller/resource/clusterconfigmap/desired.go @@ -153,7 +153,7 @@ func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) ([]*cor } // We only need this if the cluster is in overlay mode during the upgrade - if key.ForceDisableCiliumKubeProxyReplacement(cr) && !key.AWSEniModeEnabled(cr) { + if key.ForceDisableCiliumKubeProxyReplacement(cr) && !key.CiliumEniModeEnabled(cr) { ciliumValues["kubeProxyReplacement"] = "disabled" } else { ciliumValues["kubeProxyReplacement"] = "strict" @@ -162,7 +162,7 @@ func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) ([]*cor ciliumValues["cleanupKubeProxy"] = true } - if key.IsAWS(r.provider) && key.AWSEniModeEnabled(cr) { + if key.IsAWS(r.provider) && key.CiliumEniModeEnabled(cr) { // Add selector to not interfere with nodes still running in AWS CNI awsCluster := &v1alpha3.AWSCluster{} err := r.ctrlClient.Get(ctx, types.NamespacedName{Name: cr.Name, Namespace: cr.Namespace}, awsCluster)