From 70cad9d952b1515021516c7e33a73b76d9d05dcb Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Mon, 23 Oct 2023 14:38:02 -0400 Subject: [PATCH] default to amd64 only --- manageiq-operator/api/v1alpha1/miqutils/node_affinity.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manageiq-operator/api/v1alpha1/miqutils/node_affinity.go b/manageiq-operator/api/v1alpha1/miqutils/node_affinity.go index e5455315b..4b955a8ab 100644 --- a/manageiq-operator/api/v1alpha1/miqutils/node_affinity.go +++ b/manageiq-operator/api/v1alpha1/miqutils/node_affinity.go @@ -10,23 +10,24 @@ import ( func OperatorNodeAffinityArchValues(deployment *appsv1.Deployment, client client.Client) []string { podName := os.Getenv("POD_NAME") pod := FindPodByName(client, deployment.ObjectMeta.Namespace, podName) + values := []string{"amd64"} if pod.Spec.Affinity == nil { // In case we don't find the operator pod (local testing) or it doesn't have affinities - return []string{} + return values } + nodeSelectorTerms := pod.Spec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution.NodeSelectorTerms for _, selector := range nodeSelectorTerms { for _, matchExpression := range selector.MatchExpressions { if matchExpression.Key == "kubernetes.io/arch" { - return matchExpression.Values + values = matchExpression.Values } } } - // We should never get here, but the compiler requires it - return []string{} + return values } func SetDeploymentNodeAffinity(deployment *appsv1.Deployment, client client.Client) {