cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

AWSManagedMachinePool - Unable to modify updateConfig from maxUnavailable to maxUnavailablePercentage and vice versa in CAPA 2.0.2

Open SPP-2020 opened this issue 1 year ago • 1 comments
trafficstars

/kind bug

Facing an issue while trying to change spec.updateConfig.maxUnavailable to maxUnavailablePercentage on AWSManagedMachinePool. Getting below error -

Error from server: failed to prune fields: failed add back owned items: failed to convert merged object at version infrastructure.cluster.x-k8s.io/v1beta1: .spec.updateConfig.maxUnavailablePercentage: field not declared in schema

Steps to reproduce

  • Create EKS cluster with AWSManagedMachinePool and spec.updateConfig set to maxUnavailable & version v1beta2
  • Once cluster is up, add spec.updateConfig.maxUnavailablePercentage = 70 (value doesnt actually matter)
  • Attempt to apply and you will receive the error above.

In addition to this, if we manually edit AWSManagedMachinePool, set spec.updateConfig.maxUnavailablePercentage & try to change it to maxUnavailable, it throws below error -

The AWSManagedMachinePool "caas-workloads-2" is invalid: spec.updateConfig: Invalid value: v1beta2.UpdateConfig{MaxUnavailable:(*int)(0xc0015a0810), MaxUnavailablePercentage:(*int)(0xc0015a0818)}: cannot specify both maxUnavailable and maxUnavailablePercentage

What did you expect to happen: AWSManagedMachinePool spec.updateConfig successfully updated from maxUnavailable to maxUnavailablePercentage & vice versa

Environment:

  • Cluster-api-provider-aws version: 1.2.2
  • Kubernetes version: (use kubectl version): 1.26
  • OS (e.g. from /etc/os-release):

SPP-2020 avatar May 17 '24 08:05 SPP-2020