Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send maxRetries property when it is specified by the user in a cloud run job manifest #9475

Conversation

renzodavid9
Copy link
Contributor

Fixes: #9452

Description
With this change, we'll force the inclusion of the maxRetries property whenever it's explicitly specified in a Cloud Run Job manifest, even if its value is 0. Only when it's not specified in the manifest will it be omitted, and Cloud Run will set its default value to 3.

When unmarshalling manifests into run.Job (google.golang.org/api/run/v1), the spec.template.spec.template.spec.maxRetries field is mapped to a non-pointer int64. This makes it impossible to distinguish between a 0 value from an unspecified property in the manifest and a 0 value explicitly set by the user. With this logic, we check the manifests to determine if the property was explicitly set.

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.

Project coverage is 63.15%. Comparing base (290280e) to head (4e3e108).
Report is 1166 commits behind head on main.

Files Patch % Lines
pkg/skaffold/deploy/cloudrun/deploy.go 57.14% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9475      +/-   ##
==========================================
- Coverage   70.48%   63.15%   -7.34%     
==========================================
  Files         515      645     +130     
  Lines       23150    33262   +10112     
==========================================
+ Hits        16317    21006    +4689     
- Misses       5776    10628    +4852     
- Partials     1057     1628     +571     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renzodavid9 renzodavid9 force-pushed the issue-9452-cloudrun-maxretries branch from 4e3e108 to 8918005 Compare July 17, 2024 15:57
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jul 17, 2024
@renzodavid9 renzodavid9 added the kokoro:force-run forces a kokoro re-run on a PR label Jul 18, 2024
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Jul 18, 2024
@renzodavid9 renzodavid9 marked this pull request as ready for review July 18, 2024 12:06
@renzodavid9 renzodavid9 merged commit 4497086 into GoogleContainerTools:main Jul 18, 2024
17 checks passed
renzodavid9 added a commit to renzodavid9/skaffold that referenced this pull request Jul 24, 2024
renzodavid9 added a commit that referenced this pull request Jul 24, 2024
* feat: default to ADC when `gcloud` cred helper is configured in docker/config.json when using docker go library (#9469)

* fix: send maxRetries property when it is specified by the user in a cloud run job manifest (#9475)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting Cloud Run Job MaxRetries to 0 when using Cloud Deploy with skaffold and rawYaml
3 participants