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

[ENHANCEMENT] Upgrade cluster.x-k8s.io/v1alpha4 to cluster.x-k8s.io/v1beta1 #5268

Closed
FrankYang0529 opened this issue Mar 1, 2024 · 3 comments
Assignees
Labels
kind/enhancement Issues that improve or augment existing functionality
Milestone

Comments

@FrankYang0529
Copy link
Member

Is your enhancement related to a problem? Please describe.
The cluster.x-k8s.io/v1alpha4 will be removed after v1.6. Currently, we use CAPI v1.4.4. We only have 1 minor version to upgrade it.

ref: https://cluster-api.sigs.k8s.io/#-breaking-changes-

Describe the solution you'd like

Upgrade cluster.x-k8s.io/v1alpha4 to cluster.x-k8s.io/v1beta1.

capi "sigs.k8s.io/cluster-api/api/v1alpha4"

// capiWorkaround replaces the variable `SchemeGroupVersion` with `GroupVersion` in clusters.cluster.x-k8s.io client because
// `SchemeGroupVersion` is not declared in the vendor package but wrangler uses it.
// https://github.com/kubernetes-sigs/cluster-api/blob/56f9e9db7a9e9ca625ffe4bdc1e5e93a14d5e96c/api/v1alpha4/groupversion_info.go#L29
func capiWorkaround() {
absPath, _ := filepath.Abs("pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.x-k8s.io_client.go")
input, err := ioutil.ReadFile(absPath)
if err != nil {
logrus.Fatalf("failed to read the clusters.cluster.x-k8s.io client file: %v", err)
}
output := bytes.Replace(input, []byte("v1alpha4.SchemeGroupVersion"), []byte("v1alpha4.GroupVersion"), -1)
if err = ioutil.WriteFile(absPath, output, 0644); err != nil {
logrus.Fatalf("failed to update the clusters.cluster.x-k8s.io client file: %v", err)
}
}

@FrankYang0529 FrankYang0529 added the kind/enhancement Issues that improve or augment existing functionality label Mar 1, 2024
@FrankYang0529 FrankYang0529 self-assigned this Mar 1, 2024
@bk201 bk201 added this to the v1.4.0 milestone Mar 4, 2024
@harvesterhci-io-github-bot
Copy link
Collaborator

harvesterhci-io-github-bot commented Mar 18, 2024

Pre Ready-For-Testing Checklist

  • If NOT labeled: not-require/test-plan Has the e2e test plan been merged? Have QAs agreed on the automation test case? If only test case skeleton w/o implementation, have you created an implementation issue?

    • The automation skeleton PR is at:
    • The automation test case PR is at:
  • If the fix introduces the code for backward compatibility Has a separate issue been filed with the label release/obsolete-compatibility?
    The compatibility issue is filed at:

@harvesterhci-io-github-bot
Copy link
Collaborator

Automation e2e test issue: harvester/tests#1164

@lanfon72
Copy link
Member

Verified this enhancement has been applied.

Test Information

  • Environment: qemu/KVM single node
  • Harvester Version: v1.4.0-dev-20240830
  • ui-source Option: Auto

Verify Steps

  1. Same as feat: Upgrade cluster.x-k8s.io/v1alpha4 to cluster.x-k8s.io/v1beta1 #5377 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Issues that improve or augment existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants