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

🌱 Update ASG when subnets are changed in AWSMachinePool

Open DiptoChakrabarty opened this issue 3 years ago • 17 comments
trafficstars

What type of PR is this?

/kind feature What this PR does / why we need it:

Updates ASG when subnets are changed in AWSMachinePool

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 #3315

Special notes for your reviewer: would like to test using github

Checklist:

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

DiptoChakrabarty avatar Apr 01 '22 14:04 DiptoChakrabarty

@DiptoChakrabarty: This issue is currently awaiting triage.

If CAPA/CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 avatar Apr 01 '22 14:04 k8s-ci-robot

Hi @DiptoChakrabarty. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 avatar Apr 01 '22 14:04 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign fabriziopandini after the PR has been reviewed. You can assign the PR to them by writing /assign @fabriziopandini in a comment when ready.

The full list of commands accepted by this bot can be found 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 avatar Apr 01 '22 14:04 k8s-ci-robot

/ok-to-test

Ankitasw avatar Apr 02 '22 16:04 Ankitasw

@DiptoChakrabarty can you squash your commits?

Ankitasw avatar Apr 02 '22 16:04 Ankitasw

can you squash your commits?

done

DiptoChakrabarty avatar Apr 02 '22 17:04 DiptoChakrabarty

@DiptoChakrabarty can you please run the tests locally and see the issue, it's something to do with these changes only.

Ankitasw avatar Apr 04 '22 06:04 Ankitasw

@Ankitasw based on the change I should add a test to check Subnet != asg.Subnet right ?

DiptoChakrabarty avatar Apr 08 '22 17:04 DiptoChakrabarty

@Ankitasw based on the change I should add a test to check Subnet != asg.Subnet right ?

Yes please.

Ankitasw avatar Apr 08 '22 17:04 Ankitasw

@Ankitasw based on the change I should add a test to check Subnet != asg.Subnet right ?

Is this change yet to be done?

Ankitasw avatar Apr 11 '22 10:04 Ankitasw

Is this change yet to be done?

yes , added the testcase but encountering an error , will push the test soon

DiptoChakrabarty avatar Apr 11 '22 14:04 DiptoChakrabarty

the tests are failing because I set the machinePoolScope.AWSMachinePool.Spec.Subnets as []infrav1.AWSResourceReference{ { ID: pointer.String("subnet1"), }, { ID: pointer.String("subnet2"), }, }, and the existingASG.Subnets as []string{"subnet1", "subnet2"}, do they have to be set in another format for this case

DiptoChakrabarty avatar Apr 12 '22 18:04 DiptoChakrabarty

@DiptoChakrabarty: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-aws-test 6361a8cc57582318c5c63450f4b265e5feca1aef link true /test pull-cluster-api-provider-aws-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

k8s-ci-robot avatar Apr 12 '22 18:04 k8s-ci-robot

the tests are failing because I set the machinePoolScope.AWSMachinePool.Spec.Subnets as []infrav1.AWSResourceReference{ { ID: pointer.String("subnet1"), }, { ID: pointer.String("subnet2"), }, }, and the existingASG.Subnets as []string{"subnet1", "subnet2"}, do they have to be set in another format for this case

I am not sure how cmp.Equal will work with different types of structs. @shivi28 I remember you making a doc on go cmp usage, can you let us know if you came across any such examples as used in this PR?

Ankitasw avatar Apr 18 '22 07:04 Ankitasw

I am not sure how cmp.Equal will work with different types of structs. @shivi28 I remember you making a doc on go cmp usage, can you let us know if you came across any such examples as used in this PR?

I can make a go cmp comparer function to compare the AWSResourceReference.ID and AutoScalingGroup.Subnets however I was suggested to do something like this https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues/3315#issuecomment-1074293015 just making sure

DiptoChakrabarty avatar Apr 26 '22 05:04 DiptoChakrabarty

@DiptoChakrabarty were you able to figure out the issue?

Ankitasw avatar Jun 13 '22 07:06 Ankitasw

@DiptoChakrabarty: PR needs rebase.

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 avatar Oct 13 '22 06:10 k8s-ci-robot

@DiptoChakrabarty would you like to continue this PR?

Ankitasw avatar Oct 28 '22 08:10 Ankitasw