-
Notifications
You must be signed in to change notification settings - Fork 2
cache warmup is now run as an init container #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jg/cron-graceful-shutdown
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,14 @@ for key in "${!ENVIRONMENT_VARIABLES[@]}"; do | |||||||||||||
| } | ||||||||||||||
| " "${CONFIGURATION_TARGET_PATH}/deployments/webserver-php-fpm.yaml" | ||||||||||||||
|
|
||||||||||||||
| # Webserver PHP-FPM warmup container | ||||||||||||||
| yq e -i " | ||||||||||||||
| .spec.template.spec.initContainers[1].env[${ITERATOR}] = { | ||||||||||||||
| \"name\": \"${key}\", | ||||||||||||||
| \"value\": \"${ENVIRONMENT_VARIABLES[$key]}\" | ||||||||||||||
|
Comment on lines
+44
to
+46
|
||||||||||||||
| .spec.template.spec.initContainers[1].env[${ITERATOR}] = { | |
| \"name\": \"${key}\", | |
| \"value\": \"${ENVIRONMENT_VARIABLES[$key]}\" | |
| (.spec.template.spec.initContainers[] | select(.name == \"warmup\")).env[${ITERATOR}] = { | |
| \"name\": strenv(YQ_KEY), | |
| \"value\": strenv(YQ_VALUE) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,15 +83,21 @@ spec: | |
| - name: domains-urls | ||
| mountPath: /var/www/html/{{DOMAINS_URLS_FILEPATH}} | ||
| subPath: "{{DOMAINS_URLS_FILENAME}}" | ||
| - name: warmup | ||
| image: "{{TAG}}" | ||
| command: ["/var/www/html/phing", "-S", "warmup"] | ||
| volumeMounts: | ||
| - name: source-codes | ||
| mountPath: /var/www/html | ||
| - name: domains-urls | ||
| mountPath: /var/www/html/{{DOMAINS_URLS_FILEPATH}} | ||
| subPath: "{{DOMAINS_URLS_FILENAME}}" | ||
|
Comment on lines
+86
to
+94
|
||
| containers: | ||
| - image: "{{TAG}}" | ||
| name: php-fpm | ||
| imagePullPolicy: IfNotPresent | ||
| workingDir: /var/www/html | ||
| lifecycle: | ||
| postStart: | ||
| exec: | ||
| command: ["/var/www/html/phing", "-S", "warmup"] | ||
| preStop: | ||
| exec: | ||
| command: ["/bin/sh","-lc","sleep 10; kill -QUIT 1 || true"] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This yq edit interpolates
${key}/${ENVIRONMENT_VARIABLES[$key]}directly into the expression instead of usingstrenv(...)like the other env injections above. This can break when values contain quotes/newlines/backslashes and also risks yq-expression injection via unescaped content. Prefer reusingYQ_KEY/YQ_VALUEwithstrenv()(consistent with the other blocks) so values are safely escaped.