Skip to content

Commit

Permalink
Rename secret key to 'token'
Browse files Browse the repository at this point in the history
  • Loading branch information
csp33 committed Sep 14, 2024
1 parent d362c7f commit eb49733
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ helm uninstall cert-manager-duckdns-webhook
### Pushing the image

```shell
export IMAGE_TAG=1.0.0
export IMAGE_TAG=1.0.1
docker buildx build --push --platform linux/arm64,linux/amd64 -t csp33/cert-manager-duckdns-webhook:$IMAGE_TAG -t csp33/cert-manager-duckdns-webhook:latest .;
```

Expand Down
2 changes: 1 addition & 1 deletion charts/cert-manager-duckdns-webhook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.0"
description: Helm Chart for the Cert Manager DuckDNS WebHook
name: cert-manager-duckdns-webhook
version: 1.1.2
version: 1.1.3

maintainers:
- name: csp33
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ metadata:
heritage: {{ .Release.Service }}
type: Opaque
stringData:
api-token: "{{ $.Values.token.value}}"
token: "{{ $.Values.token.value}}"
{{ end }}

2 changes: 1 addition & 1 deletion charts/cert-manager-duckdns-webhook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ clusterIssuer:

token:
value: ~
existingSecretName: "" # Secret must have the token in the `api-token` key
existingSecretName: "" # Secret must have the token in the `token` key

service:
type: ClusterIP
Expand Down
6 changes: 3 additions & 3 deletions src/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestLoadConfig_ValidConfig(t *testing.T) {
Raw: json.RawMessage(`{
"apiTokenSecretRef": {
"name": "my-secret",
"key": "api-token"
"key": "token"
}
}`),
}
Expand All @@ -22,15 +22,15 @@ func TestLoadConfig_ValidConfig(t *testing.T) {

assert.NoError(t, err, "Expected no error for valid config")
assert.Equal(t, "my-secret", cfg.APITokenSecretRef.LocalObjectReference.Name, "Expected API token secret name to match")
assert.Equal(t, "api-token", cfg.APITokenSecretRef.Key, "Expected API token secret key to match")
assert.Equal(t, "token", cfg.APITokenSecretRef.Key, "Expected API token secret key to match")
}

func TestLoadConfig_InvalidConfigName(t *testing.T) {
cfgJSON := &extapi.JSON{
Raw: json.RawMessage(`{
"apiTokenSecretRef": {
"name": "",
"key": "api-token"
"key": "token"
}
}`),
}
Expand Down
2 changes: 1 addition & 1 deletion testdata.example/duckdns-solver/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"apiTokenSecretRef": {
"name": "my-secret",
"key": "api-token"
"key": "token"
}
}
2 changes: 1 addition & 1 deletion testdata.example/duckdns-solver/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Secret
metadata:
name: my-secret
stringData:
api-token: "DUCKDNS_TOKEN"
token: "DUCKDNS_TOKEN"

0 comments on commit eb49733

Please sign in to comment.