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

Bump CAPI to v1.5.0 #4510

Merged
merged 5 commits into from
Sep 27, 2023
Merged

Conversation

Ankitasw
Copy link
Member

@Ankitasw Ankitasw commented Sep 21, 2023

What type of PR is this?
/kind support

What this PR does / why we need it:
Bumps CAPI to v1.5.0 based on https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/book/src/developer/providers/migrations/v1.4-to-v1.5.md

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 #4375
Fixes #4390

Special notes for your reviewer:

Checklist:

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

Release note:

Bump CAPI to v1.5.0

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/support Categorizes issue or PR as a support question. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 21, 2023
@Ankitasw Ankitasw requested review from wyike and removed request for Skarlso and shivi28 September 21, 2023 09:41
@Ankitasw Ankitasw mentioned this pull request Sep 21, 2023
4 tasks
@Ankitasw Ankitasw changed the title Bump capi v1.5 Bump CAPI v1.5 Sep 21, 2023
@Ankitasw Ankitasw changed the title Bump CAPI v1.5 Bump CAPI to v1.5.0 Sep 21, 2023
@Ankitasw
Copy link
Member Author

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

@Ankitasw Ankitasw force-pushed the bump-capi-v1.5 branch 8 times, most recently from 485a62d to 6a92789 Compare September 21, 2023 15:57
@@ -113,7 +112,6 @@ var (
)

func main() {
rand.NewSource(time.Now().UnixNano())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this changing? I never noticed this line before, what was this used for?

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 point, I myself have not noticed this. I dont think this line has any affect, that's why it was removed by @furkatgofurov7

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. The only place we are using Random is in subnets.go to shuffle the AZs. But rand.Shuffel is already using a default seed. So it will provide pseudo random results every time its running. Removing this should be safe.

hack/ensure-go.sh Show resolved Hide resolved
@@ -2,7 +2,7 @@ module sigs.k8s.io/cluster-api-provider-aws/v2

go 1.20

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.4.4
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused by this - what's the effect of replacing a package with the same thing that's required?

Copy link
Member Author

Choose a reason for hiding this comment

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

This will pick the exact version of cluster api specified, otherwise it picks up the dirty version of whatever latest CAPI main branch has.

Copy link
Member Author

Choose a reason for hiding this comment

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

cc @richardcase to correct me if I am wrong.

@Ankitasw Ankitasw force-pushed the bump-capi-v1.5 branch 5 times, most recently from 416e708 to 1913959 Compare September 22, 2023 10:08
@Ankitasw
Copy link
Member Author

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

@Ankitasw
Copy link
Member Author

All tests are passing.

Copy link
Contributor

@AndiDog AndiDog left a comment

Choose a reason for hiding this comment

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

/lgtm

with minor comments

Comment on lines -90 to -91
- pkg: k8s.io/apimachinery/pkg/api/errors
alias: apierrors
Copy link
Contributor

Choose a reason for hiding this comment

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

Still used for imports, so why not lint it anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a duplicate import in the file, so removed, otherwise we will get below error

ERRO [linters_context] invalid configuration, multiple aliases for the same package: pkg=k8s.io/apimachinery/pkg/api/errors aliases=[apierrors,apierrors] 
ERRO [linters_context] invalid configuration, multiple packages with the same alias: alias=apierrors packages=[k8s.io/apimachinery/pkg/api/errors,k8s.io/apimachinery/pkg/api/errors] 

@@ -248,7 +248,7 @@ func TestGetAPIServerClassicELBSpecControlPlaneLoadBalancer(t *testing.T) {
expect: func(t *testing.T, g *WithT, res *infrav1.LoadBalancer) {
t.Helper()
expectedTarget := fmt.Sprintf("%v:%d", infrav1.ELBProtocolTCP, infrav1.DefaultAPIServerPort)
g.Expect(expectedTarget, res.HealthCheck.Target)
g.Expect(expectedTarget).NotTo(Equal(res.HealthCheck.Target))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why it this now negated? Is the default target different?

Copy link
Member Author

@Ankitasw Ankitasw Sep 27, 2023

Choose a reason for hiding this comment

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

Great find, thanks @AndiDog yes the default target is changed when we were moving to v1beta2 APIs. This change reside in code base for long, not sure how unit tests didn't catch it. Thanks a lot for this finding.
cc @richardcase

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

Skarlso commented Sep 26, 2023

/approve
/hold
Unhold once Andi's comments are answered. :)

@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 Sep 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Skarlso

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 26, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2023
@Ankitasw
Copy link
Member Author

Have added only the unit test change, so not re-running the E2E tests again.

@Ankitasw
Copy link
Member Author

/unhold

Need one more lgtm @AndiDog @Skarlso

@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 Sep 27, 2023
@Skarlso
Copy link
Contributor

Skarlso commented Sep 27, 2023

Oh dang, and that resulted in an API drift? Can we punt that?

@Ankitasw
Copy link
Member Author

Uhmm this is weird, I just changed the unit tests, maybe some changes came with rebase thats causing the issue.

furkatgofurov7 and others added 5 commits September 27, 2023 12:03
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
The tests where failing after upgrading controller-runtime due to changes in
the fake client.

Signed-off-by: Richard Case <richard.case@outlook.com>
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
@Ankitasw
Copy link
Member Author

@Skarlso its fine now.

@Skarlso
Copy link
Contributor

Skarlso commented Sep 27, 2023

/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 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 135a3ff into kubernetes-sigs:main Sep 27, 2023
13 checks passed
@Ankitasw
Copy link
Member Author

/cherry-pick release-2.2

@k8s-infra-cherrypick-robot

@Ankitasw: #4510 failed to apply on top of branch "release-2.2":

Applying: Bump CAPI to v1.5.0
Using index info to reconstruct a base tree...
M	api/v1beta2/awscluster_webhook.go
M	controllers/awsmachine_controller.go
M	controllers/awsmachine_controller_unit_test.go
M	controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook.go
M	controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook_test.go
M	exp/api/v1beta2/awsmanagedmachinepool_webhook.go
M	exp/api/v1beta2/awsmanagedmachinepool_webhook_test.go
M	exp/controllers/awsmachinepool_controller.go
M	go.mod
M	go.sum
M	main.go
M	pkg/internal/bytes/bytes_test.go
M	test/e2e/data/e2e_conf.yaml
M	versions.mk
Falling back to patching base and 3-way merge...
Auto-merging versions.mk
CONFLICT (content): Merge conflict in versions.mk
Auto-merging test/e2e/data/e2e_conf.yaml
Auto-merging pkg/internal/bytes/bytes_test.go
CONFLICT (content): Merge conflict in pkg/internal/bytes/bytes_test.go
Auto-merging main.go
CONFLICT (content): Merge conflict in main.go
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
Auto-merging exp/controllers/awsmachinepool_controller.go
Auto-merging exp/api/v1beta2/awsmanagedmachinepool_webhook_test.go
Auto-merging exp/api/v1beta2/awsmanagedmachinepool_webhook.go
Auto-merging controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook_test.go
Auto-merging controlplane/eks/api/v1beta2/awsmanagedcontrolplane_webhook.go
Auto-merging controllers/awsmachine_controller_unit_test.go
Auto-merging controllers/awsmachine_controller.go
Auto-merging api/v1beta2/awscluster_webhook.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Bump CAPI to v1.5.0
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-2.2

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/support Categorizes issue or PR as a support question. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump CAPI to v1.5.0 CAPI v1.5.0-beta.0 has been released and is ready for testing
10 participants