Skip to content

Commit

Permalink
fix: validate-templates fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurice Faber committed Oct 11, 2021
1 parent 5c699a6 commit 0fad7f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
38 changes: 17 additions & 21 deletions src/cmd/validate-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,28 +173,24 @@ export const validateTemplates = async (): Promise<void> => {
',',
)} -d ${k8sResourcesPath} --schema-location file://${schemaOutputPath} --kubernetes-version ${k8sVersion}`,
)
const output = kubevalOutput.stdout
.split('\n')
.map((x) => {
const [k, v] = x.split(' - ')
const obj: any = {}
obj[k] = [v]
return obj
})
.reduce((prev, curr) => {
const prevObj = { ...prev }
Object.entries(curr).map(([key, value]: [string, any[]]) => {
const prevArr: any[] = prevObj[key] ?? []
const currArr: any[] = value ?? []
prevObj[key] = [...new Set([...prevArr, ...currArr])]
return key
})
return prevObj
})
output.PASS?.map((_val: string) => debug.debug(`${chalk.greenBright('PASS: ')} ${chalk.italic('%s')}`, _val))
output.WARN?.map((_val: string) => debug.warn(`${chalk.yellowBright('WARN: ')} %s`, _val))
;`${kubevalOutput.stdout}\n${kubevalOutput.stderr}`.split('\n').forEach((x) => {
if (x === '') return
const [k, v] = x.split(' - ')
switch (k) {
case 'PASS':
debug.info(`${chalk.greenBright('PASS: ')} ${chalk.italic('%s')}`, v)
break
case 'WARN':
debug.warn(`${chalk.yellowBright('WARN: ')} %s`, v)
break
case 'ERR ':
debug.error(`${chalk.redBright('ERR: ')} %s`, v)
break
default:
break
}
})
if (kubevalOutput.exitCode !== 0) {
output.ERR?.map((_val: string) => debug.error(`${chalk.redBright('ERR: ')} %s`, _val))
throw new Error('Templating FAILED')
} else debug.log('Templating SUCCESS')
}
Expand Down
7 changes: 0 additions & 7 deletions tpl/chart-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,11 @@ You can also find the complete list of values below:
| `kms.sops.provider` | `string` | | `nil` |
| `kms.sops.vault.keys` | `string` | Comma separated list of one or two paths to keys as defined in Vault. One if used for both enc+dec. Two if one for enc, other for dec. | `nil` |
| `kms.sops.vault.token` | `string` | | `nil` |
| `letsencryptCA` | `string` | | `nil` |
| `letsencryptRootCA` | `string` | | `nil` |
| `oidc.adminGroupID` | `string` | | `nil` |
| `oidc.apiUrl` | `string` | Only used for grafana when Keycloak is disabled. (Not recommended because that disables authorization.) | `nil` |
| `oidc.authUrl` | `string` | Only used for grafana when Keycloak is disabled. (Not recommended because that disables authorization.) | `nil` |
| `oidc.clientID` | `string` | | `nil` |
| `oidc.clientSecret` | `string` | | `nil` |
| `oidc.issuer` | `string` | | `nil` |
| `oidc.scope` | `string` | Default values are used by keycloak. May be overridden in case keycloak is disabled. | `openid email profile` |
| `oidc.teamAdminGroupID` | `string` | | `nil` |
| `oidc.tenantID` | `string` | | `nil` |
| `oidc.tokenUrl` | `string` | | `nil` |
| `oidc.usernameClaimMapper` | `string` | Claim name used by Keycloak to identify incoming users from identity provider | `${CLAIM.email}` |
| `oidc.subClaimMapper` | `string` | Select OIDC claim to be passed by Keycloak as a unique user identifier. Best to not change this from the default. | `sub` |
| `otomi.additionalClusters.[].apiName` | `string` | Only used for API/UI to show in app. | `nil` |
Expand Down
4 changes: 0 additions & 4 deletions values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2121,10 +2121,6 @@ properties:
- token
required:
- vault
letsencryptCA:
type: string
letsencryptRootCA:
type: string
oidc:
additionalProperties: false
description: 'Holds many parts used in different locations. Please see keycloak, grafana, istio and oauth-proxy as those are all consuming (parts of) these settings.'
Expand Down

0 comments on commit 0fad7f2

Please sign in to comment.