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

✨ Implement "upgrade plan" support #408

Merged
merged 3 commits into from
May 6, 2024

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jan 25, 2024

What this PR does / why we need it:

This PR implements upgrade plan support for the plugin

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 25, 2024
@Fedosin
Copy link
Contributor Author

Fedosin commented Jan 25, 2024

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 25, 2024
@Fedosin Fedosin force-pushed the plugin_upgrade_plan branch 2 times, most recently from c2bf71a to 731f8c8 Compare January 26, 2024 15:49
@Fedosin Fedosin force-pushed the plugin_upgrade_plan branch from 731f8c8 to 828e437 Compare February 8, 2024 16:26
@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 Feb 8, 2024
@Fedosin
Copy link
Contributor Author

Fedosin commented Feb 9, 2024

/retest

2 similar comments
@Fedosin
Copy link
Contributor Author

Fedosin commented Feb 12, 2024

/retest

@alexander-demicev
Copy link
Contributor

/retest

Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

Looks good to me, just some questions/suggestions/nits

@@ -375,100 +372,6 @@ func generateCAPIOperatorDeployment(name, namespace string) *appsv1.Deployment {
}
}
Copy link
Member

Choose a reason for hiding this comment

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

One question - this test removed, is it covered by upgrade plan tests? Shouldn't we leave both for clarity?

Comment on lines +148 to +159
g.Eventually(func() (bool, error) {
provider, err := getGenericProvider(ctx, env, string(util.ClusterctlProviderType(genericProvider)), genericProvider.GetName(), genericProvider.GetNamespace())
if err != nil {
return false, err
}

if provider.GetSpec().FetchConfig == nil || provider.GetSpec().FetchConfig.URL != tt.customURL {
return false, nil
}

return true, nil
}, waitShort).Should(BeTrue())
Copy link
Member

Choose a reason for hiding this comment

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

This format makes things a bit more tidy IMO.

Suggested change
g.Eventually(func() (bool, error) {
provider, err := getGenericProvider(ctx, env, string(util.ClusterctlProviderType(genericProvider)), genericProvider.GetName(), genericProvider.GetNamespace())
if err != nil {
return false, err
}
if provider.GetSpec().FetchConfig == nil || provider.GetSpec().FetchConfig.URL != tt.customURL {
return false, nil
}
return true, nil
}, waitShort).Should(BeTrue())
g.Eventually(func(g g.Gomega) error {
provider, err := getGenericProvider(ctx, env, string(util.ClusterctlProviderType(genericProvider)), genericProvider.GetName(), genericProvider.GetNamespace())
g.Expect(err).ToNot(HaveOccurred())
g.Expect(provider.GetSpec().FetchConfig != nil && provider.GetSpec().FetchConfig.URL == tt.customURL).To(BeTrue())
}, waitShort).Should(Succeed())

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 14, 2024

/area plugin

@k8s-ci-robot k8s-ci-robot added the area/plugin Issues or PRs related to clusterctl operator plugin label Mar 14, 2024
@Fedosin Fedosin force-pushed the plugin_upgrade_plan branch from 8c8298b to 0c92b56 Compare April 10, 2024 10:37
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2024
Copy link

netlify bot commented Apr 10, 2024

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

Name Link
🔨 Latest commit 7e6e7eb
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-operator/deploys/6634b378c367b9000844892a
😎 Deploy Preview https://deploy-preview-408--kubernetes-sigs-cluster-api-operator.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 configuration.

@Fedosin Fedosin force-pushed the plugin_upgrade_plan branch from 0c92b56 to ac389d7 Compare April 10, 2024 10:40
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2024
@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 10, 2024

/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 Apr 10, 2024
Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demicev

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 11, 2024
Copy link
Member

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

To give time to resolve comments from @Danil-Grigorev

@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 May 3, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e3e00b12399b678b886855d9eb15b1a05140853c

Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

One question to runtime extension provider addition, otherwise lgtm.

cmd/plugin/cmd/upgrade_plan.go Show resolved Hide resolved
Fedosin added 3 commits May 3, 2024 11:47
This test overwrites exiting CRDs with older versions, which breaks
futher tests.
@Fedosin Fedosin force-pushed the plugin_upgrade_plan branch from ac389d7 to 7e6e7eb Compare May 3, 2024 09:50
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2024
@Danil-Grigorev
Copy link
Member

/lgtm

Will leave hold in case Mike wants to re-add removed test, otherwise everything looks good. Thanks!

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

LGTM label has been added.

Git tree hash: d5797ef9378eaa039619667879372b7ee70df2a3

@Fedosin
Copy link
Contributor Author

Fedosin commented May 6, 2024

/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 May 6, 2024
@Fedosin
Copy link
Contributor Author

Fedosin commented May 6, 2024

/retest

@k8s-ci-robot k8s-ci-robot merged commit 22b3a28 into kubernetes-sigs:main May 6, 2024
14 checks passed
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/plugin Issues or PRs related to clusterctl operator plugin 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.

Support clusterctl upgrade plan
5 participants