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

controller-gen is unable to work with addons projects. #1525

Closed
camilamacedo86 opened this issue May 26, 2020 · 4 comments · Fixed by #1527
Closed

controller-gen is unable to work with addons projects. #1525

camilamacedo86 opened this issue May 26, 2020 · 4 comments · Fixed by #1527
Assignees

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented May 26, 2020

Bug

When addon projects, such as follows are scaffolded, the go mod is updated with the latest version/commit of module kubernetes-sigs
/kubebuilder-declarative-pattern
. The module has not been working with releases/tags and kb is not scaffolding a specific version and then, after the commit/version v0.0.0-20200512162422-ce639cbf6d4c the make targets which are using the controller-gen has been kept stuck.

            export KUBEBUILDER_ENABLE_PLUGINS=1
            $kb create api --group crew --version v1 --kind Captain --controller=true --resource=true --pattern=addon
            $kb create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false --pattern=addon
            $kb create api --group crew --version v1 --kind Admiral --controller=true --resource=true --namespaced=false --make=false --pattern=addon

Notes

  • We should fix the module version in the code to avoid breaking changes
  • It is not the only issue scenario that we have been facing because of the version is not fixed in the go.mod. See that the CI can also break because of it. Add make check-testdata to the prow CI #1503

Suggested Solution

  • For now, we can use replace to fix the problem and be unlocked. Note that it is booking all PR's since will break the CI. However, in the long term run shows that we could think if has any reason for we still keeping the --pattern=addon flag and using it.
@camilamacedo86
Copy link
Member Author

camilamacedo86 commented May 26, 2020

/kind bug

c/c @DirectXMan12 @mengqiy @estroz @hasbro17 @joelanford

@camilamacedo86
Copy link
Member Author

/assign @camilamacedo86

@camilamacedo86
Copy link
Member Author

I am pushing the PR with the fix.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented May 26, 2020

I checked that stuck behaviour:

  • It was related to my local Go cache env. After cleaning it worked.

However, it will break the CI. Any change in the repo will change the go.mod scaffolded by default and also can result in a breaking change which is the same scenario of; #1503 and indeed it can introduce a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant