From 66cd0bc522fb4757c7b4c664edcc5b422273bcb3 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Mon, 26 Feb 2024 19:35:52 +0100 Subject: [PATCH] Apply suggestions from code review --- library/common/templates/class/cert-manager/_certificate.tpl | 3 ++- library/common/templates/class/cnpg/_backup.tpl | 3 ++- library/common/templates/class/cnpg/_cluster.tpl | 3 ++- library/common/templates/class/cnpg/_pooler.tpl | 3 ++- library/common/templates/class/cnpg/_scheduledBackup.tpl | 3 ++- library/common/templates/class/metrics/_podMonitor.tpl | 3 +-- library/common/templates/class/metrics/_prometheusRule.tpl | 3 +-- library/common/templates/class/metrics/_serviceMonitor.tpl | 2 +- .../common/templates/class/velero/_backupStorageLocation.tpl | 3 ++- library/common/templates/class/velero/_schedule.tpl | 3 ++- .../common/templates/class/velero/_volumeSnapshotLocation.tpl | 3 ++- 11 files changed, 19 insertions(+), 13 deletions(-) diff --git a/library/common/templates/class/cert-manager/_certificate.tpl b/library/common/templates/class/cert-manager/_certificate.tpl index 1ffc5271..3169318c 100644 --- a/library/common/templates/class/cert-manager/_certificate.tpl +++ b/library/common/templates/class/cert-manager/_certificate.tpl @@ -14,7 +14,8 @@ objectData: {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "ertificates.cert-manager.io" "missing" "Cert-Manager") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "ertificates.cert-manager.io" "missing" "Cert-Manager") }} + --- apiVersion: cert-manager.io/v1 kind: Certificate diff --git a/library/common/templates/class/cnpg/_backup.tpl b/library/common/templates/class/cnpg/_backup.tpl index 103fbf63..af6fc1c9 100644 --- a/library/common/templates/class/cnpg/_backup.tpl +++ b/library/common/templates/class/cnpg/_backup.tpl @@ -18,7 +18,8 @@ {{- $backupAnnotations := $objectData.backupAnnotations | default dict -}} {{- $backupAnnotations = mustMerge $backupAnnotations $objAnnotations $globalBackupAnnotations }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backups.postgresql.cnpg.io" "missing" "CloudNative-PG") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backups.postgresql.cnpg.io" "missing" "CloudNative-PG") }} + --- apiVersion: postgresql.cnpg.io/v1 kind: Backup diff --git a/library/common/templates/class/cnpg/_cluster.tpl b/library/common/templates/class/cnpg/_cluster.tpl index b3285276..0eb6c2a0 100644 --- a/library/common/templates/class/cnpg/_cluster.tpl +++ b/library/common/templates/class/cnpg/_cluster.tpl @@ -123,7 +123,8 @@ {{- $walSize = . -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "clusters.postgresql.cnpg.io" "missing" "CloudNative-PG") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "clusters.postgresql.cnpg.io" "missing" "CloudNative-PG") }} + --- apiVersion: postgresql.cnpg.io/v1 kind: Cluster diff --git a/library/common/templates/class/cnpg/_pooler.tpl b/library/common/templates/class/cnpg/_pooler.tpl index 3aa8ed5e..0bb0ae0c 100644 --- a/library/common/templates/class/cnpg/_pooler.tpl +++ b/library/common/templates/class/cnpg/_pooler.tpl @@ -22,7 +22,8 @@ {{- $instances = 0 -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "poolers.postgresql.cnpg.io" "missing" "CloudNative-PG") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "poolers.postgresql.cnpg.io" "missing" "CloudNative-PG") }} + --- apiVersion: postgresql.cnpg.io/v1 kind: Pooler diff --git a/library/common/templates/class/cnpg/_scheduledBackup.tpl b/library/common/templates/class/cnpg/_scheduledBackup.tpl index 62ce2a3f..5804f0f1 100644 --- a/library/common/templates/class/cnpg/_scheduledBackup.tpl +++ b/library/common/templates/class/cnpg/_scheduledBackup.tpl @@ -31,7 +31,8 @@ {{- $immediate = $objectData.schedData.immediate -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "scheduledbackups.postgresql.cnpg.io" "missing" "CloudNative-PG") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "scheduledbackups.postgresql.cnpg.io" "missing" "CloudNative-PG") }} + --- apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup diff --git a/library/common/templates/class/metrics/_podMonitor.tpl b/library/common/templates/class/metrics/_podMonitor.tpl index c95c0b48..c5fbbe2c 100644 --- a/library/common/templates/class/metrics/_podMonitor.tpl +++ b/library/common/templates/class/metrics/_podMonitor.tpl @@ -15,9 +15,8 @@ {{- $podmonitorName = printf "%v-%v" $podmonitorName $values.nameOverride -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "podmonitors.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "podmonitors.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") }} - --- apiVersion: {{ include "tc.v1.common.capabilities.podmonitor.apiVersion" $ }} kind: PodMonitor diff --git a/library/common/templates/class/metrics/_prometheusRule.tpl b/library/common/templates/class/metrics/_prometheusRule.tpl index 8b3f3619..fd5a7d68 100644 --- a/library/common/templates/class/metrics/_prometheusRule.tpl +++ b/library/common/templates/class/metrics/_prometheusRule.tpl @@ -15,8 +15,7 @@ {{- $prometheusruleName = printf "%v-%v" $prometheusruleName $values.nameOverride -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "prometheusrules.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") -}} - + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "prometheusrules.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") }} --- apiVersion: {{ include "tc.v1.common.capabilities.prometheusrule.apiVersion" $ }} diff --git a/library/common/templates/class/metrics/_serviceMonitor.tpl b/library/common/templates/class/metrics/_serviceMonitor.tpl index b4f2eea1..5c06c3f9 100644 --- a/library/common/templates/class/metrics/_serviceMonitor.tpl +++ b/library/common/templates/class/metrics/_serviceMonitor.tpl @@ -15,7 +15,7 @@ {{- $servicemonitorName = printf "%v-%v" $servicemonitorName $values.nameOverride -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "servicemonitors.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "servicemonitors.monitoring.coreos.com" "missing" "Grafana-Agent-Operator or Prometheus-Operator") }} --- apiVersion: {{ include "tc.v1.common.capabilities.servicemonitor.apiVersion" $ }} diff --git a/library/common/templates/class/velero/_backupStorageLocation.tpl b/library/common/templates/class/velero/_backupStorageLocation.tpl index b8da4d73..cec6dc0b 100644 --- a/library/common/templates/class/velero/_backupStorageLocation.tpl +++ b/library/common/templates/class/velero/_backupStorageLocation.tpl @@ -15,7 +15,8 @@ objectData: {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backupstoragelocations.velero.io" "missing" "Velero") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "backupstoragelocations.velero.io" "missing" "Velero") }} + --- apiVersion: velero.io/v1 kind: BackupStorageLocation diff --git a/library/common/templates/class/velero/_schedule.tpl b/library/common/templates/class/velero/_schedule.tpl index 1b59de34..6a7f5144 100644 --- a/library/common/templates/class/velero/_schedule.tpl +++ b/library/common/templates/class/velero/_schedule.tpl @@ -26,7 +26,8 @@ objectData: {{- $namespace = ($lookupBSL.items | first).metadata.namespace -}} {{- end }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "schedules.velero.io" "missing" "Velero") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "schedules.velero.io" "missing" "Velero") }} + --- apiVersion: velero.io/v1 kind: Schedule diff --git a/library/common/templates/class/velero/_volumeSnapshotLocation.tpl b/library/common/templates/class/velero/_volumeSnapshotLocation.tpl index 5ede9006..90ada42b 100644 --- a/library/common/templates/class/velero/_volumeSnapshotLocation.tpl +++ b/library/common/templates/class/velero/_volumeSnapshotLocation.tpl @@ -15,7 +15,8 @@ objectData: {{- $rootCtx := .rootCtx -}} {{- $objectData := .objectData }} - {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "volumesnapshotlocations.velero.io" "missing" "Velero") -}} + {{- include "tc.v1.common.lib.util.verifycrd" (dict "crd" "volumesnapshotlocations.velero.io" "missing" "Velero") }} + --- apiVersion: velero.io/v1 kind: VolumeSnapshotLocation