Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hereon Helm Chart
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HCDC
Software Templates
Hereon Helm Chart
Commits
6bfebb46
Verified
Commit
6bfebb46
authored
1 year ago
by
Philipp S. Sommer
Browse files
Options
Downloads
Patches
Plain Diff
only check the volumes mounted in the cronjob for podAffinity
parent
4075fdb8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#266317
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
{{cookiecutter.project_slug}}/templates/{{cookiecutter.template_base_name}}/helpers/cronjobs/_spec.tpl
+8
-10
8 additions, 10 deletions
...kiecutter.template_base_name}}/helpers/cronjobs/_spec.tpl
with
8 additions
and
10 deletions
{{cookiecutter.project_slug}}/templates/{{cookiecutter.template_base_name}}/helpers/cronjobs/_spec.tpl
+
8
−
10
View file @
6bfebb46
...
...
@@ -10,14 +10,14 @@
{%- raw %}
{{- /* due to scoping we need to use a dict for requiredPodAffinity and override the value if necessary */}}
{{- $requiredPodAffinity := dict "isRequired" false }}
{{-
$builtinVolumes := include "{% endraw %}{{ cookiecutter.template_base_name }}{% raw %}.builtinVolumes" . | fromYaml
}}
{{-
$allVolumes := mustMergeOverwrite (dict) $builtinVolumes .Values
.volumes }}
{{- range $name, $options := $allVolumes
}}
{{-
/* Check the necessity of podAffinity */
}}
{{-
if and (not $options.projected) (hasKey $options "
accessModes
")
}}
{{-
range $options.accessModes
}}
{{- if eq . "ReadWriteOnce"
}}
{{-
$_ := set $requiredPodAffinity "isRequired" true
}}
{{-
if .volumes
}}
{{-
range $name, $options :=
.volumes }}
{{- /* Check the necessity of podAffinity */
}}
{{-
if and (not $options.projected) (hasKey $options "accessModes")
}}
{{-
range $options.
accessModes }}
{{-
if eq . "ReadWriteOnce"
}}
{{- $_ := set $requiredPodAffinity "isRequired" true
}}
{{-
end
}}
{{- end }}
{{- end }}
{{- end }}
...
...
@@ -33,7 +33,6 @@ jobTemplate:
parent: {%raw %}{{ .name | quote }}{% endraw %}
spec:
{%- if cookiecutter.__include_volume != 'no' %}
{%- raw %}{{- if .volumes }}{%- endraw %}
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
...
...
@@ -44,7 +43,6 @@ jobTemplate:
{{ "{{-" }} include "{{ cookiecutter.template_base_name }}.selectorLabels" $ | nindent 20 {{ "}}" }}
topologyKey: kubernetes.io/hostname
{% raw %}{{- end }}{% endraw %}
{%- raw %}{{- end }}{%- endraw %}
{%- endif %}
containers:
- name: {%raw %}{{ .name | quote }}{% endraw %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment