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

Migrate to kubebuilder go/v4 #437

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ultram4rine
Copy link
Contributor

@ultram4rine ultram4rine commented May 5, 2024

Closes #421

📑 Description

Steps:

mv k8sgpt-operator k8sgpt-operator-orig
mkdir k8sgpt-operator && cd k8sgpt-operator
go mod init github.com/k8sgpt-ai/k8sgpt-operator
kubebuilder init --domain k8sgpt.ai --plugins=go/v4,grafana.kubebuilder.io/v1-alpha
cp -r ../k8sgpt-operator-orig/hack .
kubebuilder create api --group core --version v1alpha1 --kind K8sGPT # Resource: yes, Controller: yes
kubebuilder create api --group core --version v1alpha1 --kind Result # Resource: yes, Controller: no

Then copy file by file to new project layout.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

As kubebuilder scaffolded with golangci config I've also added a GH job with it.
Ways to fix this CI step:

  • Configuration can be changed.
  • Linter can be removed.
  • Errors can be fixed as well, since there are some deprecated things (k8s.io/utils/pointer and grpc.WithInsecure).

Also made all k8s imports in form like corev1.

add golangci job

Signed-off-by: ultram4rine <ultramarine730@gmail.com>
Signed-off-by: ultram4rine <ultramarine730@gmail.com>
Signed-off-by: ultram4rine <ultramarine730@gmail.com>
Signed-off-by: ultram4rine <ultramarine730@gmail.com>
Signed-off-by: ultram4rine <ultramarine730@gmail.com>
@ultram4rine ultram4rine requested review from a team as code owners May 5, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Upgrade kubebuilder project from go.kubebuilder.io/v3 to v4
1 participant