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

Add PodFailurePolicy for Jobs #2394

Merged
merged 32 commits into from
Jan 30, 2024
Merged

Add PodFailurePolicy for Jobs #2394

merged 32 commits into from
Jan 30, 2024

Conversation

BBBmau
Copy link
Contributor

@BBBmau BBBmau commented Jan 9, 2024

Description

Fixes #2374

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

Jobs Test

 mau@mau-JKDT676NCP  ~/Dev/terraform-provider-kubernetes   add-pod-failure-policy ● ⍟4  make testacc TESTARGS='-run=TestAccKubernetesJobV1_basic'
==> Checking that code complies with gofmt requirements...
go vet ./...
TF_ACC=1 go test "/Users/mau/Dev/terraform-provider-kubernetes/kubernetes" -v -vet=off -run=TestAccKubernetesJobV1_basic -parallel 8 -timeout 3h
# github.com/hashicorp/terraform-provider-kubernetes/kubernetes.test
ld: warning: -bind_at_load is deprecated on macOS
=== RUN   TestAccKubernetesJobV1_basic
=== PAUSE TestAccKubernetesJobV1_basic
=== CONT  TestAccKubernetesJobV1_basic
--- PASS: TestAccKubernetesJobV1_basic (13.16s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   13.877s

CronJobs Test

make testacc TESTARGS='-run=TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy'              2 ↵  10374  08:39:21
==> Checking that code complies with gofmt requirements...
go vet ./...
TF_ACC=1 go test "/Users/mau/Dev/terraform-provider-kubernetes/kubernetes" -v -vet=off -run=TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy -parallel 8 -timeout 3h
# github.com/hashicorp/terraform-provider-kubernetes/kubernetes.test
ld: warning: -bind_at_load is deprecated on macOS
=== RUN   TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy
=== PAUSE TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy
=== CONT  TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy
--- PASS: TestAccKubernetesCronJobV1_minimalWithPodFailurePolicy (3.58s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   4.811s

Release Note

Release note for CHANGELOG:

`resource/kubernetes_job_v1`: add new attribute `spec.pod_failure_policy` to job spec

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@github-actions github-actions bot added the size/M label Jan 9, 2024
@github-actions github-actions bot added size/L and removed size/M labels Jan 10, 2024
@BBBmau BBBmau marked this pull request as ready for review January 12, 2024 00:47
@BBBmau BBBmau requested a review from a team as a code owner January 12, 2024 00:47
@BBBmau
Copy link
Contributor Author

BBBmau commented Jan 12, 2024

Only thing left is to add tests for CronJobs

@BBBmau
Copy link
Contributor Author

BBBmau commented Jan 12, 2024

PodFailurePolicy is not included in CronJobs. PR is ready as is.

kubernetes/schema_job_spec.go Outdated Show resolved Hide resolved
kubernetes/schema_job_spec.go Outdated Show resolved Hide resolved
kubernetes/resource_kubernetes_job_v1_test.go Outdated Show resolved Hide resolved
@BBBmau BBBmau requested a review from jrhouston January 12, 2024 22:23
@github-actions github-actions bot added size/XL and removed size/L labels Jan 12, 2024
kubernetes/schema_job_spec.go Outdated Show resolved Hide resolved
@BBBmau BBBmau requested a review from jrhouston January 24, 2024 16:56
kubernetes/structure_job.go Outdated Show resolved Hide resolved
kubernetes/structures.go Outdated Show resolved Hide resolved
kubernetes/structures.go Outdated Show resolved Hide resolved
website/docs/r/job.html.markdown Outdated Show resolved Hide resolved
website/docs/r/cron_job.html.markdown Outdated Show resolved Hide resolved
@BBBmau BBBmau merged commit f580087 into main Jan 30, 2024
16 checks passed
@BBBmau BBBmau deleted the add-pod-failure-policy branch January 30, 2024 17:05
dduportal referenced this pull request in jenkins-infra/azure Feb 19, 2024
<Actions>
<action
id="bcd9b70d7c1eb1e07eb5ad8a958f18dc1bbd81461ee1a2604adeea46e3148a47">
        <h3>Bump Terraform `kubernetes` provider version</h3>
<details
id="1d9343c012f5434ac9fe8a98135bae3667b399259be16d9b14302ea3bd424a24">
            <summary>Update Terraform lock file</summary>
<p>changes detected:&#xA;&#x9;&#34;hashicorp/kubernetes&#34; updated
from &#34;2.25.2&#34; to &#34;2.26.0&#34; in file
&#34;.terraform.lock.hcl&#34;</p>
            <details>
                <summary>2.26.0</summary>
<pre>Changelog retrieved
from:&#xA;&#x9;https://github.com/hashicorp/terraform-provider-kubernetes/releases/tag/v2.26.0&#xA;ENHANCEMENTS:&#xA;&#xA;*
`kubernetes/kubernetes_deployment_v1`: Add support for `HugePages` in
`emptyDir.medium`
[[GH-2395](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2395)]&#xA;*
`resource/kubernetes_job_v1`: add new attribute
`spec.pod_failure_policy` to job spec
[[GH-2394](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2394)]&#xA;&#xA;NOTES:&#xA;&#xA;*
Bump Kubernetes dependencies from x.27.8 to x.28.6.
[[GH-2404](https://github.com/hashicorp/terraform-provider-kubernetes/issues/2404)]&#xA;&#xA;&#xA;</pre>
            </details>
        </details>
<a
href="https://infra.ci.jenkins.io/job/updatecli/job/azure/job/main/3/">Jenkins
pipeline link</a>
    </action>
</Actions>

---

<table>
  <tr>
    <td width="77">
<img src="https://www.updatecli.io/images/updatecli.png" alt="Updatecli
logo" width="50" height="50">
    </td>
    <td>
      <p>
Created automatically by <a
href="https://www.updatecli.io/">Updatecli</a>
      </p>
      <details><summary>Options:</summary>
        <br />
<p>Most of Updatecli configuration is done via <a
href="https://www.updatecli.io/docs/prologue/quick-start/">its
manifest(s)</a>.</p>
        <ul>
<li>If you close this pull request, Updatecli will automatically reopen
it, the next time it runs.</li>
<li>If you close this pull request and delete the base branch, Updatecli
will automatically recreate it, erasing all previous commits made.</li>
        </ul>
        <p>
Feel free to report any issues at <a
href="https://github.com/updatecli/updatecli/issues">github.com/updatecli/updatecli</a>.<br
/>
If you find this tool useful, do not hesitate to star <a
href="https://github.com/updatecli/updatecli/stargazers">our GitHub
repository</a> as a sign of appreciation, and/or to tell us directly on
our <a
href="https://matrix.to/#/#Updatecli_community:gitter.im">chat</a>!
        </p>
      </details>
    </td>
  </tr>
</table>

Co-authored-by: Jenkins Infra Bot (updatecli) <60776566+jenkins-infra-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support Pod Failure Policy for Jobs / Cronjobs
2 participants