Skip to content

Commit

Permalink
Update group identifier to use for Cluster API annotations
Browse files Browse the repository at this point in the history
- Also add backwards compatibility for the previously used deprecated annotations
  • Loading branch information
detiber committed May 28, 2020
1 parent 21c41ba commit efd6f4a
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 147 deletions.
4 changes: 2 additions & 2 deletions cluster-autoscaler/cloudprovider/clusterapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ resources depending on the type of cluster-api mechanism that you are using.

There are two annotations that control how a cluster resource should be scaled:

* `cluster.k8s.io/cluster-api-autoscaler-node-group-min-size` - This specifies
* `cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size` - This specifies
the minimum number of nodes for the associated resource group. The autoscaler
will not scale the group below this number. Please note that currently the
cluster-api provider will not scale down to zero nodes.

* `cluster.k8s.io/cluster-api-autoscaler-node-group-max-size` - This specifies
* `cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size` - This specifies
the maximum number of nodes for the associated resource group. The autoscaler
will not scale the group above this number.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,12 @@ func (c *machineController) findMachineByProviderID(providerID normalizedProvide
if node == nil {
return nil, nil
}
return c.findMachine(node.Annotations[machineAnnotationKey])

machineID, ok := node.Annotations[machineAnnotationKey]
if !ok {
machineID = node.Annotations[deprecatedMachineAnnotationKey]
}
return c.findMachine(machineID)
}

func isFailedMachineProviderID(providerID normalizedProviderID) bool {
Expand Down
Loading

0 comments on commit efd6f4a

Please sign in to comment.