Skip to content

fix: Wrap errors when unmarshal Cloud Run deploy manifests fail.#9578

Merged
mattsanta merged 4 commits into
GoogleContainerTools:mainfrom
jesseward:jesseward/wrap-cloud-run-deploy-error
Nov 22, 2024
Merged

fix: Wrap errors when unmarshal Cloud Run deploy manifests fail.#9578
mattsanta merged 4 commits into
GoogleContainerTools:mainfrom
jesseward:jesseward/wrap-cloud-run-deploy-error

Conversation

@jesseward

Copy link
Copy Markdown
Contributor

Fixes: #9577
Related:
Merge before/after:

Description
Minor change to wrap errors for Cloud Run Service manifest parsing.

User facing changes (remove if N/A)
This will update log output for users of Cloud Deploy and vanilla Skaffold from the CLI.

Before

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 config

After

INFO[0000] Skaffold &{Version:v2.13.0-45-gda515003e-dirty ConfigVersion:skaffold/v4beta12 GitVersion: GitCommit:da515003e61ce5b0d39be08a40824813a84fdf80 BuildDate:2024-11-21T00:53:36Z 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> {0xc000b9c160 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} [] } of type *latest.Artifact and pointer: 824634868544  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 config: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go struct field Container.spec.template.spec.containers.volumeMounts of type []*run.VolumeMount

Will also expect that stackdriver logs will render the error unmarshaling JSON: ... string as well.

@conventional-commit-lint-gcf

conventional-commit-lint-gcf Bot commented Nov 21, 2024

Copy link
Copy Markdown

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

Wrap errors returned from k8syaml.Unmarshal
…d-run-deploy-error' into jesseward/wrap-cloud-run-deploy-error

Merging upstream
@jesseward jesseward changed the title Wrap errors when unmarshal Cloud Run deploy manifests. Nov 21, 2024
@jesseward jesseward changed the title fix: Wrap errors when unmarshal Cloud Run deploy manifests. Nov 21, 2024

@mattsanta mattsanta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Could you do the same if it happens with a Cloud Run Job?

return nil, sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Job config"), &proto.ActionableErr{

return sErrors.NewError(fmt.Errorf("unable to unmarshal Cloud Run Job config"), &proto.ActionableErr{

@jesseward

Copy link
Copy Markdown
Contributor Author

Thanks for the PR!

Could you do the same if it happens with a Cloud Run Job?

thanks @mattsanta , newest commit captures the Cloud Run Job yaml unmarshal errors as well.

@mattsanta mattsanta merged commit 62c0a70 into GoogleContainerTools:main Nov 22, 2024
@jesseward jesseward deleted the jesseward/wrap-cloud-run-deploy-error branch November 22, 2024 16:20
@menahyouyeah menahyouyeah mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants