From 261e2396cbc64d013b4f142f8311b460ef53db47 Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Wed, 1 Feb 2023 02:25:32 +0000 Subject: [PATCH 1/2] docs: fix expansion yaml indentation Signed-off-by: Sertac Ozercan --- website/docs/expansion.md | 48 +++++++++---------- .../version-v3.10.x/expansion.md | 48 +++++++++---------- .../version-v3.11.x/expansion.md | 48 +++++++++---------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/website/docs/expansion.md b/website/docs/expansion.md index b2a419b76c6..89885662aef 100644 --- a/website/docs/expansion.md +++ b/website/docs/expansion.md @@ -196,9 +196,9 @@ metadata: name: expand-deployments spec: applyTo: - - groups: [ "apps" ] - kinds: [ "Deployment" ] - versions: [ "v1" ] + - groups: ["apps"] + kinds: ["Deployment"] + versions: ["v1"] templateSource: "spec.template" generatedGVK: kind: "Pod" @@ -212,15 +212,15 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] match: scope: Namespaced origin: "Generated" kinds: - - apiGroups: ["*"] - kinds: ["Pod"] + - apiGroups: ["*"] + kinds: ["Pod"] location: "spec.containers[name:istio-proxy]" parameters: assign: @@ -229,14 +229,14 @@ spec: imagePullPolicy: IfNotPresent image: docker.io/istio/proxyv2:1.15.0 ports: - - containerPort: 15090 - name: http-envoy-prom - protocol: TCP + - containerPort: 15090 + name: http-envoy-prom + protocol: TCP securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL --- apiVersion: mutations.gatekeeper.sh/v1beta1 kind: ModifySet @@ -245,9 +245,9 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -273,12 +273,12 @@ spec: app: nginx spec: containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 - args: - - "/bin/sh" + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + args: + - "/bin/sh" ``` When expanded, the above configs will produce the following `Pod`: diff --git a/website/versioned_docs/version-v3.10.x/expansion.md b/website/versioned_docs/version-v3.10.x/expansion.md index b2a419b76c6..89885662aef 100644 --- a/website/versioned_docs/version-v3.10.x/expansion.md +++ b/website/versioned_docs/version-v3.10.x/expansion.md @@ -196,9 +196,9 @@ metadata: name: expand-deployments spec: applyTo: - - groups: [ "apps" ] - kinds: [ "Deployment" ] - versions: [ "v1" ] + - groups: ["apps"] + kinds: ["Deployment"] + versions: ["v1"] templateSource: "spec.template" generatedGVK: kind: "Pod" @@ -212,15 +212,15 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] match: scope: Namespaced origin: "Generated" kinds: - - apiGroups: ["*"] - kinds: ["Pod"] + - apiGroups: ["*"] + kinds: ["Pod"] location: "spec.containers[name:istio-proxy]" parameters: assign: @@ -229,14 +229,14 @@ spec: imagePullPolicy: IfNotPresent image: docker.io/istio/proxyv2:1.15.0 ports: - - containerPort: 15090 - name: http-envoy-prom - protocol: TCP + - containerPort: 15090 + name: http-envoy-prom + protocol: TCP securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL --- apiVersion: mutations.gatekeeper.sh/v1beta1 kind: ModifySet @@ -245,9 +245,9 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -273,12 +273,12 @@ spec: app: nginx spec: containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 - args: - - "/bin/sh" + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + args: + - "/bin/sh" ``` When expanded, the above configs will produce the following `Pod`: diff --git a/website/versioned_docs/version-v3.11.x/expansion.md b/website/versioned_docs/version-v3.11.x/expansion.md index b2a419b76c6..89885662aef 100644 --- a/website/versioned_docs/version-v3.11.x/expansion.md +++ b/website/versioned_docs/version-v3.11.x/expansion.md @@ -196,9 +196,9 @@ metadata: name: expand-deployments spec: applyTo: - - groups: [ "apps" ] - kinds: [ "Deployment" ] - versions: [ "v1" ] + - groups: ["apps"] + kinds: ["Deployment"] + versions: ["v1"] templateSource: "spec.template" generatedGVK: kind: "Pod" @@ -212,15 +212,15 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] match: scope: Namespaced origin: "Generated" kinds: - - apiGroups: ["*"] - kinds: ["Pod"] + - apiGroups: ["*"] + kinds: ["Pod"] location: "spec.containers[name:istio-proxy]" parameters: assign: @@ -229,14 +229,14 @@ spec: imagePullPolicy: IfNotPresent image: docker.io/istio/proxyv2:1.15.0 ports: - - containerPort: 15090 - name: http-envoy-prom - protocol: TCP + - containerPort: 15090 + name: http-envoy-prom + protocol: TCP securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL --- apiVersion: mutations.gatekeeper.sh/v1beta1 kind: ModifySet @@ -245,9 +245,9 @@ metadata: spec: source: Generated applyTo: - - groups: [""] - kinds: ["Pod"] - versions: ["v1"] + - groups: [""] + kinds: ["Pod"] + versions: ["v1"] location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -273,12 +273,12 @@ spec: app: nginx spec: containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 - args: - - "/bin/sh" + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 + args: + - "/bin/sh" ``` When expanded, the above configs will produce the following `Pod`: From c9f584435a988af7728033b2c8bb279cc62c7d14 Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Wed, 1 Feb 2023 21:36:58 +0000 Subject: [PATCH 2/2] fix syntax Signed-off-by: Sertac Ozercan --- website/docs/expansion.md | 14 +++++++------- .../versioned_docs/version-v3.10.x/expansion.md | 14 +++++++------- .../versioned_docs/version-v3.11.x/expansion.md | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/docs/expansion.md b/website/docs/expansion.md index 89885662aef..ce561c9aa01 100644 --- a/website/docs/expansion.md +++ b/website/docs/expansion.md @@ -93,7 +93,7 @@ Here is an example of a `ExpansionTemplate` that specifies that `DaemonSet`, `Deployment`, `Job`, `ReplicaSet`, `ReplicationController`, and `StatefulSet` should be expanded into a `Pod`. -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -143,7 +143,7 @@ for `fooField` when creating Pods that cannot reasonably be added to the a user could create a Mutation custom resource that modifies expanded resources, like so: -``` +```yaml apiVersion: mutations.gatekeeper.sh/v1alpha1 kind: Assign metadata: @@ -189,7 +189,7 @@ them to only be applied when expanding resources specified by `ExpansionTemplates`. These Mutators will not affect any real resources on the cluster.** -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -210,14 +210,13 @@ kind: Assign metadata: name: add-sidecar spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] match: scope: Namespaced - origin: "Generated" + source: All kinds: - apiGroups: ["*"] kinds: ["Pod"] @@ -243,11 +242,12 @@ kind: ModifySet metadata: name: add-istio-args spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] + match: + source: All location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -283,7 +283,7 @@ spec: When expanded, the above configs will produce the following `Pod`: -``` +```yaml apiVersion: v1 kind: Pod metadata: diff --git a/website/versioned_docs/version-v3.10.x/expansion.md b/website/versioned_docs/version-v3.10.x/expansion.md index 89885662aef..ce561c9aa01 100644 --- a/website/versioned_docs/version-v3.10.x/expansion.md +++ b/website/versioned_docs/version-v3.10.x/expansion.md @@ -93,7 +93,7 @@ Here is an example of a `ExpansionTemplate` that specifies that `DaemonSet`, `Deployment`, `Job`, `ReplicaSet`, `ReplicationController`, and `StatefulSet` should be expanded into a `Pod`. -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -143,7 +143,7 @@ for `fooField` when creating Pods that cannot reasonably be added to the a user could create a Mutation custom resource that modifies expanded resources, like so: -``` +```yaml apiVersion: mutations.gatekeeper.sh/v1alpha1 kind: Assign metadata: @@ -189,7 +189,7 @@ them to only be applied when expanding resources specified by `ExpansionTemplates`. These Mutators will not affect any real resources on the cluster.** -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -210,14 +210,13 @@ kind: Assign metadata: name: add-sidecar spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] match: scope: Namespaced - origin: "Generated" + source: All kinds: - apiGroups: ["*"] kinds: ["Pod"] @@ -243,11 +242,12 @@ kind: ModifySet metadata: name: add-istio-args spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] + match: + source: All location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -283,7 +283,7 @@ spec: When expanded, the above configs will produce the following `Pod`: -``` +```yaml apiVersion: v1 kind: Pod metadata: diff --git a/website/versioned_docs/version-v3.11.x/expansion.md b/website/versioned_docs/version-v3.11.x/expansion.md index 89885662aef..0e9322c3f64 100644 --- a/website/versioned_docs/version-v3.11.x/expansion.md +++ b/website/versioned_docs/version-v3.11.x/expansion.md @@ -93,7 +93,7 @@ Here is an example of a `ExpansionTemplate` that specifies that `DaemonSet`, `Deployment`, `Job`, `ReplicaSet`, `ReplicationController`, and `StatefulSet` should be expanded into a `Pod`. -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -189,7 +189,7 @@ them to only be applied when expanding resources specified by `ExpansionTemplates`. These Mutators will not affect any real resources on the cluster.** -``` +```yaml apiVersion: expansion.gatekeeper.sh/v1alpha1 kind: ExpansionTemplate metadata: @@ -210,14 +210,13 @@ kind: Assign metadata: name: add-sidecar spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] match: scope: Namespaced - origin: "Generated" + source: All kinds: - apiGroups: ["*"] kinds: ["Pod"] @@ -243,11 +242,12 @@ kind: ModifySet metadata: name: add-istio-args spec: - source: Generated applyTo: - groups: [""] kinds: ["Pod"] versions: ["v1"] + match: + source: All location: "spec.containers[name:istio-proxy].args" parameters: operation: merge @@ -283,7 +283,7 @@ spec: When expanded, the above configs will produce the following `Pod`: -``` +```yaml apiVersion: v1 kind: Pod metadata: