deploy-cloudrun
deploy-cloudrun copied to clipboard
metadata don't works when input job yaml
TL;DR
I have metadata for job, but the actions only allow knative yaml.
apiVersion: run.googleapis.com/v1
kind: Job
metadata:
name: job
labels:
run.googleapis.com/satisfiesPzs: 'true'
cloud.googleapis.com/location: southamerica-east1
spec:
template:
metadata:
annotations:
run.googleapis.com/execution-environment: gen2
spec:
parallelism: 1
taskCount: 1
template:
spec:
containers:
- image: us-docker.pkg.dev/xxx/docker/job:latest
imagePullPolicy: Always
resources:
limits:
cpu: 1000m
memory: 512Mi
maxRetries: 0
timeoutSeconds: '3600'
Expected behavior
Accept yaml of job and knative.
Observed behavior
google-github-actions/deploy-cloudrun failed with: failed to execute gcloud command gcloud run services replace ./scripts/job/Service.dev.yaml --format json --region southamerica-east1: ERROR: (gcloud.run.services.replace) Failed to parse value(s) in protobuf [Service]: Service.spec.template.spec.parallelism,taskCount,template
Action YAML
-
name: Deploy Cloud Run Application with Metadata
id: deploy
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
region: '${{ inputs.app_region }}'
metadata: '${{ inputs.cloud_run_metadata }}'
Log output
No response
Additional information
No response
Hi @templarfelix - this GitHub Action runs gcloud under the hood, and that error is coming from gcloud. Are you trying to define a Cloud Run job instead of a service?
@sethvargo Yes, I put a JSON of the job definition;
The fix is, check the content of metadata and change the command from "cloud run services replace ./scripts/job/Service.dev.yaml --format json --region southamerica-east1" to "cloud run jobs replace ./scripts/job/Service.dev.yaml --format json --region southamerica-east1"
I think this makes sense - we currently only support metadata for service definitions.