feat(components): add namespace to pvc creation (#8147)

Signed-off-by: Jagadeesh J <jagadeeshj@ideas2it.com>

Signed-off-by: Jagadeesh J <jagadeeshj@ideas2it.com>
This commit is contained in:
Jagadeesh J 2022-08-18 22:15:07 +05:30 committed by GitHub
parent f162b248f4
commit 031a7d9c59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@ name: Create PersistentVolumeClaim in Kubernetes
inputs:
- {name: Name, type: String}
- {name: Storage size, type: String, default: 1Gi}
- {name: Namespace, type: String, default: default}
outputs:
- {name: Name, type: String}
metadata:
@ -17,7 +18,8 @@ implementation:
- |
name=$0
storage_size=$1
output_name_path=$2
namespace=$2
output_name_path=$3
mkdir -p "$(dirname "$output_name_path")"
object_path=$(mktemp)
@ -34,10 +36,11 @@ implementation:
requests:
storage: $storage_size
EOF
object_name=$(kubectl apply -f "$object_path" --namespace default --output=name)
object_name=$(kubectl apply -f "$object_path" --namespace $namespace --output=name)
object_name=${object_name##persistentvolumeclaim/}
echo "$object_name" >"$output_name_path"
- {inputValue: Name}
- {inputValue: Storage size}
- {inputValue: Namespace}
- {outputPath: Name}