diff --git a/config/definition/image-update-task.yaml b/config/definition/task.yaml similarity index 94% rename from config/definition/image-update-task.yaml rename to config/definition/task.yaml index 30f2e29..afc48ab 100644 --- a/config/definition/image-update-task.yaml +++ b/config/definition/task.yaml @@ -1,7 +1,7 @@ apiVersion: core.oam.dev/v1alpha1 kind: Definition metadata: - name: image-update-task + name: task namespace: vela-system spec: type: trigger-action @@ -18,7 +18,7 @@ spec: apiVersion: "batch/v1" kind: "Job" metadata: { - name: context.data.metadata.name + name: parameter.name namespace: parameter.namespace if context.data.metadata.labels != _|_ { labels: context.data.metadata.labels @@ -43,7 +43,7 @@ spec: spec: { restartPolicy: parameter.restart containers: [{ - name: context.data.metadata.name + name: parameter.name image: parameter.image command: parameter.cmd @@ -78,6 +78,9 @@ spec: // +usage=The image to run the job container on image: string + // +usage=Name of the cron job + name: *context.data.metadata.name | string + // +usage=The namespace to create the Job in namespace: *context.data.metadata.namespace | string diff --git a/examples/triggerservice-image-update.yaml b/examples/triggerservice-image-update.yaml index e6a38dc..f9857ee 100644 --- a/examples/triggerservice-image-update.yaml +++ b/examples/triggerservice-image-update.yaml @@ -20,7 +20,7 @@ spec: context.data.status.latestBuildReason == "STACK" && context.data.status.conditions[0].status == "True" action: - type: image-update-task + type: task properties: cmd: [/bin/sh, -c, "echo Image: ${SOURCE_NAME} in namespace: ${SOURCE_NAMESPACE} has been successfully rebased at $(date)"] image: busybox