Skip to content

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Apr 5, 2023

What this PR does / why we need it:

This PR pulls [email protected] (including 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6 and 1.4.0) - this follow a mention from the office hours

Special notes for your reviewer:

  1. Not so much to report regarding the upgrade as the commits speak by themselves.
  2. BIG QUESTION MARK on the following commit: test/e2e/suites: update remediation flavor
  3. sigs.k8s.io/cluster-api/api/v1alpha{3,4} are deprecated - we currently ignore the warning before agreeing on what to do
  4. Got a weird issue with the CI: cloud-init was failing (but don't know why), cloud-init validation was complaining about permissions not being a string so I fixed this in a commit.

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@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 Apr 5, 2023
@netlify
Copy link

netlify bot commented Apr 5, 2023

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit 3822684
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/64369f85943efd0008aaa725
😎 Deploy Preview https://deploy-preview-1521--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 5, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 5, 2023
@tormath1 tormath1 changed the title 🌱 pull [email protected] [wip] 🌱 pull [email protected] Apr 5, 2023
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 5, 2023
@tormath1 tormath1 force-pushed the tormath1/capi-upgrade branch 2 times, most recently from d3d9c12 to 6f225d9 Compare April 6, 2023 11:55
@tormath1 tormath1 changed the title [wip] 🌱 pull [email protected] 🌱 pull [email protected] Apr 6, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2023
@mdbooth
Copy link
Contributor

mdbooth commented Apr 6, 2023

/assign

@@ -20,13 +20,13 @@ packages:
package_upgrade: true
write_files:
- path: /etc/sysctl.d/devstack.conf
permissions: 0644
permissions: "0644"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be yes, I'm just wondering why we'd would hitting this only now since new version of cloud-init is released since 1 month (https://launchpad.net/ubuntu/focal/+source/cloud-init).
At least it makes it consistent with the rest of the codebase.

@jichenjc
Copy link
Contributor

BIG QUESTION MARK on the following commit: test/e2e/suites: update remediation flavor

seems one additional test added here... so what's the big question?

@tormath1
Copy link
Contributor Author

BIG QUESTION MARK on the following commit: test/e2e/suites: update remediation flavor

seems one additional test added here... so what's the big question?

@jichenjc I'm not yet super comfortable with the codebase so it's more to ask extra attention on this commit during the review :)

Copy link
Contributor

@mdbooth mdbooth left a comment

Choose a reason for hiding this comment

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

/lgtm

I'd like to wait for @lentzi90's take on the test changes before approving, but hopefully this is good to go. Thanks!

@@ -177,7 +177,7 @@ func (r *OpenStackMachine) SetConditions(conditions clusterv1.Conditions) {
// SetFailure sets the OpenStackMachine status failure reason and failure message.
func (r *OpenStackMachine) SetFailure(failureReason errors.MachineStatusError, failureMessage error) {
r.Status.FailureReason = &failureReason
r.Status.FailureMessage = pointer.StringPtr(failureMessage.Error())
r.Status.FailureMessage = pointer.String(failureMessage.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewer note:
pointer.StringPtr === pointer.String

StringPtr is deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually all the pointer.<Type>Ptr have been renamed to pointer.<Type> - I think it's to follow the non-redundancy pattern (https://google.github.io/styleguide/go/decisions#package-vs-exported-symbol-name)

@@ -590,7 +590,7 @@ func (r *OpenStackMachineReconciler) requeueOpenStackMachinesForUnpausedCluster(
}

func (r *OpenStackMachineReconciler) requestsForCluster(ctx context.Context, log logr.Logger, namespace, name string) []ctrl.Request {
labels := map[string]string{clusterv1.ClusterLabelName: name}
labels := map[string]string{clusterv1.ClusterNameLabel: name}
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewer note:
Constant was renamed. Value remains the same.

@@ -137,7 +137,7 @@ func Test_machineToInstanceSpec(t *testing.T) {
machine: func() *clusterv1.Machine {
m := getDefaultMachine()
m.Labels = map[string]string{
clusterv1.MachineControlPlaneLabelName: "true",
clusterv1.MachineControlPlaneLabel: "true",
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewer note:
Constant was renamed. Value the same.

@@ -113,7 +113,7 @@ func dumpMachines(ctx context.Context, e2eCtx *E2EContext, namespace *corev1.Nam
return
}

machineNames := sets.NewString()
machineNames := sets.New[string]()
Copy link
Contributor

Choose a reason for hiding this comment

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

Shiny!

Comment on lines 32 to 33
var _ = Describe("When testing unhealthy machines remediation", func() {
Describe("[mhc-remediations]", func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@lentzi90 This change passes my smell test: KCPFlavor and MDFlavor have been removed in favour of just Flavor, but I'd appreciate if you could take a closer look.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for bringing this to my attention!
It seems like they split the test into two actually. There is now the MachineDeploymentRemediationSpec that we see here, but also KCPRemediationSpec as seen here.
@tormath1 could you please update to use the KCPRemediationSpec here in place of the second MachineDeploymentRemediationSpec? If it is in separate files or not does not matter to me but it would be nice to run both. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the extra check. The content of this commit is not enough then: 9d56439 ?
We test both KCPRemediationSpec and MachineDeploymentRemediationSpec

Copy link
Contributor

Choose a reason for hiding this comment

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

Umm I may be missing something, but I don't see KCPRemediationSpec? I see two times MachineDeploymentRemediationSpec with different flavors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah perfect thanks - I thought we were speaking about the flavor name :)

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 11, 2023
@tormath1 tormath1 force-pushed the tormath1/capi-upgrade branch from 6f225d9 to bfcd6d4 Compare April 12, 2023 09:10
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 12, 2023
@lentzi90
Copy link
Contributor

/test pull-cluster-api-provider-openstack-e2e-full-test

Copy link
Contributor

@lentzi90 lentzi90 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 Apr 12, 2023
@mdbooth
Copy link
Contributor

mdbooth commented Apr 12, 2023

Can you squash the commits before removing the hold?

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdbooth, tormath1

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 Apr 12, 2023
@lentzi90
Copy link
Contributor

Ow the KCPRemediationSpec is a bit more involved. I didn't realize they changed so much. It is now a much more thorough test but it means we need some changes to make it work. Previously these remediation tests were almost the same, just one for the control plane and one for the MachineDeployment. But now the KCP test is also checking remediation of the very first node that fails to initialize.

They have put some comments in the code for what is needed: https://github.com/kubernetes-sigs/cluster-api/blob/9ad6d519caed6755da688225172d8999be6c7015/test/e2e/kcp_remediations.go#L52-L77
If I understand it correctly we would need the following:

  1. Define wait intervals for wait-cluster, wait-machines, check-machines-stable and wait-machine-provisioned (if they don't already exist) here.
  2. Ensure that the flavor we use have 3 control plane nodes and 0 workers. I think this is already the case.
  3. The control plane must be configured with preKubeadmCommands that queries for a well-known ConfigMap on the management cluster, holding up bootstrap until a signal is passed via the config map. I'm not even sure if this is possible in our CI since it requires the workload cluster to access the management cluster...
  4. The MachineHealthCheck itself that we already have (may need some tweak though, I haven't checked the exact details of it).

Point 3 is the big one. It may be a bit too much to add in this PR. I would be fine with dropping the KCP test for now since it is basically a completely new test after the changes they made. I will anyway investigate if we can add it later when I have time.

@tormath1 tormath1 force-pushed the tormath1/capi-upgrade branch from bfcd6d4 to 3822684 Compare April 12, 2023 12:09
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 12, 2023
@tormath1
Copy link
Contributor Author

@mdbooth @lentzi90 thanks for your reviews!

  • commits have been squashed
  • dropped the KCP remediation test in favor of Add KCP remediation test #1523
  • added a comment regarding the golang lint staticcheck

Changes are available here: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/compare/bfcd6d46d5a60a82222b0a87d7c204f0ee64073b..38226846051a7b38e29a9ad4bfeb0539667b1e7a

Copy link
Contributor

@lentzi90 lentzi90 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 Apr 12, 2023
@lentzi90
Copy link
Contributor

/test pull-cluster-api-provider-openstack-e2e-full-test

@tormath1
Copy link
Contributor Author

/unhold

@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 Apr 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit 097d20a into kubernetes-sigs:main Apr 12, 2023
@tormath1 tormath1 deleted the tormath1/capi-upgrade branch April 12, 2023 16:06
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. 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.

5 participants