Skip to content

we should support action: get #134

@etsauer

Description

@etsauer

When writing automation for kubernetes, we often need the ability to grab the value of a field in a resource and use that value in another resource. Applier should support this. Here are a few examples I can think of:

Grab Cluster ID to feed into resources.

cluster_id=$(oc get machinesets -n openshift-machine-api -o jsonpath='{.items[0].metadata.labels.machine\.openshift\.io\/cluster-api-cluster}')
oc process -f machineautoscaler-template.yaml -p CLUSTER_ID=${cluster_id} | oc apply -f -

Copy a token between clusters

token=$(oc get secret $(oc get sa builder -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}')
oc process -f secret-template.yaml -p TOKEN=${token} | oc apply -f-

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions