From 7b27959996cdbbe17eec93cef067bf101cf6f786 Mon Sep 17 00:00:00 2001 From: Himanshu Sharma <79965161+himanshu-kun@users.noreply.github.com> Date: Wed, 5 Apr 2023 09:38:27 +0530 Subject: [PATCH] Cherry pick PR #196 on 1.26 (#203) * printed warning if priority configmap missing * LEADER_ELECT env variable defaulted in makefile --- cluster-autoscaler/Makefile | 1 + cluster-autoscaler/expander/priority/priority.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cluster-autoscaler/Makefile b/cluster-autoscaler/Makefile index da172e64c3c7..cf9a211745d6 100644 --- a/cluster-autoscaler/Makefile +++ b/cluster-autoscaler/Makefile @@ -9,6 +9,7 @@ GOOS?=linux GOARCH?=$(shell go env GOARCH) REGISTRY?=staging-k8s.gcr.io DOCKER_NETWORK?=default +LEADER_ELECT?=false ifdef BUILD_TAGS TAGS_FLAG=--tags ${BUILD_TAGS} PROVIDER=-${BUILD_TAGS} diff --git a/cluster-autoscaler/expander/priority/priority.go b/cluster-autoscaler/expander/priority/priority.go index dab38c986a98..25a32fff9c5b 100644 --- a/cluster-autoscaler/expander/priority/priority.go +++ b/cluster-autoscaler/expander/priority/priority.go @@ -61,7 +61,10 @@ func NewFilter(configMapLister v1lister.ConfigMapNamespaceLister, func (p *priority) reloadConfigMap() (priorities, *apiv1.ConfigMap, error) { cm, err := p.configMapLister.Get(PriorityConfigMapName) if err != nil { - return nil, nil, fmt.Errorf("Priority expander config map %s not found: %v", PriorityConfigMapName, err) + // FORK-CHANGE: logged warning to simplify debugging. + msg := fmt.Sprintf("Priority expander config map %q not found: %v", PriorityConfigMapName, err) + klog.Warning(msg) + return nil, nil, errors.New(msg) } prioString, found := cm.Data[ConfigMapKey]