Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove check for root volume device name on create #3798

Merged

Conversation

AverageMarcus
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

clusterctl move currently fails if trying to move an AWSMachinePool that have it's rootVolume already populated.

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

Special notes for your reviewer:

From what I can tell, the RootVolume device name is actually retrieved from the AMI image and the value in the Spec isn't used (only populated after creating).

See:

func (s *Service) checkRootVolume(rootVolume *infrav1.Volume, imageID string) (*string, error) {
rootDeviceName, err := s.getImageRootDevice(imageID)
if err != nil {
return nil, errors.Wrapf(err, "failed to get root volume from image %q", imageID)
}
snapshotSize, err := s.getImageSnapshotSize(imageID)
if err != nil {
return nil, errors.Wrapf(err, "failed to get root volume from image %q", imageID)
}
if rootVolume.Size < *snapshotSize {
return nil, errors.Errorf("root volume size (%d) must be greater than or equal to snapshot size (%d)", rootVolume.Size, *snapshotSize)
}
return rootDeviceName, nil
}

Checklist:

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

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 27, 2022
@k8s-ci-robot k8s-ci-robot added needs-priority size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 27, 2022
@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 Oct 27, 2022
@AverageMarcus AverageMarcus force-pushed the fix_clusterctl_move_devicename branch 4 times, most recently from 1862f6e to 3aaa38f Compare October 27, 2022 08:30
@@ -192,10 +192,6 @@ func (r *AWSMachine) validateRootVolume() field.ErrorList {
}
}

if r.Spec.RootVolume.DeviceName != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we log this info and not return error?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Updated :)

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
@Ankitasw
Copy link
Member

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

@Ankitasw
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2022
@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 Oct 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit d2a2916 into kubernetes-sigs:main Oct 28, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.x milestone Oct 28, 2022
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.

clusterctl move not compatible with AWSMachinePools
3 participants