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

[SHIPA-2627] omit default backoffLimit value #242

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Conversation

stinkyfingers
Copy link
Contributor

Description

Removes redundant defaultBackoffLimit from CLI. K8s sets the default to 6 when empty. Makes backoffLimit a pointer, permitting passing a 0 in.

Fixes # shipa-2627

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (documentation addition or typo, file relocation)

Testing

  • New tests were added with this PR that prove my fix is effective or that my feature works (describe below this bullet)
  • This change requires no testing (i.e. documentation update)

Documentation

  • All added public packages, funcs, and types have been documented with doc comments
  • I have commented my code, particularly in hard-to-understand areas

Final Checklist:

  • I followed standard GitHub flow guidelines
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Additional Information (omit if empty)

Please include anything else relevant to this PR that may be useful to know.

@stinkyfingers stinkyfingers changed the title [SHIAP-2627] omit default backoffLimit value [SHIPA-2627] omit default backoffLimit value Mar 30, 2022
fix tests & template nil check

adds tests

add tests
@@ -0,0 +1,72 @@
package v1beta1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added these tests just to keep coverage up. Coverage dipped in a couple packages.

@@ -109,6 +110,24 @@ func TestJobListNames(t *testing.T) {
},
wantOut: []string{"hello"},
},
{
name: "filter",
Copy link
Contributor

Choose a reason for hiding this comment

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

This test and the one below it share the same name, so it might be better to change the names to something like filter - no match and filter-success.

@@ -23,8 +23,6 @@ Deploy a job.
const (
defaultJobVersion = "v1"
defaultJobParallelism = 1
defaultJobCompletions = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this supposed to be deleted?

Copy link
Contributor

@DavisFrench DavisFrench left a comment

Choose a reason for hiding this comment

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

Two minor nitpicks, looks good otherwise. Thanks for adding those tests to types!

@@ -12,7 +12,7 @@ spec:
{{- if $.Values.job.completions }}
completions: {{ $.Values.job.completions }}
{{- end }}
{{- if $.Values.job.backoffLimit }}
{{- if not (kindIs "invalid" $.Values.job.backoffLimit) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@stinkyfingers stinkyfingers merged commit 5f23ad0 into main Apr 4, 2022
@stinkyfingers stinkyfingers deleted the shipa-2627 branch April 4, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants