Skip to content

Commit

Permalink
Skip mounting volumes, secrets, and configs that are present in multi…
Browse files Browse the repository at this point in the history
…ple connections
  • Loading branch information
polyaxon-ci committed Apr 9, 2024
1 parent dbd5917 commit 3911627
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions agent/templates/partials/_connections.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if $c.secret }}
{{- if (empty $c.secret.mountPath) }}
- secretRef:
Expand All @@ -27,7 +27,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if $c.env }}
{{ toYaml $c.env }}
{{- end }} {{- /* endif */ -}}
Expand All @@ -40,7 +40,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if or (eq $c.kind "host_path") (eq $c.kind "volume_claim") }}
- mountPath: {{ $c.schema.mountPath | quote }}
name: {{ $c.name }}
Expand Down Expand Up @@ -71,8 +71,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}

{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if or (eq $c.kind "host_path") (eq $c.kind "volume_claim") }}
- name: {{ $c.name }}
{{- if eq $c.kind "volume_claim" }}
Expand Down
9 changes: 4 additions & 5 deletions polyaxon/templates/partials/_connections.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if $c.secret }}
{{- if (empty $c.secret.mountPath) }}
- secretRef:
Expand All @@ -27,7 +27,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if $c.env }}
{{ toYaml $c.env }}
{{- end }} {{- /* endif */ -}}
Expand All @@ -40,7 +40,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}
{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if or (eq $c.kind "host_path") (eq $c.kind "volume_claim") }}
- mountPath: {{ $c.schema.mountPath | quote }}
name: {{ $c.name }}
Expand Down Expand Up @@ -71,8 +71,7 @@ Config connections volumes/mounts/secrets/configmap
{{- if and .Values.mountConnections .Values.connections -}}
{{- $context := . -}}
{{- range $c := .Values.connections }}
{{- if has $c.name $context.Values.mountConnections }}

{{- if and (not $c.isAlias) (has $c.name $context.Values.mountConnections) }}
{{- if or (eq $c.kind "host_path") (eq $c.kind "volume_claim") }}
- name: {{ $c.name }}
{{- if eq $c.kind "volume_claim" }}
Expand Down

0 comments on commit 3911627

Please sign in to comment.