-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerize and upgrade controller-gen to v0.5.0
frameworks/constraint had previously been reliant on an outdated version of the controller-gen library for generating CRDs with embedded JSONSchemas. The older version of the library wasn't built to detect a nested JSONSchema, and thus would not refuse it. With the requirement of v1 CRDs around the corner in k8s 1.22, framework/constraint requires the newer controller-gen v0.5.0. This library version can output v1 CRD. This PR _does not_ output a v1 CRD for Constraint Template. That will be left for a future PR. This PR brings the library up-to-date and dockerizes it, isolating the dependency from the developer machine. Signed-off-by: juliankatz <juliankatz@google.com>
- Loading branch information
1 parent
804ff2e
commit 56ce6ad
Showing
16 changed files
with
97 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.16.3-alpine | ||
|
||
RUN apk add build-base | ||
|
||
# Create a folder in which to mount the code | ||
RUN mkdir /constraint | ||
WORKDIR /constraint | ||
|
||
RUN GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
constraint/config/crds/templates_v1beta1_constrainttemplate.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
# create a multi-version CRD via kustomize because Kubebuilder v1 doesn't support multi-version | ||
# CRDs | ||
# Sets the version: field to `v1beta1`. | ||
# It's not obvious how to do this with kubebuilder annotations. | ||
|
||
resources: | ||
- crds/templates_v1beta1_constrainttemplate.yaml | ||
|
||
patchesStrategicMerge: | ||
- crd_patch.yaml | ||
- crds/templates.gatekeeper.sh_constrainttemplates.yaml | ||
|
||
patches: | ||
- target: | ||
group: apiextensions.k8s.io | ||
version: v1beta1 | ||
kind: CustomResourceDefinition | ||
name: constrainttemplates.templates.gatekeeper.sh | ||
patch: |- | ||
- op: remove | ||
path: /spec/version |
Oops, something went wrong.