Skip to content

Commit 183b646

Browse files
Merge pull request #232 from 1Password/vzt/support-upgrade-using-existing-secret
Make it possible to upgrade connect chart to v2.0.x without providing token value
2 parents b900c19 + 362d8b0 commit 183b646

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

charts/connect/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{- $tokenName := .Values.operator.token.name -}}
44
{{- $serviceAccountTokenName := .Values.operator.serviceAccountToken.name -}}
55

6-
{{- if (and (not (.Values.operator.serviceAccountToken.value)) (not (or (lookup "v1" "Secret" $namespace $credentialsName) (.Values.connect.credentials) ))) }}
6+
{{- if (and (.Values.connect.create) (not (or (lookup "v1" "Secret" $namespace $credentialsName) (.Values.connect.credentials) ))) }}
77
---------------------------------------------------------------------------------------------
88
WARNING
99

charts/connect/templates/operator-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ spec:
7272
value: "{{ .Values.operator.pollingInterval }}"
7373
- name: AUTO_RESTART
7474
value: "{{ .Values.operator.autoRestart }}"
75-
{{- if .Values.operator.serviceAccountToken.value }}
75+
{{- if eq .Values.operator.authMethod "service-account" }}
7676
- name: OP_SERVICE_ACCOUNT_TOKEN
7777
valueFrom:
7878
secretKeyRef:
7979
name: {{ .Values.operator.serviceAccountToken.name }}
8080
key: {{ .Values.operator.serviceAccountToken.key }}
8181
{{- end }}
82-
{{- if .Values.operator.token.value }}
82+
{{- if eq .Values.operator.authMethod "connect" }}
8383
- name: OP_CONNECT_HOST
8484
value: "{{- include "onepassword-connect.url" . }}"
8585
- name: OP_CONNECT_TOKEN

charts/connect/values.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"operator": {
6+
"type": "object",
7+
"properties": {
8+
"authMethod": {
9+
"type": "string",
10+
"enum": ["connect", "service-account"],
11+
"description": "Denotes authentication method that 1Password Operator will use to access 1Password secrets."
12+
}
13+
}
14+
}
15+
}
16+
}

charts/connect/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ operator:
241241
# Denotes whether the 1Password Operator will be deployed
242242
create: false
243243

244+
# Denotes authentication method that 1Password Operator will use to access 1Password secrets
245+
# Valid values:
246+
# - connect: sets OP_CONNECT_HOST and OP_CONNECT_TOKEN
247+
# - service-account: sets OP_SERVICE_ACCOUNT_TOKEN
248+
authMethod: connect
249+
244250
# The number of replicas to run the 1Password Connect Operator deployment
245251
replicas: 1
246252

0 commit comments

Comments
 (0)