From 7de0d94d45af6aadcf647744bd0093a8134c108d Mon Sep 17 00:00:00 2001 From: Brydon Cheyney Date: Mon, 20 Nov 2023 12:50:56 +0000 Subject: [PATCH] fix: update node annotation used to limit log spam with valid key --- cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go | 2 +- cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go index ee6facccf5e4..f5ce3f8199de 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go @@ -143,7 +143,7 @@ func (aws *awsCloudProvider) HasInstance(node *apiv1.Node) (bool, error) { // Nodes that belong to an asg that is not autoscaled will not be found in the asgCache below, // so do not trigger warning spam by returning an error from being unable to find them. // Annotation is not automated, but users that see the warning can add the annotation to avoid it. - if node.Annotations != nil && node.Annotations["k8s.io/cluster-autoscaler/enabled"] == "false" { + if node.Annotations != nil && node.Annotations["k8s.io/cluster-autoscaler-enabled"] == "false" { return false, nil } diff --git a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go index 1d37c15e9ad1..0033d27c68ea 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go @@ -728,7 +728,7 @@ func TestHasInstance(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "node-2", Annotations: map[string]string{ - "k8s.io/cluster-autoscaler/enabled": "false", + "k8s.io/cluster-autoscaler-enabled": "false", }, }, Spec: apiv1.NodeSpec{