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 kind mapper #8880

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
CAPD doesn't have direct dependencies from Kind, however, it is using kindest/node images.

As a consequence CAPD must stay in sync with Kind with regards to how kindest/node images are run when creating a new DockerMachine.

kindest/node images are created using a specific Kind version, and thus it is required to keep into account the mapping between the Kubernetes version for a kindest/node and the Kind version that created that image, so we can run it properly.

This PR implements this mapping and use it to pick the right image to use and to start this image as expected.

Which issue(s) this PR fixes:
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2023
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 19, 2023
@fabriziopandini fabriziopandini requested review from sbueringer and removed request for richardcase and stmcginnis June 19, 2023 15:06
@killianmuldoon
Copy link
Contributor

Part of #8788

@fabriziopandini
Copy link
Member Author

/retest

1 similar comment
@fabriziopandini
Copy link
Member Author

/retest

@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 Jun 20, 2023
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-full-main

@fabriziopandini
Copy link
Member Author

/retest
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member

/lgtm
on the changes. Let's see what CI thinks about it

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

LGTM label has been added.

Git tree hash: 4f7268ebdbeae84082df83711991d309aee15008

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.

Just some nits and one question about simplifying the customImage handling.


kindMapping := kind.GetMapping(semVer)

// Use custom image if provided.
if image != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternative here would be to always use the kind mapping when the image is in the form kindest/node:vX.X.X. I'm in favor of this as the current version means adding the same tag in the custom image has different behaviour than a machine that appears to be using that image. I think this could also simplify the logic in nodepool - but I haven't looked closely at that code yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

test/infrastructure/kind/mapper.go Outdated Show resolved Hide resolved
test/infrastructure/kind/mapper_test.go Outdated Show resolved Hide resolved
test/infrastructure/kind/mapper.go Outdated Show resolved Hide resolved
test/infrastructure/container/docker.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 Jun 21, 2023
@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member

/lgtm
(+/- squash)

/assign @killianmuldoon

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

LGTM label has been added.

Git tree hash: 2d119ca115b23eef95cd6f1292d6957015c453aa

@killianmuldoon
Copy link
Contributor

/hold
(for squash)

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 22, 2023
@killianmuldoon
Copy link
Contributor

/cherry-pick release-1.4

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.4

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.

@killianmuldoon
Copy link
Contributor

/cherry-pick release-1.3

@k8s-infra-cherrypick-robot

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

In response to this:

/cherry-pick release-1.3

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: killianmuldoon

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 Jun 22, 2023
@fabriziopandini
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 22, 2023
@k8s-ci-robot k8s-ci-robot merged commit 6073e52 into kubernetes-sigs:main Jun 22, 2023
10 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Jun 22, 2023
@k8s-infra-cherrypick-robot

@killianmuldoon: #8880 failed to apply on top of branch "release-1.4":

Applying: add kind mapper
Using index info to reconstruct a base tree...
M	test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
M	test/infrastructure/container/docker.go
M	test/infrastructure/docker/exp/internal/docker/nodepool.go
M	test/infrastructure/docker/internal/docker/machine.go
Falling back to patching base and 3-way merge...
Auto-merging test/infrastructure/docker/internal/docker/machine.go
CONFLICT (content): Merge conflict in test/infrastructure/docker/internal/docker/machine.go
Auto-merging test/infrastructure/docker/exp/internal/docker/nodepool.go
Auto-merging test/infrastructure/container/docker.go
CONFLICT (content): Merge conflict in test/infrastructure/container/docker.go
Auto-merging test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
CONFLICT (content): Merge conflict in test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add kind mapper
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.4

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-infra-cherrypick-robot

@killianmuldoon: #8880 failed to apply on top of branch "release-1.3":

Applying: add kind mapper
Using index info to reconstruct a base tree...
M	test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
M	test/extension/handlers/topologymutation/handler.go
M	test/infrastructure/container/docker.go
M	test/infrastructure/docker/exp/internal/docker/nodepool.go
M	test/infrastructure/docker/internal/docker/kind_manager.go
M	test/infrastructure/docker/internal/docker/kind_manager_test.go
M	test/infrastructure/docker/internal/docker/machine.go
Falling back to patching base and 3-way merge...
Auto-merging test/infrastructure/docker/internal/docker/manager_test.go
Auto-merging test/infrastructure/docker/internal/docker/manager.go
Auto-merging test/infrastructure/docker/internal/docker/machine.go
CONFLICT (content): Merge conflict in test/infrastructure/docker/internal/docker/machine.go
Auto-merging test/infrastructure/docker/exp/internal/docker/nodepool.go
Auto-merging test/infrastructure/container/docker.go
CONFLICT (content): Merge conflict in test/infrastructure/container/docker.go
Auto-merging test/extension/handlers/topologymutation/handler.go
Auto-merging test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
CONFLICT (content): Merge conflict in test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add kind mapper
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.3

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.

@killianmuldoon
Copy link
Contributor

/area provider/infrastructure-docker

@k8s-ci-robot k8s-ci-robot added the area/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider label Jun 27, 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/provider/infrastructure-docker Issues or PRs related to the docker infrastructure provider 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

5 participants