-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better check if spot force is set (#352)
* fix: better check if spot force is set * test: add another test for spot force
- Loading branch information
1 parent
f5866e5
commit 475f206
Showing
12 changed files
with
800 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
internal/testdata/complex/service-templates/service6/cronjob-cronjob-cli-drush-cron2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: cli | ||
lagoon.sh/service-type: cli-persistent | ||
lagoon.sh/spot: "true" | ||
lagoon.sh/template: cli-persistent-0.1.0 | ||
name: cronjob-cli-drush-cron2 | ||
spec: | ||
concurrencyPolicy: Forbid | ||
failedJobsHistoryLimit: 1 | ||
jobTemplate: | ||
metadata: | ||
creationTimestamp: null | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/configMapSha: abcdefg1234567890 | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: cli | ||
lagoon.sh/service-type: cli-persistent | ||
lagoon.sh/spot: "true" | ||
lagoon.sh/template: cli-persistent-0.1.0 | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- preference: | ||
matchExpressions: | ||
- key: lagoon.sh/spot | ||
operator: Exists | ||
weight: 1 | ||
containers: | ||
- command: | ||
- /lagoon/cronjob.sh | ||
- drush cron | ||
env: | ||
- name: LAGOON_GIT_SHA | ||
value: "0000000000000000000000000000000000000000" | ||
- name: SERVICE_NAME | ||
value: cli | ||
envFrom: | ||
- configMapRef: | ||
name: lagoon-env | ||
image: harbor.example/example-project/main/cli@sha256:b2001babafaa8128fe89aa8fd11832cade59931d14c3de5b3ca32e2a010fbaa8 | ||
imagePullPolicy: Always | ||
name: cronjob-cli-drush-cron2 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 10Mi | ||
securityContext: {} | ||
volumeMounts: | ||
- mountPath: /var/run/secrets/lagoon/sshkey/ | ||
name: lagoon-sshkey | ||
readOnly: true | ||
- mountPath: /app/docroot/sites/default/files//php | ||
name: nginx-php-twig | ||
- mountPath: /app/docroot/sites/default/files/ | ||
name: nginx-php | ||
dnsConfig: | ||
options: | ||
- name: timeout | ||
value: "60" | ||
- name: attempts | ||
value: "10" | ||
enableServiceLinks: false | ||
imagePullSecrets: | ||
- name: lagoon-internal-registry-secret | ||
priorityClassName: lagoon-priority-production | ||
restartPolicy: Never | ||
securityContext: | ||
fsGroup: 10001 | ||
runAsGroup: 0 | ||
runAsUser: 10000 | ||
tolerations: | ||
- effect: NoSchedule | ||
key: lagoon.sh/spot | ||
operator: Exists | ||
- effect: PreferNoSchedule | ||
key: lagoon.sh/spot | ||
operator: Exists | ||
volumes: | ||
- name: lagoon-sshkey | ||
secret: | ||
defaultMode: 420 | ||
secretName: lagoon-sshkey | ||
- emptyDir: {} | ||
name: nginx-php-twig | ||
- name: nginx-php | ||
persistentVolumeClaim: | ||
claimName: nginx-php | ||
schedule: 18,48 * * * * | ||
startingDeadlineSeconds: 240 | ||
successfulJobsHistoryLimit: 0 | ||
status: {} |
103 changes: 103 additions & 0 deletions
103
internal/testdata/complex/service-templates/service6/deployment-cli.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/instance: cli | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
app.kubernetes.io/name: cli-persistent | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: cli | ||
lagoon.sh/service-type: cli-persistent | ||
lagoon.sh/template: cli-persistent-0.1.0 | ||
name: cli | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: cli | ||
app.kubernetes.io/name: cli-persistent | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
lagoon.sh/branch: main | ||
lagoon.sh/configMapSha: abcdefg1234567890 | ||
lagoon.sh/version: v2.7.x | ||
creationTimestamp: null | ||
labels: | ||
app.kubernetes.io/instance: cli | ||
app.kubernetes.io/managed-by: build-deploy-tool | ||
app.kubernetes.io/name: cli-persistent | ||
lagoon.sh/buildType: branch | ||
lagoon.sh/environment: main | ||
lagoon.sh/environmentType: production | ||
lagoon.sh/project: example-project | ||
lagoon.sh/service: cli | ||
lagoon.sh/service-type: cli-persistent | ||
lagoon.sh/template: cli-persistent-0.1.0 | ||
spec: | ||
containers: | ||
- env: | ||
- name: LAGOON_GIT_SHA | ||
value: "0000000000000000000000000000000000000000" | ||
- name: CRONJOBS | ||
value: | | ||
3,18,33,48 * * * * drush cron | ||
- name: SERVICE_NAME | ||
value: cli | ||
envFrom: | ||
- configMapRef: | ||
name: lagoon-env | ||
image: harbor.example/example-project/main/cli@sha256:b2001babafaa8128fe89aa8fd11832cade59931d14c3de5b3ca32e2a010fbaa8 | ||
imagePullPolicy: Always | ||
name: cli | ||
readinessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- if [ -x /bin/entrypoint-readiness ]; then /bin/entrypoint-readiness; | ||
fi | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 2 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 10Mi | ||
securityContext: {} | ||
volumeMounts: | ||
- mountPath: /var/run/secrets/lagoon/sshkey/ | ||
name: lagoon-sshkey | ||
readOnly: true | ||
- mountPath: /app/docroot/sites/default/files//php | ||
name: nginx-php-twig | ||
- mountPath: /app/docroot/sites/default/files/ | ||
name: nginx-php | ||
enableServiceLinks: false | ||
imagePullSecrets: | ||
- name: lagoon-internal-registry-secret | ||
priorityClassName: lagoon-priority-production | ||
securityContext: | ||
fsGroup: 10001 | ||
runAsGroup: 0 | ||
runAsUser: 10000 | ||
volumes: | ||
- name: lagoon-sshkey | ||
secret: | ||
defaultMode: 420 | ||
secretName: lagoon-sshkey | ||
- emptyDir: {} | ||
name: nginx-php-twig | ||
- name: nginx-php | ||
persistentVolumeClaim: | ||
claimName: nginx-php | ||
status: {} |
Oops, something went wrong.