mirror of https://github.com/kubeflow/examples.git
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: Get Kubernetes object
|
|
inputs:
|
|
- {name: Name, type: String}
|
|
- {name: Kind, type: String}
|
|
outputs:
|
|
- {name: Name, type: String}
|
|
- {name: ApplicationState, type: String}
|
|
- {name: Object, type: JsonObject}
|
|
metadata:
|
|
annotations:
|
|
author: Alexey Volkov <alexey.volkov@ark-kun.com>
|
|
implementation:
|
|
container:
|
|
image: bitnami/kubectl:1.17.17
|
|
command:
|
|
- bash
|
|
- -exc
|
|
- |
|
|
object_name=$0
|
|
object_type=$1
|
|
output_name_path=$2
|
|
output_state_path=$3
|
|
output_object_path=$4
|
|
mkdir -p "$(dirname "$output_name_path")"
|
|
mkdir -p "$(dirname "$output_state_path")"
|
|
mkdir -p "$(dirname "$output_object_path")"
|
|
|
|
kubectl get "$object_type" "$object_name" --output=json > "$output_object_path"
|
|
|
|
< "$output_object_path" jq '.metadata.name' --raw-output > "$output_name_path"
|
|
< "$output_object_path" jq '.status.applicationState.state' --raw-output > "$output_state_path"
|
|
|
|
- {inputValue: Name}
|
|
- {inputValue: Kind}
|
|
- {outputPath: Name}
|
|
- {outputPath: ApplicationState}
|
|
- {outputPath: Object} |