Skip to content

Commit

Permalink
fix: update node annotation used to limit log spam with valid key
Browse files Browse the repository at this point in the history
  • Loading branch information
brydoncheyney committed Nov 20, 2023
1 parent 81eed96 commit 7de0d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 7de0d94

Please sign in to comment.