Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Fix up CRD generation #1307

Merged

Conversation

jimmidyson
Copy link
Contributor

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:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 21, 2020
@jimmidyson jimmidyson changed the title Jimmi/fix up crd generation Fix up CRD generation Oct 21, 2020
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 21, 2020
done

mv ${TEMP_CRDS_YAML} ./charts/kubefed/charts/controllermanager/crds/crds.yaml
Copy link
Contributor Author

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
Copy link
Contributor Author

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)

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? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jimmidyson
Copy link
Contributor Author

/cc @hectorj2f

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [hectorj2f,jimmidyson]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit 2d81b2e into kubernetes-retired:master Oct 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants