From f87d27ee0d5f9cff5722f5688eaedeef594bf4c1 Mon Sep 17 00:00:00 2001 From: BAK BYEONG JUN Date: Thu, 10 Apr 2025 10:06:43 +0000 Subject: [PATCH] init --- tasks/before-pipeline/task.yaml | 34 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/tasks/before-pipeline/task.yaml b/tasks/before-pipeline/task.yaml index 08b6a00..ac2a232 100644 --- a/tasks/before-pipeline/task.yaml +++ b/tasks/before-pipeline/task.yaml @@ -10,25 +10,20 @@ spec: description: | Whether to create a PersistentVolumeClaim (PVC). Set to "true" to create a PVC. Set to "false" to skip creation. - - name: pvcSize type: string default: "1Gi" description: | The requested size of the PVC (e.g., "1Gi", "5Gi"). - - name: pvcStorageClass type: string default: "" description: | The name of the StorageClass to use. Leave empty to use the default storage class. - - results: - name: pvcName description: | The name of the created PVC. If pvcEnable is false, this will be an empty string. - steps: - name: maybe-create-pvc image: bitnami/kubectl:latest @@ -41,30 +36,25 @@ spec: PVC_NAME="before-pvc-${RAND}" echo "Creating PVC: ${PVC_NAME}" - # Start writing the PVC YAML cat < /tmp/pvc.yaml -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: ${PVC_NAME} -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: $(params.pvcSize) - volumeMode: Filesystem -EOF + apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: ${PVC_NAME} + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: $(params.pvcSize) + volumeMode: Filesystem + EOF - # Append pvcStorageClass if provided if [ "$(params.pvcStorageClass)" != "" ]; then echo " storageClassName: $(params.pvcStorageClass)" >> /tmp/pvc.yaml fi - # Apply PVC kubectl apply -f /tmp/pvc.yaml - - # Write result echo -n "${PVC_NAME}" > $(results.pvcName.path) echo "PVC created: ${PVC_NAME}" else