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

🌱 Add MachinePool Builders #9346

Merged

Conversation

johannesfrey
Copy link
Contributor

@johannesfrey johannesfrey commented Aug 31, 2023

What this PR does / why we need it:

This PR adds MachinePool Builders that can be referenced in tests.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Prereq for some of the MachinePool tests tracked in #5991

/area testing

Johannes Frey <johannes.frey@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH (Provider Information)

@k8s-ci-robot k8s-ci-robot added area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 31, 2023
@johannesfrey
Copy link
Contributor Author

/remove-area testing
/area machinepool

@k8s-ci-robot k8s-ci-robot added area/machinepool Issues or PRs related to machinepools and removed area/testing Issues or PRs related to testing labels Aug 31, 2023
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 99275d7fe3e582d3899992e31cd823b464ed8a41

@sbueringer
Copy link
Member

cc @chrischdi

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

Just one minor comment about the current diff! For blueprint_test.go, I needed to also create a InfrastructureMachinePoolTemplateBuilder type as defined here. Would you be able to include this in your PR?

main...willie-yao:cluster-api:cc-mp-unit-tests#diff-30b8ed7bcbffa0687acaccab71710d58dab625a59a40a38888069eb870b41c17R732

internal/test/builder/builders.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2023
@johannesfrey
Copy link
Contributor Author

Just one minor comment about the current diff! For blueprint_test.go, I needed to also create a InfrastructureMachinePoolTemplateBuilder type as defined here. Would you be able to include this in your PR?

main...willie-yao:cluster-api:cc-mp-unit-tests#diff-30b8ed7bcbffa0687acaccab71710d58dab625a59a40a38888069eb870b41c17R732

Sure, I adjusted the PR according to your changes. Thx!

In my tests I was just simply passing the ouput of InfrastructureMachineTemplate into the MachinePoolClass. Therefore, I'm a bit wondering about the reason behind naming this with MachinePool in the field name, while in the MachineDeployment it's simply named without MachineDeployment in the field name. 🤔

internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

Lost the overview a bit. Please let me know if there are open questions (ideally open a conversation at the corresponding code location :))

@sbueringer
Copy link
Member

@johannesfrey looks like you actually need the kind stuff: https://github.com/kubernetes-sigs/cluster-api/pull/9346/files#r1312902556

@johannesfrey
Copy link
Contributor Author

@johannesfrey looks like you actually need the kind stuff: https://github.com/kubernetes-sigs/cluster-api/pull/9346/files#r1312902556

I went ahead to quickly 😅. Will add another commit.

@sbueringer
Copy link
Member

@johannesfrey looks like you actually need the kind stuff: #9346 (files)

I went ahead to quickly 😅. Will add another commit.

Just please make sure you use the right Generic vs Test kind (just compare with the existing pre-existing builders)

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 4, 2023
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 79cd0f9b1fc9143badf0bf41e5e601053ce0bea9

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2023
@johannesfrey
Copy link
Contributor Author

Had to do another renaming commit. Should I squash the commits before another lgtm @chrischdi ?

@sbueringer
Copy link
Member

If you only squash the commits (i.e. without a rebase onto main) lgtm is preserved

More precisely lgtm is preserved if the git tree hash doesn't change (it is stored in a comment, e.g.: #9346 (comment), see details)

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Almost there :)

internal/test/builder/bootstrap.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/builders.go Outdated Show resolved Hide resolved
internal/test/builder/infrastructure.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

Looks good. Thank you very much!!

/lgtm

approve pending squash (please just squash the commits without rebasing to main :))

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: dbae36c15261e617fb5b72109c954b33d03874a7

@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 Sep 5, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8516dae into kubernetes-sigs:main Sep 5, 2023
19 of 20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.6 milestone Sep 5, 2023
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. area/machinepool Issues or PRs related to machinepools cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants