From 4643db3af469262997374ff0555123e79c2b2330 Mon Sep 17 00:00:00 2001 From: Nick Marti Date: Wed, 9 Aug 2023 16:22:45 +0200 Subject: [PATCH] Ensure writeConnectionSecretToRef is always set This commit will ensure that every resource's `spec.writeConnectionSecretToRef.name` is set (to a default value of `serviceName+"-creds"`). Resolves: APPX-88 Signed-off-by: Manuel Hutter --- main.go | 4 ++- tests/golden/exoKafka.json | 1 + tests/golden/exoKafka/default.yaml | 3 ++- tests/golden/exoKafka/jsonInput.yaml | 3 ++- tests/golden/exoKafka/parameters.yaml | 3 ++- tests/golden/exoKafka/secret-ref.yaml | 20 ++++++++++++++ tests/golden/exoKafka/unset.yaml | 3 ++- tests/golden/exoMySQL.json | 1 + tests/golden/exoMySQL/default.yaml | 3 ++- tests/golden/exoMySQL/jsonInput.yaml | 3 ++- tests/golden/exoMySQL/parameters.yaml | 3 ++- tests/golden/exoMySQL/secret-ref.yaml | 22 ++++++++++++++++ tests/golden/exoMySQL/unset.yaml | 3 ++- tests/golden/exoOpenSearch.json | 1 + tests/golden/exoOpenSearch/default.yaml | 3 ++- tests/golden/exoOpenSearch/jsonInput.yaml | 3 ++- tests/golden/exoOpenSearch/parameters.yaml | 3 ++- tests/golden/exoOpenSearch/secret-ref.yaml | 22 ++++++++++++++++ tests/golden/exoOpenSearch/unset.yaml | 3 ++- tests/golden/exoPostgreSQL.json | 1 + tests/golden/exoPostgreSQL/default.yaml | 3 ++- tests/golden/exoPostgreSQL/jsonInput.yaml | 3 ++- tests/golden/exoPostgreSQL/parameters.yaml | 3 ++- tests/golden/exoPostgreSQL/secret-ref.yaml | 22 ++++++++++++++++ tests/golden/exoPostgreSQL/unset.yaml | 3 ++- tests/golden/exoRedis.json | 1 + tests/golden/exoRedis/default.yaml | 3 ++- tests/golden/exoRedis/jsonInput.yaml | 3 ++- tests/golden/exoRedis/parameters.yaml | 3 ++- tests/golden/exoRedis/secret-ref.yaml | 18 +++++++++++++ tests/golden/exoRedis/unset.yaml | 3 ++- tests/golden/vshnPostgreSQL.json | 1 + tests/golden/vshnPostgreSQL/default.yaml | 3 ++- tests/golden/vshnPostgreSQL/jsonInput.yaml | 3 ++- tests/golden/vshnPostgreSQL/parameters.yaml | 3 ++- tests/golden/vshnPostgreSQL/secret-ref.yaml | 29 +++++++++++++++++++++ tests/golden/vshnPostgreSQL/unset.yaml | 3 ++- tests/golden/vshnRedis.json | 1 + tests/golden/vshnRedis/default.yaml | 3 ++- tests/golden/vshnRedis/jsonInput.yaml | 3 ++- tests/golden/vshnRedis/secret-ref.yaml | 23 ++++++++++++++++ tests/golden/vshnRedis/unset.yaml | 3 ++- 42 files changed, 220 insertions(+), 28 deletions(-) create mode 100644 tests/golden/exoKafka/secret-ref.yaml create mode 100644 tests/golden/exoMySQL/secret-ref.yaml create mode 100644 tests/golden/exoOpenSearch/secret-ref.yaml create mode 100644 tests/golden/exoPostgreSQL/secret-ref.yaml create mode 100644 tests/golden/exoRedis/secret-ref.yaml create mode 100644 tests/golden/vshnPostgreSQL/secret-ref.yaml create mode 100644 tests/golden/vshnRedis/secret-ref.yaml diff --git a/main.go b/main.go index 352fd61..a31a150 100644 --- a/main.go +++ b/main.go @@ -86,9 +86,11 @@ func Main(apps applications.AppMap, args []string, out io.Writer) int { printUsage(args[0], apps) return 1 } - ////appcat-cli serviceKind + service := app.GetDefault() parameters = append(parameters, util.Input{ParameterHierarchy: []string{"ObjectMeta", "Name"}, Value: resourceName, Unset: false}) + parameters = append([]util.Input{{ParameterHierarchy: []string{"Spec", "WriteConnectionSecretToRef", "Name"}, Value: resourceName + "-creds", Unset: false}}, parameters...) + _, err = util.DecorateType(service, parameters) if err != nil { logrus.Errorf("failed setting parameters: %s", err) diff --git a/tests/golden/exoKafka.json b/tests/golden/exoKafka.json index e79a185..2d42d36 100644 --- a/tests/golden/exoKafka.json +++ b/tests/golden/exoKafka.json @@ -1,6 +1,7 @@ { "default": "kafka-default --kind ExoscaleKafka", "parameters": "kafka-parameters --kind ExoscaleKafka --spec.parameters.maintenance.dayOfWeek=monday --spec.parameters.service.zone ch-fr-1 --spec.parameters.size.plan enterprise-large", + "secret-ref": "kafka-secret-ref --kind ExoscaleKafka --spec.writeconnectionsecrettoref.name new-cred", "unset": "kafka-unset --kind ExoscaleKafka --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-", "jsonInput": "kafka-jsonInput --kind ExoscaleKafka --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}" } diff --git a/tests/golden/exoKafka/default.yaml b/tests/golden/exoKafka/default.yaml index 424f7f7..5a57bae 100644 --- a/tests/golden/exoKafka/default.yaml +++ b/tests/golden/exoKafka/default.yaml @@ -15,5 +15,6 @@ spec: zone: ch-dk-2 size: plan: startup-2 - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: kafka-default-creds status: {} diff --git a/tests/golden/exoKafka/jsonInput.yaml b/tests/golden/exoKafka/jsonInput.yaml index 6ec67ca..e852720 100644 --- a/tests/golden/exoKafka/jsonInput.yaml +++ b/tests/golden/exoKafka/jsonInput.yaml @@ -14,5 +14,6 @@ spec: zone: ch-fr-99 size: plan: '{"Foo":"Bar"}' - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: kafka-jsonInput-creds status: {} diff --git a/tests/golden/exoKafka/parameters.yaml b/tests/golden/exoKafka/parameters.yaml index 6a9d3b9..b8ec4cf 100644 --- a/tests/golden/exoKafka/parameters.yaml +++ b/tests/golden/exoKafka/parameters.yaml @@ -15,5 +15,6 @@ spec: zone: ch-fr-1 size: plan: enterprise-large - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: kafka-parameters-creds status: {} diff --git a/tests/golden/exoKafka/secret-ref.yaml b/tests/golden/exoKafka/secret-ref.yaml new file mode 100644 index 0000000..2b7cdc1 --- /dev/null +++ b/tests/golden/exoKafka/secret-ref.yaml @@ -0,0 +1,20 @@ +apiVersion: exoscale.appcat.vshn.io/v1 +kind: ExoscaleKafka +metadata: + creationTimestamp: null + name: kafka-secret-ref +spec: + parameters: + maintenance: + dayOfWeek: sunday + timeOfDay: "00:00:00" + network: {} + service: + kafkaSettings: null + version: 3.4.0 + zone: ch-dk-2 + size: + plan: startup-2 + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/exoKafka/unset.yaml b/tests/golden/exoKafka/unset.yaml index 81ea452..272dcdf 100644 --- a/tests/golden/exoKafka/unset.yaml +++ b/tests/golden/exoKafka/unset.yaml @@ -11,5 +11,6 @@ spec: service: kafkaSettings: null size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: kafka-unset-creds status: {} diff --git a/tests/golden/exoMySQL.json b/tests/golden/exoMySQL.json index 9eeef44..c237b98 100644 --- a/tests/golden/exoMySQL.json +++ b/tests/golden/exoMySQL.json @@ -1,6 +1,7 @@ { "default": "mysql-default --kind ExoscaleMySQL", "parameters": "mysql-parameters --kind ExoscaleMySQL --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.maintenance.dayOfWeek monday --spec.parameters.service.majorVersion 9999", + "secret-ref": "mysql-secret-ref --kind ExoscaleMySQL --spec.writeconnectionsecrettoref.name new-cred", "unset": "mysql-unset --kind ExoscaleMySQL --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-", "jsonInput": "mysql-jsonInput --kind ExoscaleMySQL --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}" } diff --git a/tests/golden/exoMySQL/default.yaml b/tests/golden/exoMySQL/default.yaml index c73794c..620532a 100644 --- a/tests/golden/exoMySQL/default.yaml +++ b/tests/golden/exoMySQL/default.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: hobbyist-2 - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: mysql-default-creds status: {} diff --git a/tests/golden/exoMySQL/jsonInput.yaml b/tests/golden/exoMySQL/jsonInput.yaml index 2751e4d..409017a 100644 --- a/tests/golden/exoMySQL/jsonInput.yaml +++ b/tests/golden/exoMySQL/jsonInput.yaml @@ -16,5 +16,6 @@ spec: zone: ch-fr-99 size: plan: '{"Foo":"Bar"}' - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: mysql-jsonInput-creds status: {} diff --git a/tests/golden/exoMySQL/parameters.yaml b/tests/golden/exoMySQL/parameters.yaml index 7daa035..5bdd1aa 100644 --- a/tests/golden/exoMySQL/parameters.yaml +++ b/tests/golden/exoMySQL/parameters.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: hobbyist-2 - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: mysql-parameters-creds status: {} diff --git a/tests/golden/exoMySQL/secret-ref.yaml b/tests/golden/exoMySQL/secret-ref.yaml new file mode 100644 index 0000000..cb011b2 --- /dev/null +++ b/tests/golden/exoMySQL/secret-ref.yaml @@ -0,0 +1,22 @@ +apiVersion: exoscale.appcat.vshn.io/v1 +kind: ExoscaleMySQL +metadata: + creationTimestamp: null + name: mysql-secret-ref +spec: + parameters: + backup: + timeOfDay: "12:00:00" + maintenance: + dayOfWeek: sunday + timeOfDay: "00:00:00" + network: {} + service: + majorVersion: "8" + mysqlSettings: null + zone: ch-dk-2 + size: + plan: hobbyist-2 + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/exoMySQL/unset.yaml b/tests/golden/exoMySQL/unset.yaml index 1074592..848f140 100644 --- a/tests/golden/exoMySQL/unset.yaml +++ b/tests/golden/exoMySQL/unset.yaml @@ -13,5 +13,6 @@ spec: service: mysqlSettings: null size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: mysql-unset-creds status: {} diff --git a/tests/golden/exoOpenSearch.json b/tests/golden/exoOpenSearch.json index 89e992f..72ac672 100644 --- a/tests/golden/exoOpenSearch.json +++ b/tests/golden/exoOpenSearch.json @@ -1,5 +1,6 @@ { "default": "opensearch-default --kind ExoscaleOpenSearch", + "secret-ref": "opensearch-secret-ref --kind ExoscaleOpenSearch --spec.writeconnectionsecrettoref.name new-cred", "parameters": "opensearch-parameters --kind ExoscaleOpenSearch --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.size.plan enterprise-large --spec.parameters.service.majorVersion 9999", "unset": "opensearch-unset --kind ExoscaleOpenSearch --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-", "jsonInput": "opensearch-jsonInput --kind ExoscaleOpenSearch --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}" diff --git a/tests/golden/exoOpenSearch/default.yaml b/tests/golden/exoOpenSearch/default.yaml index 83ed16c..9eb7f5a 100644 --- a/tests/golden/exoOpenSearch/default.yaml +++ b/tests/golden/exoOpenSearch/default.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: hobbyist-2 - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: opensearch-default-creds status: {} diff --git a/tests/golden/exoOpenSearch/jsonInput.yaml b/tests/golden/exoOpenSearch/jsonInput.yaml index 7c8ea5a..d9e1255 100644 --- a/tests/golden/exoOpenSearch/jsonInput.yaml +++ b/tests/golden/exoOpenSearch/jsonInput.yaml @@ -16,5 +16,6 @@ spec: zone: ch-fr-99 size: plan: '{"Foo":"Bar"}' - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: opensearch-jsonInput-creds status: {} diff --git a/tests/golden/exoOpenSearch/parameters.yaml b/tests/golden/exoOpenSearch/parameters.yaml index fbf7a90..688ab49 100644 --- a/tests/golden/exoOpenSearch/parameters.yaml +++ b/tests/golden/exoOpenSearch/parameters.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: enterprise-large - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: opensearch-parameters-creds status: {} diff --git a/tests/golden/exoOpenSearch/secret-ref.yaml b/tests/golden/exoOpenSearch/secret-ref.yaml new file mode 100644 index 0000000..47d4679 --- /dev/null +++ b/tests/golden/exoOpenSearch/secret-ref.yaml @@ -0,0 +1,22 @@ +apiVersion: exoscale.appcat.vshn.io/v1 +kind: ExoscaleOpenSearch +metadata: + creationTimestamp: null + name: opensearch-secret-ref +spec: + parameters: + backup: + timeOfDay: "12:00:00" + maintenance: + dayOfWeek: sunday + timeOfDay: "00:00:00" + network: {} + service: + majorVersion: "2" + opensearchSettings: null + zone: ch-dk-2 + size: + plan: hobbyist-2 + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/exoOpenSearch/unset.yaml b/tests/golden/exoOpenSearch/unset.yaml index 7981759..d409359 100644 --- a/tests/golden/exoOpenSearch/unset.yaml +++ b/tests/golden/exoOpenSearch/unset.yaml @@ -13,5 +13,6 @@ spec: service: opensearchSettings: null size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: opensearch-unset-creds status: {} diff --git a/tests/golden/exoPostgreSQL.json b/tests/golden/exoPostgreSQL.json index c86005b..ffa8d9f 100644 --- a/tests/golden/exoPostgreSQL.json +++ b/tests/golden/exoPostgreSQL.json @@ -1,5 +1,6 @@ { "default": "postgres-default --kind ExoscalePostgreSQL", + "secret-ref": "postgres-secret-ref --kind ExoscalePostgreSQL --spec.writeconnectionsecrettoref.name new-cred", "parameters": "postgres-parameters --kind ExoscalePostgreSQL --spec.parameters.backup.timeOfDay=24:00:00 --spec.parameters.service.majorVersion 13 --spec.parameters.size.plan enterprise-large", "unset": "postgres-unset --kind ExoscalePostgreSQL --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.size.plan-", "jsonInput": "postgres-jsonInput --kind ExoscalePostgreSQL --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}" diff --git a/tests/golden/exoPostgreSQL/default.yaml b/tests/golden/exoPostgreSQL/default.yaml index 44e96fe..101ae0b 100644 --- a/tests/golden/exoPostgreSQL/default.yaml +++ b/tests/golden/exoPostgreSQL/default.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: hobbyist-2 - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-default-creds status: {} diff --git a/tests/golden/exoPostgreSQL/jsonInput.yaml b/tests/golden/exoPostgreSQL/jsonInput.yaml index 54eb09a..a48ec8c 100644 --- a/tests/golden/exoPostgreSQL/jsonInput.yaml +++ b/tests/golden/exoPostgreSQL/jsonInput.yaml @@ -16,5 +16,6 @@ spec: zone: ch-fr-99 size: plan: '{"Foo":"Bar"}' - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-jsonInput-creds status: {} diff --git a/tests/golden/exoPostgreSQL/parameters.yaml b/tests/golden/exoPostgreSQL/parameters.yaml index e657f8e..098727f 100644 --- a/tests/golden/exoPostgreSQL/parameters.yaml +++ b/tests/golden/exoPostgreSQL/parameters.yaml @@ -17,5 +17,6 @@ spec: zone: ch-dk-2 size: plan: enterprise-large - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-parameters-creds status: {} diff --git a/tests/golden/exoPostgreSQL/secret-ref.yaml b/tests/golden/exoPostgreSQL/secret-ref.yaml new file mode 100644 index 0000000..ba6bfb7 --- /dev/null +++ b/tests/golden/exoPostgreSQL/secret-ref.yaml @@ -0,0 +1,22 @@ +apiVersion: exoscale.appcat.vshn.io/v1 +kind: ExoscalePostgreSQL +metadata: + creationTimestamp: null + name: postgres-secret-ref +spec: + parameters: + backup: + timeOfDay: "12:00:00" + maintenance: + dayOfWeek: sunday + timeOfDay: "00:00:00" + network: {} + service: + majorVersion: "15" + pgSettings: null + zone: ch-dk-2 + size: + plan: hobbyist-2 + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/exoPostgreSQL/unset.yaml b/tests/golden/exoPostgreSQL/unset.yaml index 7c08d25..ec73d24 100644 --- a/tests/golden/exoPostgreSQL/unset.yaml +++ b/tests/golden/exoPostgreSQL/unset.yaml @@ -13,5 +13,6 @@ spec: service: pgSettings: null size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-unset-creds status: {} diff --git a/tests/golden/exoRedis.json b/tests/golden/exoRedis.json index cfa0475..af51b3b 100644 --- a/tests/golden/exoRedis.json +++ b/tests/golden/exoRedis.json @@ -1,5 +1,6 @@ { "default": "redis-default --kind ExoscaleRedis", + "secret-ref": "redis-secret-ref --kind ExoscaleRedis --spec.writeconnectionsecrettoref.name new-cred", "parameters": "redis-parameters --kind ExoscaleRedis --spec.parameters.size.plan=enterprise-large --spec.parameters.service.zone ch-fr-1 --spec.parameters.maintenance.timeOfDay 24:00:00", "unset": "redis-unset --kind ExoscaleRedis --spec.parameters.maintenance.dayOfWeek- --spec.parameters.service- --spec.parameters.service.redisSettings-", "jsonInput": "redis-jsonInput --kind ExoscaleRedis --spec.parameters.maintenance={\"DayOfWeek\":\"monday\",\"TimeOfDay\":\"00:00:00\"} --spec.parameters.service {\"Zone\":\"ch-fr-99\"} --spec.parameters.size.plan {\"Foo\":\"Bar\"}" diff --git a/tests/golden/exoRedis/default.yaml b/tests/golden/exoRedis/default.yaml index 39519c5..8e78ea8 100644 --- a/tests/golden/exoRedis/default.yaml +++ b/tests/golden/exoRedis/default.yaml @@ -13,5 +13,6 @@ spec: redisSettings: null zone: ch-dk-2 size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-default-creds status: {} diff --git a/tests/golden/exoRedis/jsonInput.yaml b/tests/golden/exoRedis/jsonInput.yaml index 2207601..e2f8f77 100644 --- a/tests/golden/exoRedis/jsonInput.yaml +++ b/tests/golden/exoRedis/jsonInput.yaml @@ -14,5 +14,6 @@ spec: zone: ch-fr-99 size: plan: '{"Foo":"Bar"}' - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-jsonInput-creds status: {} diff --git a/tests/golden/exoRedis/parameters.yaml b/tests/golden/exoRedis/parameters.yaml index 7c4243c..27dcee5 100644 --- a/tests/golden/exoRedis/parameters.yaml +++ b/tests/golden/exoRedis/parameters.yaml @@ -14,5 +14,6 @@ spec: zone: ch-fr-1 size: plan: enterprise-large - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-parameters-creds status: {} diff --git a/tests/golden/exoRedis/secret-ref.yaml b/tests/golden/exoRedis/secret-ref.yaml new file mode 100644 index 0000000..ded06ee --- /dev/null +++ b/tests/golden/exoRedis/secret-ref.yaml @@ -0,0 +1,18 @@ +apiVersion: exoscale.appcat.vshn.io/v1 +kind: ExoscaleRedis +metadata: + creationTimestamp: null + name: redis-secret-ref +spec: + parameters: + maintenance: + dayOfWeek: sunday + timeOfDay: "00:00:00" + network: {} + service: + redisSettings: null + zone: ch-dk-2 + size: {} + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/exoRedis/unset.yaml b/tests/golden/exoRedis/unset.yaml index 3b281f5..36be5ad 100644 --- a/tests/golden/exoRedis/unset.yaml +++ b/tests/golden/exoRedis/unset.yaml @@ -11,5 +11,6 @@ spec: service: redisSettings: null size: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-unset-creds status: {} diff --git a/tests/golden/vshnPostgreSQL.json b/tests/golden/vshnPostgreSQL.json index 8d0121c..d1ce2b7 100644 --- a/tests/golden/vshnPostgreSQL.json +++ b/tests/golden/vshnPostgreSQL.json @@ -1,5 +1,6 @@ { "default": "postgres-default --kind VSHNPostgreSQL", + "secret-ref": "postgres-secret-ref --kind VSHNPostgreSQL --spec.writeconnectionsecrettoref.name new-cred", "parameters": "postgres-parameters --kind VSHNPostgreSQL --spec.parameters.backup.retention=9999 --spec.parameters.backup.schedule \"1 1 1 1 1\" --spec.parameters.size.CPU 100000m", "unset": "postgres-unset --kind VSHNPostgreSQL --spec.parameters.size.disk- --spec.parameters.service- --spec.parameters.scheduling.nodeSelector-", "jsonInput": "postgres-jsonInput --kind VSHNPostgreSQL --spec.parameters.size={\"cpu\":\"99999m\",\"Memory\":\"9999Gi\",\"disk\":\"9999Gi\",\"Requests\":{\"Memory\":\"9999Gi\"}} --spec.parameters.scheduling.nodeSelector {\"appuio.io/node-class\":\"testing\"} --spec.parameters.backup.schedule {\"Foo\":\"Bar\"}" diff --git a/tests/golden/vshnPostgreSQL/default.yaml b/tests/golden/vshnPostgreSQL/default.yaml index 1de2ab8..c2b3b8e 100644 --- a/tests/golden/vshnPostgreSQL/default.yaml +++ b/tests/golden/vshnPostgreSQL/default.yaml @@ -24,5 +24,6 @@ spec: requests: cpu: 300m memory: 1000Mi - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-default-creds status: {} diff --git a/tests/golden/vshnPostgreSQL/jsonInput.yaml b/tests/golden/vshnPostgreSQL/jsonInput.yaml index 3308e5a..0454aca 100644 --- a/tests/golden/vshnPostgreSQL/jsonInput.yaml +++ b/tests/golden/vshnPostgreSQL/jsonInput.yaml @@ -23,5 +23,6 @@ spec: memory: 9999Gi requests: memory: 9999Gi - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-jsonInput-creds status: {} diff --git a/tests/golden/vshnPostgreSQL/parameters.yaml b/tests/golden/vshnPostgreSQL/parameters.yaml index 6230efc..5273231 100644 --- a/tests/golden/vshnPostgreSQL/parameters.yaml +++ b/tests/golden/vshnPostgreSQL/parameters.yaml @@ -24,5 +24,6 @@ spec: requests: cpu: 300m memory: 1000Mi - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-parameters-creds status: {} diff --git a/tests/golden/vshnPostgreSQL/secret-ref.yaml b/tests/golden/vshnPostgreSQL/secret-ref.yaml new file mode 100644 index 0000000..867c753 --- /dev/null +++ b/tests/golden/vshnPostgreSQL/secret-ref.yaml @@ -0,0 +1,29 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNPostgreSQL +metadata: + creationTimestamp: null + name: postgres-secret-ref +spec: + parameters: + backup: + retention: 12 + schedule: 30 23 * * * + maintenance: {} + network: {} + restore: {} + scheduling: + nodeSelector: + appuio.io/node-class: plus + service: + majorVersion: "15" + pgSettings: null + size: + cpu: 600m + disk: 80Gi + memory: 3500Mi + requests: + cpu: 300m + memory: 1000Mi + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/vshnPostgreSQL/unset.yaml b/tests/golden/vshnPostgreSQL/unset.yaml index cd5aa78..47579ed 100644 --- a/tests/golden/vshnPostgreSQL/unset.yaml +++ b/tests/golden/vshnPostgreSQL/unset.yaml @@ -20,5 +20,6 @@ spec: requests: cpu: 300m memory: 1000Mi - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: postgres-unset-creds status: {} diff --git a/tests/golden/vshnRedis.json b/tests/golden/vshnRedis.json index 9fd7446..636c9a4 100644 --- a/tests/golden/vshnRedis.json +++ b/tests/golden/vshnRedis.json @@ -1,5 +1,6 @@ { "default": "redis-default --kind VSHNRedis", + "secret-ref": "redis-secret-ref --kind VSHNRedis --spec.writeconnectionsecrettoref.name new-cred", "parameters": "redis-parameters --kind VSHNRedis --spec.writeConnectionSecretToRef.Name=redisSecret --spec.parameters.tls.tlsauthClients false --spec.parameters.tls.tlsenabled false --spec.parameters.service.version 9999", "unset": "redis-unset --kind VSHNRedis --spec.parameters.size.disk- --spec.parameters.tls- --spec.parameters.service.redisSettings-", "jsonInput": "redis-jsonInput --kind VSHNRedis --spec.parameters.size={\"cpuLimits\":\"99999m\",\"memoryLimits\":\"9999Gi\"} --spec.parameters.service {\"redisSettings\":\"| activedefrag no\"} --spec.parameters.service.version {\"Foo\":\"Bar\"}" diff --git a/tests/golden/vshnRedis/default.yaml b/tests/golden/vshnRedis/default.yaml index e2c9f55..ceaa2e3 100644 --- a/tests/golden/vshnRedis/default.yaml +++ b/tests/golden/vshnRedis/default.yaml @@ -18,5 +18,6 @@ spec: tls: authClients: true enabled: true - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-default-creds status: {} diff --git a/tests/golden/vshnRedis/jsonInput.yaml b/tests/golden/vshnRedis/jsonInput.yaml index 367018c..096773e 100644 --- a/tests/golden/vshnRedis/jsonInput.yaml +++ b/tests/golden/vshnRedis/jsonInput.yaml @@ -15,5 +15,6 @@ spec: tls: authClients: true enabled: true - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-jsonInput-creds status: {} diff --git a/tests/golden/vshnRedis/secret-ref.yaml b/tests/golden/vshnRedis/secret-ref.yaml new file mode 100644 index 0000000..71cf92d --- /dev/null +++ b/tests/golden/vshnRedis/secret-ref.yaml @@ -0,0 +1,23 @@ +apiVersion: vshn.appcat.vshn.io/v1 +kind: VSHNRedis +metadata: + creationTimestamp: null + name: redis-secret-ref +spec: + parameters: + scheduling: {} + service: + redisSettings: '|activedefrag yes' + version: "7.0" + size: + cpuLimits: 1000m + cpuRequests: 500m + disk: 80Gi + memoryLimits: 1Gi + memoryRequests: 500Mi + tls: + authClients: true + enabled: true + writeConnectionSecretToRef: + name: new-cred +status: {} diff --git a/tests/golden/vshnRedis/unset.yaml b/tests/golden/vshnRedis/unset.yaml index 3a0c1e9..e2e67cd 100644 --- a/tests/golden/vshnRedis/unset.yaml +++ b/tests/golden/vshnRedis/unset.yaml @@ -14,5 +14,6 @@ spec: memoryLimits: 1Gi memoryRequests: 500Mi tls: {} - writeConnectionSecretToRef: {} + writeConnectionSecretToRef: + name: redis-unset-creds status: {}