From 5caddf6f172d50caf1b1d07d4dddfdeed9ce46d7 Mon Sep 17 00:00:00 2001 From: svatwork Date: Thu, 20 May 2021 12:36:42 +0200 Subject: [PATCH 1/6] chore: modify schema --- values-schema.yaml | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 1365db7312..f53fbc7b54 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1605,28 +1605,16 @@ properties: type: array required: - namespaces - kms: - additionalProperties: false - properties: - sops: - oneOf: - - aws: - $ref: '#/definitions/awsCreds' - required: - - aws - - azure: - $ref: '#/definitions/azureCreds' - required: - - azure - - google: - $ref: '#/definitions/googleCreds' - required: - - google - - vault: - $ref: '#/definitions/vaultCreds' - required: - - vault - type: object + kms: + additionalProperties: false + properties: + sops: + oneOf: + - $ref: '#/definitions/awsCreds' + - $ref: '#/definitions/azureCreds' + - $ref: '#/definitions/googleCreds' + - $ref: '#/definitions/vaultCreds' + type: object oidc: additionalProperties: false description: 'Holds many parts used in different locations. Please see keycloak, istio and oauth-proxy all consuming parts.' From fc0b5f65c45c6fd3b7f86dffe78de113d4a207d5 Mon Sep 17 00:00:00 2001 From: svatwork Date: Thu, 20 May 2021 12:43:23 +0200 Subject: [PATCH 2/6] fix: build should not have additional props --- values-schema.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/values-schema.yaml b/values-schema.yaml index f53fbc7b54..018e5610ff 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1606,7 +1606,6 @@ properties: required: - namespaces kms: - additionalProperties: false properties: sops: oneOf: From b2c1a9dc2a3490c3869163dabedd8bf157a45d2a Mon Sep 17 00:00:00 2001 From: svatwork Date: Thu, 20 May 2021 13:11:16 +0200 Subject: [PATCH 3/6] fix: wrong inline --- values-schema.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 018e5610ff..926d9c1801 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1605,15 +1605,16 @@ properties: type: array required: - namespaces - kms: - properties: - sops: - oneOf: - - $ref: '#/definitions/awsCreds' - - $ref: '#/definitions/azureCreds' - - $ref: '#/definitions/googleCreds' - - $ref: '#/definitions/vaultCreds' - type: object + kms: + additionalProperties: false + properties: + sops: + oneOf: + - $ref: '#/definitions/awsCreds' + - $ref: '#/definitions/azureCreds' + - $ref: '#/definitions/googleCreds' + - $ref: '#/definitions/vaultCreds' + type: object oidc: additionalProperties: false description: 'Holds many parts used in different locations. Please see keycloak, istio and oauth-proxy all consuming parts.' From 412c59553a31471f856e87dd169bb9c49712374f Mon Sep 17 00:00:00 2001 From: svatwork Date: Thu, 20 May 2021 13:12:01 +0200 Subject: [PATCH 4/6] fix: redundant type object --- values-schema.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/values-schema.yaml b/values-schema.yaml index 926d9c1801..1b0b6303f8 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -1614,7 +1614,6 @@ properties: - $ref: '#/definitions/azureCreds' - $ref: '#/definitions/googleCreds' - $ref: '#/definitions/vaultCreds' - type: object oidc: additionalProperties: false description: 'Holds many parts used in different locations. Please see keycloak, istio and oauth-proxy all consuming parts.' From 851e486c0d023a06fc8bd8da6fa7bbc3eeac39d3 Mon Sep 17 00:00:00 2001 From: Jehoszafat Zimnowoda Date: Thu, 20 May 2021 15:10:04 +0200 Subject: [PATCH 5/6] feat: move kms discriminator to the schema --- values-schema.yaml | 68 ++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/values-schema.yaml b/values-schema.yaml index 1b0b6303f8..723fd02ba7 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -66,30 +66,34 @@ definitions: description: A set of annotations. awsCreds: properties: - accessKey: - type: string - secretKey: - type: string - region: - type: string - required: - - accessKey - - secretKey - - region + aws: + properties: + accessKey: + type: string + secretKey: + type: string + region: + type: string + required: + - accessKey + - secretKey + - region azureCreds: properties: - clientId: - type: string - clientSecret: - type: string - environment: - type: string - tenantId: - type: string - required: - - clientId - - clientSecret - - tenantId + azure: + properties: + clientId: + type: string + clientSecret: + type: string + environment: + type: string + tenantId: + type: string + required: + - clientId + - clientSecret + - tenantId azureMonitor: properties: appInsightsApiKey: @@ -178,10 +182,12 @@ definitions: title: Environment variables googleCreds: properties: - accountJson: - type: string - project: - type: string + google: + properties: + accountJson: + type: string + project: + type: string hostPort: pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$' type: string @@ -663,10 +669,12 @@ definitions: type: array vaultCreds: properties: - token: - type: string - required: - - token + vault: + properties: + token: + type: string + required: + - token properties: alerts: $ref: '#/definitions/alerts' From fc6dbf2829102419e0e3148724e1f6115c12a245 Mon Sep 17 00:00:00 2001 From: Jehoszafat Zimnowoda Date: Thu, 20 May 2021 15:25:34 +0200 Subject: [PATCH 6/6] feat: add required fields --- profiles/aws/env/secrets.settings.yaml | 2 +- values-schema.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/profiles/aws/env/secrets.settings.yaml b/profiles/aws/env/secrets.settings.yaml index 4b11754650..8b05702ed3 100644 --- a/profiles/aws/env/secrets.settings.yaml +++ b/profiles/aws/env/secrets.settings.yaml @@ -12,7 +12,7 @@ home: kms: sops: aws: - clientKey: somesecretvalue + accessKey: somesecretvalue secretKey: somesecretvalue region: somesecretvalue oidc: diff --git a/values-schema.yaml b/values-schema.yaml index 723fd02ba7..43237a389b 100644 --- a/values-schema.yaml +++ b/values-schema.yaml @@ -78,6 +78,8 @@ definitions: - accessKey - secretKey - region + required: + - aws azureCreds: properties: azure: @@ -94,6 +96,8 @@ definitions: - clientId - clientSecret - tenantId + required: + - azure azureMonitor: properties: appInsightsApiKey: @@ -188,6 +192,8 @@ definitions: type: string project: type: string + required: + - google hostPort: pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$' type: string @@ -675,6 +681,8 @@ definitions: type: string required: - token + required: + - vault properties: alerts: $ref: '#/definitions/alerts'