fix: treat absent and disabled EKS Auto Mode fields as equivalent - #255
michaelhtm wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michaelhtm The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
41621ae to
6e175d4
Compare
|
/label release/patch |
knottnt
left a comment
There was a problem hiding this comment.
Thanks @michaelhtm. Left a couple comments. Main concern is that we're moving what seems like service side validation into the controller. If a user specifies an invalid combination for compute, storage, and networking I think its okay for us to let the user get an error from the API.
|
|
||
| aws_res = eks_client.describe_cluster(name=cluster_name) | ||
| logging.info(f"post-disable describe_cluster: {aws_res['cluster'].get('computeConfig')}") | ||
| assert aws_res["cluster"].get("computeConfig", {}).get("enabled") is not True |
There was a problem hiding this comment.
Should be asserting False? Or does the API also return None in this case?
| } | ||
|
|
||
| input.KubernetesNetworkConfig = kubernetesNetworkConfig | ||
| // newAutoModeUpdateInput builds an Auto Mode UpdateClusterConfig request. EKS requires compute, block storage and load balancing to all be enabled or disabled in the same request, so an incomplete or disagreeing tuple is a terminal spec error rather than a rejected API call. |
There was a problem hiding this comment.
I'd suggest delegating this validation to the to the service API instead of performing it client-side. It is possible that this client side validation drifts from what the service actually allows.
|
The stated premise is wrong for
|
|
The new terminal error leaves
|
|
|
|
|
d07be25 to
cfc06ff
Compare
|
/retest |
DescribeCluster always reports elasticLoadBalancing and omits computeConfig and storageConfig on a cluster that never opted in, so a CR that left those unset or declared them disabled read as drift and drove an UpdateClusterConfig that EKS rejects. The compare hook now treats absent and disabled as the same state per capability, the Auto Mode request always carries the full compute/storage/load balancing tuple without the creation-only ipFamily and serviceIPv4CIDR, and a request EKS rejects is terminal instead of retried forever. Resolves aws-controllers-k8s/community#3046
cfc06ff to
9a6cced
Compare
|
@michaelhtm: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description of changes:
DescribeCluster always reports elasticLoadBalancing and omits computeConfig and
storageConfig on a cluster that never opted in, so a CR that left those unset or
declared them disabled read as drift and drove an UpdateClusterConfig that EKS
rejects. The compare hook now treats absent and disabled as the same state per
capability, the Auto Mode request always carries the full compute/storage/load
balancing tuple without the creation-only ipFamily and serviceIPv4CIDR, and a
request EKS rejects is terminal instead of retried forever.
Resolves aws-controllers-k8s/community#3046
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.