I have a CloudBuild cloudbuild.yaml
file which defines a task to export a GCE Image to a Bucket in .vmdk
format.
gcloud compute images export \
--image=$IMAGE_NAME \
--destination-uri=$DESTINATION_BUCKET/$VMDK_NAME \
--export-format=vmdk \
--network=$NETWORK \
--subnet=$SUBNET \
--project=$PROJECT_ID \
--async
The gcloud compute images export
is working fine; the command triggers a child CloudBuild to convert and to upload to gcs.
There are no fields in the new build that identifies the "parent" caller, these fields are empty:
Provider
, Source
, Ref Commit
, Trigger Id
, Trigger Type
, Trigger Name
, Trigger Description
How can I identify these child process ?
Interesting question.
I think you may be unable to do this (see Hack below) because there's no user-definable metadata that you can pass from the parent Cloud Build task through the
gcloud compute images export ...
to the child Cloud Build task.I think it's a useful feature request to be able to pass arbitrary metadata (labels?) through Cloud SDK commands. You should consider submitting a request to Google's Issue Tracker for Cloud SDK