Skip to content

Conversation

Skarlso
Copy link
Contributor

@Skarlso Skarlso commented Nov 19, 2022

/kind bug

What this PR does / why we need it:

The suspend flow in the create ASG process is failing because during the ASG creation, we never return the actual ASG. That's because the CreateAutoscalingGroup flow is not returning an ASG so we reconcile it.

I just removed the suspend during creation, the update flow should still suspend or unsuspend anything that is different.

I'll try adding some more tests to this part of the code.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 19, 2022
@richardcase
Copy link
Member

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-clusterclass
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

Instructions 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/test-infra repository.

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e-eks

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

I've been thinking about how to unit test this but it ain't an easy one. I was thinking about adding an e2e test but that takes time and I don't want to keep the upgrade test broken. @richardcase any ideas?

@richardcase
Copy link
Member

I've toyed with the idea of adding the option to run "extended" e2e tests.

@richardcase
Copy link
Member

It wouldn't be easy to unit test but it's doable. I can have a bash if you want?

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

It's fine I'll be home soonish I'll take a stab at it. 😊 thank you. I'll shout if I get stuck.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

The question is what to unit test. I guess I can test that during an upgrade suspension is called while during create it does not.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

/test pull-cluster-api-provider-aws-e2e-eks

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

Turns out I already head unit tests, but I was missing a call to the mock to verify that it is called or not.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

The previous eks failure was not because of this. The create ASG was successful:

I1119 15:18:15.351354       1 recorder.go:103] "events: Normal" object={Kind:AWSMachinePool Namespace:cluster-rvmce3 Name:cluster-0qrm8w-mp-0 UID:0d199a75-8c29-490a-8e95-2ebc3e590ae0 APIVersion:infrastructure.cluster.x-k8s.io/v1beta2 ResourceVersion:19141 FieldPath:} reason="FailedDescribeInstances" message="No Auto Scaling Groups with cluster-0qrm8w-mp-0 found"
I1119 15:18:16.645556       1 recorder.go:103] "events: Normal" object={Kind:AWSMachinePool Namespace:cluster-rvmce3 Name:cluster-0qrm8w-mp-0 UID:0d199a75-8c29-490a-8e95-2ebc3e590ae0 APIVersion:infrastructure.cluster.x-k8s.io/v1beta2 ResourceVersion:19141 FieldPath:} reason="SuccessfulCreate" message="Created new ASG: cluster-0qrm8w-mp-0"
I1119 15:18:16.645799       1 recorder.go:103] "events: Normal" object={Kind:AWSMachinePool Namespace:cluster-rvmce3 Name:cluster-0qrm8w-mp-0 UID:0d199a75-8c29-490a-8e95-2ebc3e590ae0 APIVersion:infrastructure.cluster.x-k8s.io/v1beta2 ResourceVersion:19141 FieldPath:} reason="SuccessfulCreate" message="Created new ASG: cluster-0qrm8w-mp-0"
I1119 15:18:16.664759       1 logger.go:80] "identity: Creating an AWS Session" controller="awsmachinepool" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachinePool" aWSMachinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" namespace="cluster-rvmce3" name="cluster-0qrm8w-mp-0" reconcileID=83771b90-9210-48df-ad1b-ce6c8824f76f machinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" cluster="cluster-rvmce3/cluster-0qrm8w"
I1119 15:18:16.664807       1 logger.go:80] "identity: Getting identity" controller="awsmachinepool" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachinePool" aWSMachinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" namespace="cluster-rvmce3" name="cluster-0qrm8w-mp-0" reconcileID=83771b90-9210-48df-ad1b-ce6c8824f76f machinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" cluster="cluster-rvmce3/cluster-0qrm8w" identityKey="/e2e-account"
I1119 15:18:16.665977       1 logger.go:68] "Reconciling AWSMachinePool" controller="awsmachinepool" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="AWSMachinePool" aWSMachinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" namespace="cluster-rvmce3" name="cluster-0qrm8w-mp-0" reconcileID=83771b90-9210-48df-ad1b-ce6c8824f76f machinePool="cluster-rvmce3/cluster-0qrm8w-mp-0" cluster="cluster-rvmce3/cluster-0qrm8w"
I1119 15:18:16.666914       1 logger.go:68] "checking for existing launch template"

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

Hmm, interesting. The test failed again.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 19, 2022
@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

/test pull-cluster-api-provider-aws-e2e-eks

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

Kind of suspicious. The Suspend PR had both these tests running:

pull-cluster-api-provider-aws-e2e
pull-cluster-api-provider-aws-e2e-eks

And passing.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 19, 2022

I'm running eks test here as well #3804

Just to see if something isn't messed up.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 20, 2022

/test pull-cluster-api-provider-aws-e2e-eks

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 21, 2022

/test pull-cluster-api-provider-aws-e2e-eks

edit: Wohoo, this passed.

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 21, 2022

/test pull-cluster-api-provider-aws-e2e-eks

Once more into the fray. Once more we go.

I want to see if AWS got their things together. :)

@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 23, 2022

/test pull-cluster-api-provider-aws-e2e-eks

@Skarlso Skarlso changed the title [WIP] Remove suspend process flow from create ASG ( fix upgrade test ) Remove suspend process flow from create ASG Nov 25, 2022
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 25, 2022
@Skarlso
Copy link
Contributor Author

Skarlso commented Nov 25, 2022

@richardcase @Ankitasw This is now ready. I don't think there is anything else to fix in here. Should I add a suspend e2e during this pr?

@Ankitasw
Copy link
Member

Ankitasw commented Nov 30, 2022

It seems fine to push to v2.0.2 as it doesn't break any functionality and hence take care of E2E tests in a separate issue so:

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 30, 2022
@Ankitasw
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitasw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 30, 2022
@Ankitasw
Copy link
Member

/cherry-pick release-2.0

@k8s-infra-cherrypick-robot

@Ankitasw: once the present PR merges, I will cherry-pick it on top of release-2.0 in a new PR and assign it to you.

In response to this:

/cherry-pick release-2.0

Instructions 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot merged commit aec9433 into kubernetes-sigs:main Nov 30, 2022
@k8s-infra-cherrypick-robot

@Ankitasw: new pull request created: #3892

In response to this:

/cherry-pick release-2.0

Instructions 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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants