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

Feature/job v1 suspend field #2682

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

marsskop
Copy link

@marsskop marsskop commented Feb 3, 2025

Description

Addresses #2631

This Pull Request introduces a suspend field for the KubernetesJobV1 resource.

Changes

  • Added suspend field to the KubernetesJobV1 schema.
  • Implemented validation that suspend and wait_for_completion are not both set to true through CustomizeDiff field in KubernetesJobV1 Resource.
  • Included new field in flattenJobV1Spec, expandJobV1Spec, and patchJobV1Spec, making it a mutable parameter that can be updated in-place.
  • Added two acceptance tests that test job suspension, and validate that both suspend and wait_for_completion cannot be set to true.

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:

$ make testacc TESTARGS="-run ^TestAccKubernetesJobV1"
==> Checking that code complies with gofmt requirements...
go vet ./...
TF_ACC=1 go test "/Users/user/personal/terraform-provider-kubernetes/kubernetes" -v -vet=off -run ^TestAccKubernetesJobV1 -parallel 8 -timeout 3h
=== RUN   TestAccKubernetesJobV1_wait_for_completion
=== PAUSE TestAccKubernetesJobV1_wait_for_completion
=== RUN   TestAccKubernetesJobV1_basic
=== PAUSE TestAccKubernetesJobV1_basic
=== RUN   TestAccKubernetesJobV1_update
=== PAUSE TestAccKubernetesJobV1_update
=== RUN   TestAccKubernetesJobV1_ttl_seconds_after_finished
=== PAUSE TestAccKubernetesJobV1_ttl_seconds_after_finished
=== RUN   TestAccKubernetesJobV1_suspend
=== PAUSE TestAccKubernetesJobV1_suspend
=== RUN   TestAccKubernetesJobV1_suspendExpectErrors
=== PAUSE TestAccKubernetesJobV1_suspendExpectErrors
=== CONT  TestAccKubernetesJobV1_wait_for_completion
=== CONT  TestAccKubernetesJobV1_ttl_seconds_after_finished
=== CONT  TestAccKubernetesJobV1_update
=== CONT  TestAccKubernetesJobV1_suspend
=== CONT  TestAccKubernetesJobV1_suspendExpectErrors
=== CONT  TestAccKubernetesJobV1_basic
--- PASS: TestAccKubernetesJobV1_suspendExpectErrors (0.70s)
--- PASS: TestAccKubernetesJobV1_basic (16.96s)
--- PASS: TestAccKubernetesJobV1_ttl_seconds_after_finished (20.88s)
--- PASS: TestAccKubernetesJobV1_suspend (25.33s)
--- PASS: TestAccKubernetesJobV1_wait_for_completion (30.93s)
--- PASS: TestAccKubernetesJobV1_update (45.28s)
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   46.831s

Release Note

Release note for CHANGELOG:

...

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

@marsskop marsskop requested a review from a team as a code owner February 3, 2025 07:57
Copy link

hashicorp-cla-app bot commented Feb 3, 2025

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


1 out of 2 committers have signed the CLA.

  • marsskop
  • Mark Prikhno

Mark Prikhno seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Mark Prikhno seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@github-actions github-actions bot added the size/L label Feb 3, 2025
@marsskop
Copy link
Author

marsskop commented Feb 4, 2025

I was not able to link my two first commits (under Mark Prikhno) to my account (there was a generic email in git config) -- should I recreate pull-request to make sure I am the only contributor who signed CLA?

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.

1 participant