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

Upgrade layout from Kubebuilder v2 to Kubebuilder v3.1 #147

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

wenchajun
Copy link
Member

Follow https://book.kubebuilder.io/migration/v2vsv3.html to upgrade fluentbit-operator

Signed-off-by: root [email protected]

@wenchajun wenchajun force-pushed the v3 branch 5 times, most recently from 0cfde06 to 156c821 Compare September 28, 2021 08:13
@zhu733756
Copy link
Member

zhu733756 commented Oct 9, 2021

Can you add some simple descriptions of the upgrade steps? Since the changed files are huge to have a look at.

@wenchajun
Copy link
Member Author

Follow https://book.kubebuilder.io/migration/v2vsv3.html to upgrade fluentbit-operator.
There are mainly the following points:

  • v3 projects use Go modules and request Go 1.15+. Dep is no longer supported for dependency management.
  • The PROJECT file now has a new layout. It stores more information about what resources are in use, to better enable plugins to make useful decisions when scaffolding.
  • Use apiextensions/v1 for generated CRDs (apiextensions/v1beta1 was deprecated in Kubernetes 1.16)
  • The manager flags --metrics-addr and enable-leader-election now are named --metrics-bind-address and --leader-elect to be more aligned with core Kubernetes Components.
  • Liveness and Readiness probes are now added by default using healthz.Ping
  • A new option to create the projects using ComponentConfig is introduced. For more info see its enhancement proposal and the Component config tutorial

cd $$TMP_DIR ;\
go mod init tmp ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
Copy link
Member

Choose a reason for hiding this comment

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

Shall we use go install? For more information, see https://golang.org/doc/go-get-install-deprecation

Copy link
Member Author

@wenchajun wenchajun Oct 11, 2021

Choose a reason for hiding this comment

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

It is automatically generated by kubebuilderv3.1.For the sake of uniformity, it may be not to modify.

Copy link
Member

Choose a reason for hiding this comment

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

It is automatically generated by kubebuilderv3.1.For the sake of uniformity, it may be not to modify.

Starting in Go 1.17, installing executables with go get is deprecated. go install may be used instead. However, this case would not block this pr.

@@ -24,11 +25,11 @@ import (
)

var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: "logging.kubesphere.io", Version: "v1alpha2"}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to make these changes. Pls revert it.

Copy link
Member

Choose a reason for hiding this comment

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

See next comment. Need to fix here or api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks,fixed

@zhu733756
Copy link
Member

make vet failed,pls re-check it. Details:

api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8: undefined: v1alpha2.SchemeGroupVersion

@zhu733756
Copy link
Member

zhu733756 commented Oct 9, 2021

make vet failed,pls re-check it. Details:

api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8: undefined: v1alpha2.SchemeGroupVersion

Maybe we need the github-actions-CI test to check it. :)

@benjaminhuo
Copy link
Member

make vet failed,pls re-check it. Details:

api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8: undefined: v1alpha2.SchemeGroupVersion

Maybe we need the github-actions-CI test to check it. :)

@zhu733756 Good point, would you investigate adding CI to this project?

@benjaminhuo benjaminhuo requested a review from nicktate October 11, 2021 02:30
@zhu733756
Copy link
Member

make vet failed,pls re-check it. Details:

api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8: undefined: v1alpha2.SchemeGroupVersion

Maybe we need the github-actions-CI test to check it. :)

@zhu733756 Good point, would you investigate adding CI to this project?

Ok. Later, will post a pr to add it.

@benjaminhuo benjaminhuo requested a review from keladhruv October 11, 2021 02:31
@benjaminhuo
Copy link
Member

benjaminhuo commented Oct 11, 2021

@bojand @keladhruv @nicktate @patrick-stephens We're upgrading kubebuilder to v3.1, you can take a look at this PR and help to review it if you're interested

@zhu733756
Copy link
Member

/lgtm

@zhu733756
Copy link
Member

make vet failed,pls re-check it. Details:

api/generated/clientset/versioned/typed/fluentbitoperator/v1alpha2/fluentbitoperator_client.go:94:8: undefined: v1alpha2.SchemeGroupVersion

Maybe we need the github-actions-CI test to check it. :)

@zhu733756 Good point, would you investigate adding CI to this project?

Makefile changed in pr #152

@benjaminhuo
Copy link
Member

@wenchajun Pls rebase your PR because #152 has been merged.
You may need to adjust the kubebuilder CI installation part because #152 installs the v2.x kubebuilder

@zhu733756
Copy link
Member

zhu733756 commented Oct 13, 2021

@wenchajun Pls rebase your PR because #152 has been merged. You may need to adjust the kubebuilder CI installation part because #152 installs the v2.x kubebuilder

Since v3.0+ kubebuilder not include files like v2.3+, which will lead to the test files like suite_test.go being failed.
Pls consider this case. @wenchajun

See this fix:
kubernetes-sigs/kubebuilder#326 (comment)

@wenchajun wenchajun force-pushed the v3 branch 2 times, most recently from 4ed9080 to 9d0dbdb Compare October 13, 2021 15:05
@@ -37,8 +37,8 @@ jobs:

- name: Install kubebuilder-2.3.2
run: |
curl -L "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.2/kubebuilder_2.3.2_linux_amd64.tar.gz" | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.2_linux_amd64 /usr/local/kubebuilder
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
Copy link
Member

Choose a reason for hiding this comment

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

We'd better use a fixed version instead of latest?

@wenchajun wenchajun force-pushed the v3 branch 2 times, most recently from aec65bb to 2789bd6 Compare October 14, 2021 10:39
@wenchajun
Copy link
Member Author

@wenchajun Pls rebase your PR because #152 has been merged. You may need to adjust the kubebuilder CI installation part because #152 installs the v2.x kubebuilder

Since v3.0+ kubebuilder not include files like v2.3+, which will lead to the test files like suite_test.go being failed. Pls consider this case. @wenchajun

See this fix: kubernetes-sigs/kubebuilder#326 (comment)

Kubebuilderv2 has some differences from v3. The same is true for E2E workflows. Maybe there are some changes here. I modify some E2E files . please review it .

@benjaminhuo
Copy link
Member

@wenchajun #154 has been merged, would you resolve the conflict again?

@benjaminhuo
Copy link
Member

@wenchajun Pls rebase your PR because #152 has been merged. You may need to adjust the kubebuilder CI installation part because #152 installs the v2.x kubebuilder

Since v3.0+ kubebuilder not include files like v2.3+, which will lead to the test files like suite_test.go being failed. Pls consider this case. @wenchajun
See this fix: kubernetes-sigs/kubebuilder#326 (comment)

Kubebuilderv2 has some differences from v3. The same is true for E2E workflows. Maybe there are some changes here. I modify some E2E files . please review it .

@zhu733756 would you review Elon's change

@zhu733756
Copy link
Member

zhu733756 commented Oct 15, 2021

@wenchajun Pls rebase your PR because #152 has been merged. You may need to adjust the kubebuilder CI installation part because #152 installs the v2.x kubebuilder

Since v3.0+ kubebuilder not include files like v2.3+, which will lead to the test files like suite_test.go being failed. Pls consider this case. @wenchajun
See this fix: kubernetes-sigs/kubebuilder#326 (comment)

Kubebuilderv2 has some differences from v3. The same is true for E2E workflows. Maybe there are some changes here. I modify some E2E files . please review it .

@zhu733756 would you review Elon's change

Ok.

@zhu733756
Copy link
Member

zhu733756 commented Oct 15, 2021

/lgtm

See zhu733756#3

@benjaminhuo benjaminhuo merged commit bfe1101 into fluent:master Oct 15, 2021
@wenchajun wenchajun deleted the v3 branch February 14, 2022 06:12
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.

3 participants