Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/common/obj-secret-paths.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getSchemaSecretsPaths } from './utils'

describe('object storage credential paths', () => {
it('should classify both halves of the linode credential as secrets', async () => {
// Linode OBJ keys rotate as a pair, so the id has to travel the same route as its secret half:
// into obj-secrets, out via ExternalSecret. Keeping the id in git settings forces a values-repo
// write on every rotation just to keep the pair together.
const secretPaths = await getSchemaSecretsPaths([])

expect(secretPaths).toContain('obj.provider.linode.accessKeyId')
expect(secretPaths).toContain('obj.provider.linode.secretAccessKey')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
namespace: apl-secrets
spec:
encryptedData:
provider_linode_accessKeyId: someaccessKeyId
provider_linode_secretAccessKey: somesecretvalue
template:
immutable: false
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/env/settings/obj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
spec:
provider:
linode:
accessKeyId: someaccessKeyId
buckets:
cnpg: my-clusterid-cnpg
gitea: my-clusterid-gitea
Expand Down
1 change: 1 addition & 0 deletions values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2897,6 +2897,7 @@ properties:
type: string
description: The ID of the access key
$ref: '#/definitions/wordCharacterPattern'
x-secret: ''
secretAccessKey:
type: string
description: The secret of the access key
Expand Down
6 changes: 5 additions & 1 deletion values/gitea/gitea-raw.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ resources:
template:
type: Opaque
data:
S3_STORAGE_ACCOUNT: {{ $obj.linode.accessKeyId }}
S3_STORAGE_ACCOUNT: '{{ "{{ .accessKeyId | toString }}" }}'
S3_STORAGE_KEY: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand Down
12 changes: 10 additions & 2 deletions values/harbor/harbor-raw.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,13 @@ resources:
template:
type: Opaque
data:
S3_STORAGE_ACCOUNT: {{ $obj.linode.accessKeyId }}
S3_STORAGE_ACCOUNT: '{{ "{{ .accessKeyId | toString }}" }}'
S3_STORAGE_KEY: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand All @@ -229,9 +233,13 @@ resources:
template:
type: Opaque
data:
REGISTRY_STORAGE_S3_ACCESSKEY: {{ $obj.linode.accessKeyId }}
REGISTRY_STORAGE_S3_ACCESSKEY: '{{ "{{ .accessKeyId | toString }}" }}'
REGISTRY_STORAGE_S3_SECRETKEY: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand Down
6 changes: 5 additions & 1 deletion values/keycloak/keycloak-raw.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ resources:
template:
type: Opaque
data:
S3_STORAGE_ACCOUNT: {{ $obj.linode.accessKeyId }}
S3_STORAGE_ACCOUNT: '{{ "{{ .accessKeyId | toString }}" }}'
S3_STORAGE_KEY: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand Down
6 changes: 5 additions & 1 deletion values/kubeflow-pipelines/kubeflow-pipelines-raw.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ resources:
template:
type: Opaque
data:
accesskey: {{ $obj.linode.accessKeyId }}
accesskey: '{{ "{{ .accessKeyId | toString }}" }}'
secretkey: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand Down
6 changes: 5 additions & 1 deletion values/loki/loki-raw.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ resources:
template:
type: Opaque
data:
AWS_ACCESS_KEY_ID: {{ $obj.linode.accessKeyId }}
AWS_ACCESS_KEY_ID: '{{ "{{ .accessKeyId | toString }}" }}'
AWS_SECRET_ACCESS_KEY: '{{ "{{ .secretAccessKey | toString }}" }}'
data:
- secretKey: accessKeyId
remoteRef:
key: obj-secrets
property: provider_linode_accessKeyId
- secretKey: secretAccessKey
remoteRef:
key: obj-secrets
Expand Down
Loading