no message

This commit is contained in:
Kjeld Schouten
2024-07-02 12:14:15 +02:00
parent 073c785f28
commit 7571b2aa9e
2 changed files with 24 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ command:
{{ end }}
{{ end }}
enabled: true
allServiceAccounts: true
primary: {{ $primarypresent }}
clusterWide: false
rules:
@@ -76,6 +77,26 @@ rules:
- watch
{{- end -}}
{{- define "tc.v1.common.dependencies.volsync.primarywaitsa" -}}
enabled: true
primary: true
{{ end }}
{{- define "tc.v1.common.dependencies.volsync.primarywaitsa.inject" -}}
{{ $primarypresent := false }}
{{- range .values.rbac -}}
{{ if and .enabled .primary }}
{{ $primarypresent = true }}
{{ end }}
{{- if not $primarypresent -}}
{{- $sa := include "tc.v1.common.dependencies.volsync.directwait" $ | fromYaml -}}
{{- $_ := set .Values.serviceAccount "main" $sa -}}
{{ end }}
{{- end -}}
{{- define "tc.v1.common.dependencies.volsync.waitonlysa" -}}
{{/* TODO: if there are pods without SA, implement an SA anyway */}}
{{- end -}}
{{- define "tc.v1.common.lib.deps.volsync.wait" -}}
{{- $volSyncDetect := false -}}
@@ -113,6 +134,7 @@ rules:
{{- $container := include "tc.v1.common.dependencies.volsync.directwait" $ | fromYaml -}}
{{- if $container -}}
{{- range .Values.workload -}}
{{ $_ := set .podSpec.automountServiceAccountToken true }}
{{- if not (hasKey .podSpec "initContainers") -}}
{{- $_ := set .podSpec "initContainers" dict -}}
{{- end -}}

View File

@@ -134,9 +134,11 @@
{{- include "tc.v1.common.class.replicationdestination" (dict "rootCtx" $ "objectData" $objectData "volsyncData" $volsyncData) -}}
{{/* modify PVC if enabled */}}
{{- if eq $volsyncData.copyMethod "Snapshot" -}}
{{- $destname := printf "%s-%s-dest" $objectData.name $volsyncData.name -}}
{{- $datasourceref := dict "kind" "ReplicationDestination" "apiGroup" "volsync.backube" "name" $destname -}}
{{- $_ := set $objectData "dataSourceRef" $datasourceref -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}