Skip to content

Commit

Permalink
Merge branch 'master' into root-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
sozercan committed Jun 29, 2021
2 parents 38b48b3 + 60c9781 commit 6a49b58
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ install: manifests

deploy-mutation: patch-image
@grep -q -v 'enable-mutation' ./config/overlays/dev_mutation/manager_image_patch.yaml && sed -i '/- --operation=webhook/a \ \ \ \ \ \ \ \ - --enable-mutation=true' ./config/overlays/dev_mutation/manager_image_patch.yaml && sed -i '/- --operation=status/a \ \ \ \ \ \ \ \ - --operation=mutation-status' ./config/overlays/dev_mutation/manager_image_patch.yaml
kustomize build config/overlays/dev_mutation | kubectl apply -f -
kustomize build --load_restrictor LoadRestrictionsNone config/overlays/dev_mutation | kubectl apply -f -
kustomize build --load_restrictor LoadRestrictionsNone config/overlays/mutation | kubectl apply -f -

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
Expand All @@ -204,7 +204,7 @@ manifests: __controller-gen
mkdir -p manifest_staging/deploy
mkdir -p manifest_staging/charts/gatekeeper
docker run --rm -v $(shell pwd):/gatekeeper --entrypoint /usr/local/bin/kustomize line/kubectl-kustomize:${KUBECTL_KUSTOMIZE_VERSION} build /gatekeeper/config/default -o /gatekeeper/manifest_staging/deploy/gatekeeper.yaml
docker run --rm -v $(shell pwd):/gatekeeper --entrypoint /usr/local/bin/kustomize line/kubectl-kustomize:${KUBECTL_KUSTOMIZE_VERSION} build /gatekeeper/cmd/build/helmify | go run cmd/build/helmify/*.go
docker run --rm -v $(shell pwd):/gatekeeper --entrypoint /usr/local/bin/kustomize line/kubectl-kustomize:${KUBECTL_KUSTOMIZE_VERSION} build --load_restrictor LoadRestrictionsNone /gatekeeper/cmd/build/helmify | go run cmd/build/helmify/*.go

# lint runs a dockerized golangci-lint, and should give consistent results
# across systems.
Expand Down
6 changes: 6 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ resources:
bases:
- ../../vendor/github.com/open-policy-agent/frameworks/constraint/deploy

patches:
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
path: patches/preserve_unknown_fields_false.yaml

patchesStrategicMerge:
#- patches/max_name_size_for_assign.yaml
Expand Down
6 changes: 6 additions & 0 deletions config/crd/patches/preserve_unknown_fields_false.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: foobar
spec:
preserveUnknownFields: false
7 changes: 7 additions & 0 deletions config/overlays/mutation/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ resources:
- ../../crd/bases/mutations.gatekeeper.sh_assignmetadata.yaml
- ../../crd/bases/status.gatekeeper.sh_mutatorpodstatuses.yaml

patches:
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
path: ../../crd/patches/preserve_unknown_fields_false.yaml

patchesJson6902:
- target:
group: apiextensions.k8s.io
Expand Down
6 changes: 6 additions & 0 deletions config/overlays/mutation_webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ resources:
- mutations.gatekeeper.sh_assignmetadata.yaml
- status.gatekeeper.sh_mutatorpodstatuses.yaml

patches:
- target:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
path: ../../crd/patches/preserve_unknown_fields_false.yaml

patchesJson6902:
- target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: AssignList
plural: assign
singular: assign
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: AssignMetadataList
plural: assignmetadata
singular: assignmetadata
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: ConfigList
plural: configs
singular: config
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: ConstraintPodStatusList
plural: constraintpodstatuses
singular: constraintpodstatus
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: ConstraintTemplateList
plural: constrainttemplates
singular: constrainttemplate
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: ConstraintTemplatePodStatusList
plural: constrainttemplatepodstatuses
singular: constrainttemplatepodstatus
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
listKind: MutatorPodStatusList
plural: mutatorpodstatuses
singular: mutatorpodstatus
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
Expand Down
8 changes: 4 additions & 4 deletions manifest_staging/deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
labels:
gatekeeper.sh/system: "yes"
name: configs.config.gatekeeper.sh
Expand All @@ -40,6 +39,7 @@ spec:
listKind: ConfigList
plural: configs
singular: config
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1alpha1
Expand Down Expand Up @@ -139,7 +139,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
labels:
gatekeeper.sh/system: "yes"
name: constraintpodstatuses.status.gatekeeper.sh
Expand All @@ -150,6 +149,7 @@ spec:
listKind: ConstraintPodStatusList
plural: constraintpodstatuses
singular: constraintpodstatus
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
Expand Down Expand Up @@ -213,7 +213,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
labels:
gatekeeper.sh/system: "yes"
name: constrainttemplatepodstatuses.status.gatekeeper.sh
Expand All @@ -224,6 +223,7 @@ spec:
listKind: ConstraintTemplatePodStatusList
plural: constrainttemplatepodstatuses
singular: constrainttemplatepodstatus
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1beta1
Expand Down Expand Up @@ -286,7 +286,6 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
labels:
gatekeeper.sh/system: "yes"
name: constrainttemplates.templates.gatekeeper.sh
Expand All @@ -297,6 +296,7 @@ spec:
listKind: ConstraintTemplateList
plural: constrainttemplates
singular: constrainttemplate
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1alpha1
Expand Down

0 comments on commit 6a49b58

Please sign in to comment.