-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Expected behavior
Users desire detailed error logging in the event that a Cloud Run manifest.yaml does not adhere to schema and fails to unmarshal.
For example, the error unable to unmarshal Cloud Run Service config, does not include the wrapped k8syaml.Unmarshal error.
We expect the error wrapped onto the string, for example cannot unmarshal string into Go struct field Container.spec.template.spec.containers.volumeMounts of type []*run.VolumeMount
Actual behavior
Cloud Run (triggered via Cloud Deploy) jobs can become problematic to debug when manifest.yaml does not conform to desired Cloud Run Service config schema. The manifest is not fully validated when uploading/creating the job, so the user is only aware of the problem during attempts to run the pipeline/job and will result in failure.
Note that the following logging output captured from Cloud Deploy has the targets configured at debug verbosity.
Or running via the skaffold binary directly
skaffold -v info apply manifest.yaml --filename=skaffold.yaml
INFO[0000] Skaffold &{Version:v2.13.0-45-gda515003e ConfigVersion:skaffold/v4beta12 GitVersion: GitCommit:da515003e61ce5b0d39be08a40824813a84fdf80 BuildDate:2024-11-21T00:39:25Z GoVersion:go1.23-20240626-RC01 cl/646990413 +5a18e79687 X:fieldtrack,boringcrypto Compiler:gc Platform:linux/amd64 User:} subtask=-1 task=DevLoop
INFO[0000] Loaded Skaffold defaults from "/usr/local/google/home/jesseward/.skaffold/config" subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{my-img . <nil> {0xc000e400b0 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} [] } of type *latest.Artifact and pointer: 824648009344 subtask=-1 task=DevLoop
INFO[0000] DOCKER_HOST env is not set, using the host from docker context. subtask=-1 task=DevLoop
INFO[0000] no kpt renderer or deployer found, skipping hydrated-dir creation subtask=-1 task=DevLoop
INFO[0000] build concurrency first set to 1 parsed from *runner.pipelineBuilderWithHooks[0] subtask=-1 task=DevLoop
INFO[0000] final build concurrency value is 1 subtask=-1 task=DevLoop
Starting deploy...
unable to unmarshal Cloud Run Service configInformation
- Skaffold version: v2.13.0-45-gda515003e (main branch)
- Operating system: gLinux
- Installed via: Source
- Contents of
skaffold.yamlmanifest.yaml will reproduce:
Note the volumeMounts is meant to be an array.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: cloud-run-service
spec:
template:
spec:
containers:
- image: my-img
volumeMounts: blahSteps to reproduce the behavior
skaffold -v info apply manifest.yaml --filename=skaffold.yaml
