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

Kubebuilder go/v4 plugin does create expected folder structure #3154

Closed
Sijoma opened this issue Jan 11, 2023 · 4 comments
Closed

Kubebuilder go/v4 plugin does create expected folder structure #3154

Sijoma opened this issue Jan 11, 2023 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@Sijoma
Copy link
Contributor

Sijoma commented Jan 11, 2023

What broke? What's expected?

The folder layout is not working as expected when using the go/v4-alpha plugin.

Note the "api" folder is still named "apis" and there is no internal folder for the controllers.

image

Another notable things why it broke first was that I had missing "--" copied from the kubebuilder book. PR to fix this is here: #3153

However, I cannot make the new folder structure work.

Reproducing this issue

kubebuilder init --domain my.domain --plugins=go/v4-alpha

kubebuilder edit --multigroup=true --plugins=go/v4-alpha

kubebuilder create api --group group --version v1alpha1 --kind MyKind --namespaced=false --plugins=go/v4-alpha

KubeBuilder (CLI) Version

Version: main.version{KubeBuilderVersion:“3.8.0”, KubernetesVendor:“unknown”, GitCommit:“184ff7465947ced153b031db8de297a778cecf36”, BuildDate:“2022-12-02T15:43:53Z”, GoOs:“darwin”, GoArch:“arm64"}

PROJECT version

New project

Plugin versions

domain: mydomain 
layout:
- go.kubebuilder.io/v4-alpha
multigroup: true
projectName: projectName
repo: github.com/org/repo
resources:
- api:
    crdVersion: v1
  controller: true
  domain: mydomain 
  group: mygroup
  kind: MyKind
  path: github.com/org/repo/apis/mygroup/v1alpha1
  version: v1alpha1
version: "3"

Other versions

go version go1.19.4 darwin/arm64

go env:

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/simon/Library/Caches/go-build"
GOENV="/Users/simon/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/simon/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/simon/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.19.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.19.4/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dc/dtv0j9t138db5fn4sf9q1dvw0000gn/T/go-build3768419948=/tmp/go-build -gno-record-gcc-switches -fno-common"

Extra Labels

No response

@Sijoma Sijoma added the kind/bug Categorizes issue or PR as related to a bug. label Jan 11, 2023
@camilamacedo86
Copy link
Member

camilamacedo86 commented Jan 11, 2023

Hi @Sijoma,

You are using the master branch. The master branch has a breaking change for the go/v4-alpha plugin : #2985

If you are using the master branch and you have a project that was scaffolded before then, you need to manually change the layout with the steps: https://github.com/camilamacedo86/kubebuilder/blob/05761309d74c1fd5216db629b791af55c47099bf/docs/book/src/migration/manually_migration_guide_gov3_to_gov4.md#migrate-the-layout-version-into-the-project-file

When we do a new release we will need to add the info as well in the release notes.

Note that the next step will be stabilize the alpha plugin and then we will no longer able to introduce breaking changes for the go/v4-alpha. it will become to be go/v4 only and at some point the default layout.

@Sijoma
Copy link
Contributor Author

Sijoma commented Jan 11, 2023

I was actually trying to do the migration by creating a new project (see reproduction steps). I think that was also mentioned in the documentation.

Should it work there?

Sidenote: I was a bit suprised that its the master branch build (used install steps of the documentation and I saw the version number 3.8.0).

@camilamacedo86
Copy link
Member

Hi @Sijoma,

So, let's step by step. Following the comments inline.

I was actually trying to do the migration by creating a new project (see reproduction steps). I think that was also mentioned in the documentation.

The link that I passed is from master branch it is NOT published yet.

The version 3.8.0 released does not have the changes #2985 and the doc also does not have this info, see: https://book.kubebuilder.io/migration/v3vsv4.html

Note the "api" folder is still named "apis" and there is no internal folder for the controllers.

If you are using the release 3.8.0 then the changes done in.the PR #2985 are not there. I would recommend wait the next release it will be done soon OR use master branch if you wish.

@Sijoma
Copy link
Contributor Author

Sijoma commented Jan 11, 2023

Ahh thanks @camilamacedo86 now I got it. Appreciate that you took the time to explain it 👍 .

So I guess all good and the issue can be closed.

@Sijoma Sijoma closed this as completed Jan 11, 2023
@Sijoma Sijoma closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants