apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: test
  name: test
status:
  readyReplicas: 1
---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    keptn.sh/app: waiter
    keptn.sh/version: "0.4"
    keptn.sh/workload: waiter-waiter
  labels:
    task-definition: "parent"
spec:
  template:
    spec:
      containers:
        - env:
            - name: DATA
              value: '{"data":"myotherdata","other":"data","user":"myotheruser"}'
            - name: KEPTN_CONTEXT
              value: >-
                {"workloadName":"waiter-waiter","appName":"waiter","appVersion":"","workloadVersion":"0.4","taskType":"post","objectType":"Workload"}
            - name: CMD_ARGS
            - name: SCRIPT
              value: /var/data/function.ts
          name: keptn-function-runner
      volumes:
        - configMap:
            defaultMode: 420
            name: keptnfn-pre-deployment-parent
          name: function-mount
status:
  succeeded: 1
---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    keptn.sh/app: waiter
    keptn.sh/version: "0.4"
    keptn.sh/workload: waiter-waiter
  labels:
    task-definition: "child"
  ownerReferences:
    - apiVersion: lifecycle.keptn.sh/v1
      blockOwnerDeletion: true
      controller: true
      kind: KeptnTask
spec:
  template:
    spec:
      containers:
        - env:
            - name: DATA
              value: '{"data":"mydata","other":"data","user":"myuser"}'
            - name: KEPTN_CONTEXT
              value: >-
                {"workloadName":"waiter-waiter","appName":"waiter","appVersion":"","workloadVersion":"0.4","taskType":"pre","objectType":"Workload"}
            - name: CMD_ARGS
            - name: SECURE_DATA
              valueFrom:
                secretKeyRef:
                  key: SECURE_DATA
                  name: mysecret
            - name: SCRIPT
              value: /var/data/function.ts
          name: keptn-function-runner
          volumeMounts:
            - mountPath: /var/data/function.ts
              name: function-mount
              readOnly: true
              subPath: code
status:
  succeeded: 1
