move comments to top

This commit is contained in:
Stavros kois
2022-11-20 17:20:50 +02:00
parent 154806f8fc
commit 4fe40bcfc9
9 changed files with 51 additions and 57 deletions

View File

@@ -1,3 +1,5 @@
{{/* Workloads = Deployment, ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, etc */}}
{{/*
These annotations will be shared on all objects
Rendered under ".metadata.annotations"
@@ -27,5 +29,3 @@ Rendered under ".metadata.annotations"
{{- define "ix.v1.common.annotations.workload" -}}
rollme: {{ randAlphaNum 5 | quote }}
{{- end -}}
{{/* Workloads = Deployment, ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, etc */}}

View File

@@ -1,3 +1,10 @@
{{/*
A custom dict is expected with args, extraArgs and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}
{{/* Args included by the container */}}
{{- define "ix.v1.common.container.args" -}}
{{- $args := .args -}}
@@ -18,11 +25,3 @@
{{- end }}
{{- end }}
{{- end -}}
{{/*
A custom dict is expected with args, extraArgs and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}

View File

@@ -1,3 +1,10 @@
{{/*
A custom dict is expected with commands and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}
{{/* Command included by the container */}}
{{- define "ix.v1.common.container.command" -}}
{{- $commands := .commands -}}
@@ -10,11 +17,3 @@
{{- end }}
{{- end }}
{{- end -}}
{{/*
A custom dict is expected with commands and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}

View File

@@ -1,3 +1,11 @@
{{/*
A custom dict is expected with envList and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}
{{/* Environment Variables List included by the container */}}
{{- define "ix.v1.common.container.envFrom" -}}
{{- $envFrom := .envFrom -}}
@@ -18,11 +26,3 @@
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
A custom dict is expected with envList and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}

View File

@@ -1,3 +1,10 @@
{{/*
A custom dict is expected with envs and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}
{{/* Environment Variables included by the container */}}
{{- define "ix.v1.common.container.envVars" -}}
{{- $envs := .envs -}}
@@ -67,11 +74,3 @@
{{- end -}}
{{- end -}} {{/* Finish envList */}}
{{- end -}}
{{/*
A custom dict is expected with envs and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}

View File

@@ -1,3 +1,8 @@
{{/*
If no targetPort is given, default to port.
This is for cases where port (that container listens)
can be dynamically configured via an env var.
*/}}
{{/* Ports included by the container. */}}
{{- define "ix.v1.common.container.ports" -}}
{{ $ports := list }}
@@ -37,9 +42,3 @@
{{- end }}
{{- end -}}
{{- end -}}
{{/*
If no targetPort is given, default to port.
This is for cases where port (that container listens)
can be dynamically configured via an env var.
*/}}

View File

@@ -1,4 +1,12 @@
{{/* The main container included in the controller */}}
{{/*
The "tpl (toYaml somepath) $" is used to expand template content (if any)
Cases like this are when we set these values on another tpl file with template
On some includes we pass a dict with the "root" and some other values.
This is because this named function relies on those two, to specify it's context.
So it can work on multiple places, like additional containers and not only the main container.
*/}}
{{- define "ix.v1.common.controller.mainContainer" -}}
- name: {{ include "ix.v1.common.names.fullname" . }}
image: {{ include "ix.v1.common.images.selector" . }}
@@ -52,13 +60,3 @@
{{- . | nindent 4 }}
{{- end -}}
{{- end -}}
{{/*
The "tpl (toYaml somepath) $" is used to expand template content (if any)
Cases like this are when we set these values on another tpl file with template
*/}}
{{/*
On some includes we pass a dict with the "root" and some other values.
This is because this named function relies on those two, to specify it's context.
So it can work on multiple places, like additional containers and not only the main container.
*/}}

View File

@@ -1,3 +1,9 @@
{{/*
For emptyDir:
If the `SizeMemoryBackedVolumes` feature gate is enabled,
you can specify a size for memory backed volumes.
*/}}
{{/* Volumes included by the controller. */}}
{{- define "ix.v1.common.controller.volumes" -}}
{{- $persistenceDefault := "pvc" -}}
@@ -81,9 +87,3 @@
{{- end }}
{{- end }}
{{- end }}
{{/*
For emptyDir:
If the `SizeMemoryBackedVolumes` feature gate is enabled,
you can specify a size for memory backed volumes.
*/}}

View File

@@ -1,3 +1,4 @@
{{/* A dict containing .values and .serviceName is passed when this function is called */}}
{{/* Return the primary port for a given Service object. */}}
{{- define "ix.v1.common.lib.util.service.ports.primary" -}}
{{- $enabledPorts := dict -}}
@@ -29,4 +30,3 @@
{{- $result -}}
{{- end -}}
{{/* A dict containing .values and .serviceName is passed when this function is called */}}