From 4571e0ebd357dc8f1290db6370701b0c1d7f11ad Mon Sep 17 00:00:00 2001 From: Ankur Kothiwal <39901181+Ankurk99@users.noreply.github.com> Date: Fri, 2 Aug 2024 05:52:19 +0530 Subject: [PATCH] chore: add document separator to the generated manifests (#3462) Signed-off-by: Ankur Kothiwal Co-authored-by: Ankur Kothiwal Co-authored-by: Rita Zhang --- cmd/build/helmify/main.go | 3 ++- .../gatekeeper/crds/assign-customresourcedefinition.yaml | 1 + .../gatekeeper/crds/assignimage-customresourcedefinition.yaml | 1 + .../crds/assignmetadata-customresourcedefinition.yaml | 1 + .../gatekeeper/crds/config-customresourcedefinition.yaml | 1 + .../crds/constraintpodstatus-customresourcedefinition.yaml | 1 + .../crds/constrainttemplate-customresourcedefinition.yaml | 1 + .../constrainttemplatepodstatus-customresourcedefinition.yaml | 1 + .../crds/expansiontemplate-customresourcedefinition.yaml | 1 + .../expansiontemplatepodstatus-customresourcedefinition.yaml | 1 + .../gatekeeper/crds/modifyset-customresourcedefinition.yaml | 1 + .../crds/mutatorpodstatus-customresourcedefinition.yaml | 1 + .../gatekeeper/crds/provider-customresourcedefinition.yaml | 1 + .../gatekeeper/crds/syncset-customresourcedefinition.yaml | 1 + .../gatekeeper/templates/gatekeeper-admin-serviceaccount.yaml | 1 + .../gatekeeper/templates/gatekeeper-audit-deployment.yaml | 1 + .../templates/gatekeeper-controller-manager-deployment.yaml | 1 + .../gatekeeper-controller-manager-poddisruptionbudget.yaml | 1 + .../templates/gatekeeper-critical-pods-resourcequota.yaml | 1 + .../templates/gatekeeper-manager-role-clusterrole.yaml | 1 + .../gatekeeper/templates/gatekeeper-manager-role-role.yaml | 1 + .../gatekeeper-manager-rolebinding-clusterrolebinding.yaml | 1 + .../templates/gatekeeper-manager-rolebinding-rolebinding.yaml | 1 + ...ing-webhook-configuration-mutatingwebhookconfiguration.yaml | 1 + ...g-webhook-configuration-validatingwebhookconfiguration.yaml | 1 + .../templates/gatekeeper-webhook-server-cert-secret.yaml | 1 + .../templates/gatekeeper-webhook-service-service.yaml | 1 + 27 files changed, 28 insertions(+), 1 deletion(-) diff --git a/cmd/build/helmify/main.go b/cmd/build/helmify/main.go index bf9aefefd6e..90563093da2 100644 --- a/cmd/build/helmify/main.go +++ b/cmd/build/helmify/main.go @@ -168,7 +168,8 @@ func (ks *kindSet) Write() error { fmt.Printf("Writing %s\n", destFile) - if err := os.WriteFile(destFile, []byte(obj), 0o600); err != nil { + addSeparator := "---\n" + obj + if err := os.WriteFile(destFile, []byte(addSeparator), 0o600); err != nil { return err } } diff --git a/manifest_staging/charts/gatekeeper/crds/assign-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/assign-customresourcedefinition.yaml index 9cdb88b82db..d234eaff325 100644 --- a/manifest_staging/charts/gatekeeper/crds/assign-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/assign-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/assignimage-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/assignimage-customresourcedefinition.yaml index 8a206ea3d50..d419e098fa1 100644 --- a/manifest_staging/charts/gatekeeper/crds/assignimage-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/assignimage-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/assignmetadata-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/assignmetadata-customresourcedefinition.yaml index 2c28c1c6d02..6a85ba0cc7f 100644 --- a/manifest_staging/charts/gatekeeper/crds/assignmetadata-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/assignmetadata-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/config-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/config-customresourcedefinition.yaml index 2842c926d05..11a5d922789 100644 --- a/manifest_staging/charts/gatekeeper/crds/config-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/config-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/constraintpodstatus-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/constraintpodstatus-customresourcedefinition.yaml index 566ac21f376..85942c0dbcc 100644 --- a/manifest_staging/charts/gatekeeper/crds/constraintpodstatus-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/constraintpodstatus-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/constrainttemplate-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/constrainttemplate-customresourcedefinition.yaml index 91e2f0b8563..2507c159f74 100644 --- a/manifest_staging/charts/gatekeeper/crds/constrainttemplate-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/constrainttemplate-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/constrainttemplatepodstatus-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/constrainttemplatepodstatus-customresourcedefinition.yaml index f6290d17f7a..2d4bd1c8bf2 100644 --- a/manifest_staging/charts/gatekeeper/crds/constrainttemplatepodstatus-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/constrainttemplatepodstatus-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/expansiontemplate-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/expansiontemplate-customresourcedefinition.yaml index f5838f6e50e..8e84974e398 100644 --- a/manifest_staging/charts/gatekeeper/crds/expansiontemplate-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/expansiontemplate-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/expansiontemplatepodstatus-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/expansiontemplatepodstatus-customresourcedefinition.yaml index 004abaf343d..54d9d5de3b3 100644 --- a/manifest_staging/charts/gatekeeper/crds/expansiontemplatepodstatus-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/expansiontemplatepodstatus-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/modifyset-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/modifyset-customresourcedefinition.yaml index 188197df541..8bb3fd54071 100644 --- a/manifest_staging/charts/gatekeeper/crds/modifyset-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/modifyset-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/mutatorpodstatus-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/mutatorpodstatus-customresourcedefinition.yaml index 931e05e147a..37111692e15 100644 --- a/manifest_staging/charts/gatekeeper/crds/mutatorpodstatus-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/mutatorpodstatus-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/provider-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/provider-customresourcedefinition.yaml index a43e39173ff..901c9cca045 100644 --- a/manifest_staging/charts/gatekeeper/crds/provider-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/provider-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/crds/syncset-customresourcedefinition.yaml b/manifest_staging/charts/gatekeeper/crds/syncset-customresourcedefinition.yaml index 1ef7ce4154e..6f055bff8f5 100644 --- a/manifest_staging/charts/gatekeeper/crds/syncset-customresourcedefinition.yaml +++ b/manifest_staging/charts/gatekeeper/crds/syncset-customresourcedefinition.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-admin-serviceaccount.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-admin-serviceaccount.yaml index 47f58795b14..4fd37c89d5e 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-admin-serviceaccount.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-admin-serviceaccount.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.serviceAccount.gatekeeperAdmin.create }} apiVersion: v1 kind: ServiceAccount diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml index e3c82b851fc..71c7ff28150 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml @@ -1,3 +1,4 @@ +--- {{- if not .Values.disableAudit }} apiVersion: apps/v1 kind: Deployment diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml index 09aff673179..7ed6146a09b 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml index 424f6a67c44..609270a92de 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-poddisruptionbudget.yaml @@ -1,3 +1,4 @@ +--- {{- $v1 := .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}} {{- $v1beta1 := .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" -}} apiVersion: policy/v1{{- if and (not $v1) $v1beta1 -}}beta1{{- end }} diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-critical-pods-resourcequota.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-critical-pods-resourcequota.yaml index 15464636691..356e877bbab 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-critical-pods-resourcequota.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-critical-pods-resourcequota.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.resourceQuota }} apiVersion: v1 kind: ResourceQuota diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-clusterrole.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-clusterrole.yaml index e41f96c9790..a6306b3a285 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-clusterrole.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-clusterrole.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-role.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-role.yaml index 72d7513baaf..0a5eecfa500 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-role.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-role-role.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-clusterrolebinding.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-clusterrolebinding.yaml index 1fb9f6c87a5..3c876bd1e6d 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-clusterrolebinding.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-clusterrolebinding.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-rolebinding.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-rolebinding.yaml index fbe9580d57f..a932d59f6f3 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-rolebinding.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-manager-rolebinding-rolebinding.yaml @@ -1,3 +1,4 @@ +--- {{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml index e23dc839773..6b4821181f1 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml @@ -1,3 +1,4 @@ +--- {{- if not .Values.disableMutation }} apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml index 7b7bb8199cb..d2cdd775a18 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml @@ -1,3 +1,4 @@ +--- {{- if not .Values.disableValidatingWebhook }} apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-server-cert-secret.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-server-cert-secret.yaml index a841780a555..79d331c97ca 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-server-cert-secret.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-server-cert-secret.yaml @@ -1,3 +1,4 @@ +--- {{- if not .Values.externalCertInjection.enabled }} apiVersion: v1 kind: Secret diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-service-service.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-service-service.yaml index 3c0f4453a11..5773f39b3fa 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-service-service.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-webhook-service-service.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Service metadata: