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

use kubebuilder go/v4 template #236

Merged
merged 8 commits into from
Jan 22, 2024
Merged

use kubebuilder go/v4 template #236

merged 8 commits into from
Jan 22, 2024

Conversation

llamerada-jp
Copy link
Contributor

resolve: #213

@llamerada-jp llamerada-jp marked this pull request as ready for review January 11, 2024 02:32
@llamerada-jp llamerada-jp requested a review from a team as a code owner January 11, 2024 02:32
Copy link
Contributor

@peng225 peng225 left a comment

Choose a reason for hiding this comment

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

  • When I ran go mod tidy on my environment, go.mod and go.sum was changed. Could you check it?
  • Because you deleted config/default/kustomization.yaml, the release procedure should be changed. Now step 2 to 6 can be deleted.

.golangci.yml Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@daichimukai daichimukai left a comment

Choose a reason for hiding this comment

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

I'd like to see separate commits for change set to migrate from kubebuilder go/v3 to go/v4 and those that are not. My understanding is as follows:

What are related:

  • PROJECT file,
  • moving main.go to cmd/main.go and related changes,
  • comment in Dockerfile,
  • part of changes in Makefile.

What are not related:

  • golangci-lint related stuff,
  • part of changes in Dockerfile,
  • CONTRIBUTING.md,
  • moving e2e to test/e2e,
  • removing config and hack,
  • changes in runners, metrics.

It seems that the change in the project layout might affect in our code not only main.go, but also codes for the controller and the webhook. Shouldn't this be addressed?

change the layout to accommodate the community request to follow the Standard Go Project Layout by moving the api(s) under a new directory called api, controller(s) under a new directory called internal and the main.go under a new directory named cmd

https://book.kubebuilder.io/migration/v3vsv4#common-changes

Makefile Outdated Show resolved Hide resolved
@llamerada-jp llamerada-jp force-pushed the use-kubebuilder-go-v4 branch 2 times, most recently from 9de57a6 to 160567a Compare January 15, 2024 02:41
- regenerate PROJECT file
- move main.go to cmd dir
- change codes due to controller-runtime versionup
- add .golangci.yml file generated by kubebuilder command
- apply simple changes to Dockerfile and Makefile

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
@llamerada-jp
Copy link
Contributor Author

@peng225

  • When I ran go mod tidy on my environment, go.mod and go.sum was changed. Could you check it?

It was an incomplete work, so I updated it.

The change was added in the following commit.
37b5c65

@llamerada-jp
Copy link
Contributor Author

llamerada-jp commented Jan 15, 2024

@daichimukai

I'd like to see separate commits for change set to migrate from kubebuilder go/v3 to go/v4 and those that are not. ...

I reworked the split of the commits.

It seems that the change in the project layout might affect in our code not only main.go, but also codes for the controller and the webhook. Shouldn't this be addressed?

Since the official layout was defined differently from the Standard Go Project Layout, I wondered whether I should include it or not. However, the internal/ directory was the same for both, so I changed it. Since there was no specification for constants, I moved it to the top directory in the same as TopoLVM.

hack/boilerplate.go.txt Outdated Show resolved Hide resolved
internal/hooks/persistentvolumeclaim.go Outdated Show resolved Hide resolved
test/e2e/suite_test.go Show resolved Hide resolved
RELEASE.md Outdated Show resolved Hide resolved
`hack/boilerplate.go.txt` file is not generated when execute
`kubebuilder init` command with `--license none` option to keep
the head of each file. And since this project does not use custom
resources, generate-api is not generated either. Therefore, the
related codes are removed.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
In go/v4 template, files related to test except unit test are
generated in `test/` dir, so move e2e to the same dir.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
…aintained

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
…ands

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Since kubebuilder's layout is now Standard Go Project Layout, some
modules have been re-located. Since there is no specification as
to where the constants should be located, they were moved to the
top directory, similar to TopoLVM.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
@daichimukai daichimukai merged commit 118efcc into main Jan 22, 2024
9 checks passed
@daichimukai daichimukai deleted the use-kubebuilder-go-v4 branch January 22, 2024 07:32
llamerada-jp added a commit that referenced this pull request Feb 1, 2024
I mistakenly upgraded to kubernetes v1.29 when applying kubebuilder
go/v4, so I downgraded to v1.28.
ref: #236

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
tropnikovvl pushed a commit to tropnikovvl/pvc-autoresizer that referenced this pull request Feb 4, 2024
I mistakenly upgraded to kubernetes v1.29 when applying kubebuilder
go/v4, so I downgraded to v1.28.
ref: topolvm#236

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>
tropnikovvl pushed a commit to tropnikovvl/pvc-autoresizer that referenced this pull request Feb 5, 2024
parent b0b3861
author ESASHIKA Kaoru <kaoru-esashika@cybozu.co.jp> 1706848848 +0900
committer Vladislav Tropnikov <vladislav.tropnikov@genestack.com> 1707128256 +0100
gpgsig -----BEGIN PGP SIGNATURE-----

 iHUEABYKAB0WIQQmHpo/j4LoqRn/bA7vN/+knMKRrQUCZcC1wAAKCRDvN/+knMKR
 rc/9AQCKVgC1eny4vfTqlMXRsyVPLM9p0BZoBd7Ob+QrVgnYkwEA+yr0d4cE9ous
 Yq/DQbQkqsK4ck9gqfE/6foiHdG23QM=
 =1yTD
 -----END PGP SIGNATURE-----

Merge pull request topolvm#239 from topolvm/bump-chart-0.10.2

Bump chart version to 0.10.2

Bump the github-actions-update group with 2 updates

Bumps the github-actions-update group with 2 updates: [actions/setup-go](https://github.com/actions/setup-go) and [actions/stale](https://github.com/actions/stale).

Updates `actions/setup-go` from 4 to 5
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v4...v5)

Updates `actions/stale` from 8 to 9
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v8...v9)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-update
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-update
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

start to migrate kubebuilder go/v3 to go/v4

- regenerate PROJECT file
- move main.go to cmd dir
- change codes due to controller-runtime versionup
- add .golangci.yml file generated by kubebuilder command
- apply simple changes to Dockerfile and Makefile

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

remove unused boilerplate and target of Makefile

`hack/boilerplate.go.txt` file is not generated when execute
`kubebuilder init` command with `--license none` option to keep
the head of each file. And since this project does not use custom
resources, generate-api is not generated either. Therefore, the
related codes are removed.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

move e2e dir to test/e2e

In go/v4 template, files related to test except unit test are
generated in `test/` dir, so move e2e to the same dir.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

aligned kubebuilder marker

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

remove the manifests below config, since those are neither used nor maintained

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

move some modules to internal dir

Since kubebuilder's layout is now Standard Go Project Layout, some
modules have been re-located. Since there is no specification as
to where the constants should be located, they were moved to the
top directory, similar to TopoLVM.

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

Support Kubernetes v1.28

I mistakenly upgraded to kubernetes v1.29 when applying kubebuilder
go/v4, so I downgraded to v1.28.
ref: topolvm#236

Signed-off-by: Yuji Ito <llamerada.jp@gmail.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

Bump chart version to 0.10.2

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

add support for K8s metrics API as a source of PVC usage data

Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>

Update makefile config

Signed-off-by: Vladislav Tropnikov <vladislav.tropnikov@genestack.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use kubebuilder project v4
3 participants