Fix up CRD generation #1307
Fix up CRD generation #1307
Conversation
done | ||
|
||
mv ${TEMP_CRDS_YAML} ./charts/kubefed/charts/controllermanager/crds/crds.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line that fixes the generation issue (other changes in this file are either cosmetic or to ensure specific version of controller-gen is used in all environments).
shortNames: | ||
- rsp | ||
singular: replicaschedulingpreference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This proves that generation is working correctly now. This was manually added incorrectly (bad key ordering) in #1279 and because the generated CRDs were never moved to the correct location, validation didn't pick up on this.
@@ -47,17 +47,18 @@ fi | |||
rm -f ./config/crds/*.yaml | |||
|
|||
# Generate CRD manifest files | |||
command -v controller-gen &> /dev/null || (cd ${ROOT_DIR}/tools && go install sigs.k8s.io/controller-tools/cmd/controller-gen) | |||
controller-gen crd:trivialVersions=true paths="./pkg/apis/..." output:crd:artifacts:config=config/crds | |||
(cd ${ROOT_DIR}/tools && GOBIN=${ROOT_DIR}/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so a dumb question, how do we ensure the version? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a separate tools module (https://github.com/kubernetes-sigs/kubefed/blob/master/tools/go.mod#L7).
/cc @hectorj2f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hectorj2f, jimmidyson, makkes The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
What this PR does / why we need it:
CRD generation was broken because the script did not copy across the generated CRDs to the correct final location. At the same time as fixing that, I've taken the opportunity to ensure that the specified version of controller-gen is used to ensure we do not have issues caused by different versions of controller-gen causing hard to diagnose conflicts.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Special notes for your reviewer: