Skip to content

Commit

Permalink
Revert "initial"
Browse files Browse the repository at this point in the history
This reverts commit a27c44f.
  • Loading branch information
ekampf committed Dec 15, 2023
1 parent eb7a089 commit 87cbdc2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 67 deletions.
20 changes: 0 additions & 20 deletions deploy/twingate-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,3 @@ Create the name of the service account to use
{{- default "twingate-operator" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Get the Secret object name
*/}}
{{- define "twingate-operator.secretName" -}}
{{- if .Values.twingateOperator.existingAPIKeySecret -}}
{{- printf "%s" (tpl .Values.twingateOperator.existingAPIKeySecret.name $) -}}
{{- else -}}
{{- default (include "twingate-operator.fullname" .) -}}
{{- end -}}

{{/*
Get the Secret object apikey key
*/}}
{{- define "twingate-operator.secretApiKey" -}}
{{- if .Values.twingateOperator.existingAPIKeySecret -}}
{{- printf "%s" (tpl .Values.twingateOperator.existingAPIKeySecret.key $) -}}
{{- else -}}
{{- printf "TWINGATE_API_KEY" -}}
{{- end -}}
9 changes: 4 additions & 5 deletions deploy/twingate-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ spec:
- "--verbose"
- "--liveness=http://0.0.0.0:8080/healthz"
- "--log-format={{ $logFormat }}"
envFrom:
- secretRef:
name: {{ include "twingate-operator.fullname" . }}
optional: false
env:
- name: TWINGATE_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "twingate-operator.secretName" }}
key: {{ include "twingate-operator.secretApiKey" }}
- name: TWINGATE_NETWORK
value: {{ required "Network name required" .Values.twingateOperator.network }}
- name: TWINGATE_HOST
Expand Down
6 changes: 2 additions & 4 deletions deploy/twingate-operator/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{{- if not .Values.twingateOperator.existingAPIKeySecret -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "twingate-operator.secretName" . }}
name: {{ include "twingate-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "twingate-operator.labels" . | nindent 4 }}
data:
{{ include "twingate-operator.secretApiKey" }}: {{ required "API Key required" .Values.twingateOperator.apiKey | b64enc }}
{{- end -}}
TWINGATE_API_KEY: {{ required "API Key required" .Values.twingateOperator.apiKey | b64enc }}
36 changes: 1 addition & 35 deletions deploy/twingate-operator/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,9 @@
"type": "object",
"default": {},
"title": "The twingateOperator Schema",
"oneOf": [
{
"required": ["apiKey", "network", "remoteNetworkId"]
},
{
"required": ["existingSecret", "network", "remoteNetworkId"]
}
],
"required": ["apiKey", "network", "remoteNetworkId"],
"properties": {
"apiKey": { "type": "string" },
"existingAPIKeySecret": {
"type": "object",
"title": "An existing secret with the API Key to be used by the operator. If this is specified, the apiKey field will be ignored.",
"required": ["name", "key"],
"properties": {
"name": {
"type": "string",
"default": "",
"title": "The name of the Secret object",
"examples": [
"twingate-operator"
]
},
"key": {
"type": "string",
"default": "",
"title": "The key for the API Key value in the Secret object",
"examples": [
"TWINGATE_API_KEY"
]
}
},
"examples": [{
"name": "twingate-operator",
"key": "apiKey"
}]
},
"network": { "type": "string" },
"remoteNetworkId": { "type": "string" },
"logFormat": {
Expand Down
3 changes: 0 additions & 3 deletions deploy/twingate-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

twingateOperator: {}
# apiKey: "<api key>"
# existingAPIKeySecret:
# name: my-secret
# key: TWINGATE_API_KEY
# network: "<network slug>"
# remoteNetworkId: "<remote network id>"
# logFormat: "plain|full|json"
Expand Down

0 comments on commit 87cbdc2

Please sign in to comment.