Used funtions shell

27 views
Skip to first unread message

Joyce Passos

unread,
Feb 26, 2025, 5:07:37 PMFeb 26
to crossplane-dev

"How can I use the shell function in Crossplane to execute a command and capture the ID from its output? Additionally, I need my credentials to be read from a Secret within the cluster. How can I achieve this?"

kind: Composition
metadata:
name: shell-example
spec:
compositeTypeRef:
kind: XOCIServiceGateway
mode: Pipeline
pipeline:
- step: shell
functionRef:
name: function-shell
input:
kind: Parameters
shellEnvVarsRef:
name: oci-creds
keys:
- credentials
shellEnvVars:
- key: OCI_API_URL
shellCommand: |
echo "${credentials}"
oci network service list --region sa-saopaulo-1
stdoutField: status.atFunction.shell.stdout
stderrField: status.atFunction.shell.stderr

Reply all
Reply to author
Forward
0 new messages