Skip to content
This repository has been archived by the owner on Jan 21, 2025. It is now read-only.

Commit

Permalink
feat: imagepullpolicy to IfNotPresent
Browse files Browse the repository at this point in the history
Signed-off-by: Armin Schlegel <[email protected]>
  • Loading branch information
siredmar committed Feb 28, 2024
1 parent 0c5ec0e commit 3fb0ac4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ spec:
{\n\t\t\t\t\tmetadata: labels: {\n\t\t\t\t\t\t\"app.kubernetes.io/component\":
context.name\n\t\t\t\t\t\t\"app.kubernetes.io/app\": context.appName\n\t\t\t\t\t}\n\t\t\t\t\tspec:
{\n\t\t\t\t\t\ttolerations: predefinedTolerations + parameterTolerations\n\t\t\t\t\t\tcontainers:
[{\n\t\t\t\t\t\t\tname: context.name\n\t\t\t\t\t\t\timage: parameter.image\n\n\t\t\t\t\t\t\tif
parameter[\"imagePullPolicy\"] != _|_ {\n\t\t\t\t\t\t\t\timagePullPolicy:
parameter.imagePullPolicy\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif parameter[\"command\"]
!= _|_ {\n\t\t\t\t\t\t\t\tcommand: parameter.command\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif
[{\n\t\t\t\t\t\t\tname: context.name\n\t\t\t\t\t\t\timage: parameter.image\n\t\t\t\t\t\t\timagePullPolicy:
parameter.imagePullPolicy\n\n\t\t\t\t\t\t\tif parameter[\"command\"] != _|_
{\n\t\t\t\t\t\t\t\tcommand: parameter.command\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif
parameter[\"args\"] != _|_ {\n\t\t\t\t\t\t\t\targs: parameter.args\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif
parameter[\"env\"] != _|_ {\n\t\t\t\t\t\t\t\tenv: parameter.env\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif
parameter[\"ports\"] != _|_ {\n\t\t\t\t\t\t\t\tports: parameter.ports\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresources:
Expand Down Expand Up @@ -62,11 +61,12 @@ spec:
image would you like to use for your application\n\timage: string\n\n\t//
+usage=Specify a list of nodepool selectors\n\tnodepoolSelector: #nodepoolSelector\n\n\t//
+usage=Specify tolerant taint\n\ttolerations?: #tolerations\n\n\t// +usage=Specify
image pull policy for your application\n\timagePullPolicy?: string\n\n\t//
+usage=Specify image pull secrets for your application\n\timagePullSecrets?:
[...string]\n\n\t// +usage=Commands to run in the container\n\tcommand?: [...string]\n\n\t//
+usage=Args to run for the command\n\targs?: [...string]\n\n\t// +usage=Specifies
the SecurityContext of the container\n\tsecurityContext?: {\n\t\t// +usage=AllowPrivilegeEscalation
image pull policy for your application\n\timagePullPolicy: *\"IfNotPresent\"
| \"Always\" | \"Never\"\n\n\t// +usage=Specify image pull secrets for your
application\n\timagePullSecrets?: [...string]\n\n\t// +usage=Commands to run
in the container\n\tcommand?: [...string]\n\n\t// +usage=Args to run for the
command\n\targs?: [...string]\n\n\t// +usage=Specifies the SecurityContext
of the container\n\tsecurityContext?: {\n\t\t// +usage=AllowPrivilegeEscalation
controls whether a process can gain more privileges than its parent process.\n\t\tallowPrivilegeEscalation?:
bool\n\t\t// +uasge=The capabilities to add/drop when running containers.
\n\t\tcapabilities?: {\n\t\t\t// +usage=Added capabilities\n\t\t\tadd?: [...string]\n\t\t\t//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ spec:
\"localhost:\\(parameter.daprGrpcPort)\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname:
\ \"DAPR_HTTP_ADDRESS\"\n\t\t\t\t\tvalue: \"localhost:\\(parameter.daprHttpPort)\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname:
\"NODE_NAME\"\n\t\t\t\t\tvalueFrom: fieldRef: fieldPath: \"spec.nodeName\"\n\t\t\t\t},\n\t\t\t]\n\t\t},\n\t\t\t{\n\t\t\t\tname:
\ \"dapr\"\n\t\t\t\timage: \"daprio/daprd:1.10.5\"\n\t\t\t\tcommand: [\n\t\t\t\t\t\"./daprd\",\n\t\t\t\t\t\"--dapr-grpc-port\",\n\t\t\t\t\t\"\\(parameter.daprGrpcPort)\",\n\t\t\t\t\t\"--components-path\",\n\t\t\t\t\t\"/config\",\n\t\t\t\t\t\"--dapr-http-port\",\n\t\t\t\t\t\"\\(parameter.daprHttpPort)\",\n\t\t\t\t\t\"--app-port\",\n\t\t\t\t\t\"\\(parameter.daprAppPort)\",\n\t\t\t\t\t\"--app-protocol\",\n\t\t\t\t\tparameter.daprProtocol,\n\t\t\t\t\t\"--app-id\",\n\t\t\t\t\tcontext.name,\n\t\t\t\t]\n\t\t\t\tvolumeMounts:
\ \"dapr\"\n\t\t\t\timage: \"daprio/daprd:1.10.5\"\n\t\t\t\timagePullPolicy:
\"IfNotPresent\"\n\t\t\t\tcommand: [\n\t\t\t\t\t\"./daprd\",\n\t\t\t\t\t\"--dapr-grpc-port\",\n\t\t\t\t\t\"\\(parameter.daprGrpcPort)\",\n\t\t\t\t\t\"--components-path\",\n\t\t\t\t\t\"/config\",\n\t\t\t\t\t\"--dapr-http-port\",\n\t\t\t\t\t\"\\(parameter.daprHttpPort)\",\n\t\t\t\t\t\"--app-port\",\n\t\t\t\t\t\"\\(parameter.daprAppPort)\",\n\t\t\t\t\t\"--app-protocol\",\n\t\t\t\t\tparameter.daprProtocol,\n\t\t\t\t\t\"--app-id\",\n\t\t\t\t\tcontext.name,\n\t\t\t\t]\n\t\t\t\tvolumeMounts:
[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"config\" + parameter.network.name
+ \"-\" + parameter.network.user\n\t\t\t\t\t\tmountPath: \"/config/\"\n\t\t\t\t\t\treadOnly:
\ true\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t}]\n\t}\n}\noutputs: \"resiliency-dapr-component\":
Expand Down
7 changes: 2 additions & 5 deletions cue/components/edgefarm-applications.cue
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ template: {
containers: [{
name: context.name
image: parameter.image

if parameter["imagePullPolicy"] != _|_ {
imagePullPolicy: parameter.imagePullPolicy
}
imagePullPolicy: parameter.imagePullPolicy

if parameter["command"] != _|_ {
command: parameter.command
Expand Down Expand Up @@ -188,7 +185,7 @@ template: {
tolerations?: #tolerations

// +usage=Specify image pull policy for your application
imagePullPolicy?: string
imagePullPolicy: *"IfNotPresent" | "Always" | "Never"

// +usage=Specify image pull secrets for your application
imagePullSecrets?: [...string]
Expand Down
1 change: 1 addition & 0 deletions cue/traits/edgefarm-network-trait.cue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ template: {
{
name: "dapr",
image: "daprio/daprd:1.10.5",
imagePullPolicy: "IfNotPresent",
command: [
"./daprd",
"--dapr-grpc-port",
Expand Down
2 changes: 1 addition & 1 deletion manifests/vela-caps/components/edgefarm-applications.yaml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions manifests/vela-caps/traits/edgefarm-network-trait.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ spec:
]
},
{
name: "dapr"
image: "daprio/daprd:1.10.5"
name: "dapr"
image: "daprio/daprd:1.10.5"
imagePullPolicy: "IfNotPresent"
command: [
"./daprd",
"--dapr-grpc-port",
Expand Down

0 comments on commit 3fb0ac4

Please sign in to comment.