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

Adding namespace_selector field. initial state #2577

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

JaylonmcShan03
Copy link
Contributor

@JaylonmcShan03 JaylonmcShan03 commented Aug 29, 2024

Description

Resolves #2532
This pr adds the namespace_selector field to to enhance pod affinity and anti-affinity rules, allowing selection of namespaces based on label selectors.

We are currently leveraging metav1.LabelSelector as a temporary solution for handling namespace selection due to the absence of a dedicated NamespaceSelector type in the metav1 package.

`

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=TestAccXXX'

=== RUN   TestAccKubernetesPodV1_with_pod_affinity_with_required_during_scheduling_ignored_during_execution
=== PAUSE TestAccKubernetesPodV1_with_pod_affinity_with_required_during_scheduling_ignored_during_execution
=== CONT  TestAccKubernetesPodV1_with_pod_affinity_with_required_during_scheduling_ignored_during_execution
--- PASS: TestAccKubernetesPodV1_with_pod_affinity_with_required_during_scheduling_ignored_during_execution 
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   12.452s


=== RUN   TestAccKubernetesPodV1_with_pod_affinity_with_preferred_during_scheduling_ignored_during_execution
=== PAUSE TestAccKubernetesPodV1_with_pod_affinity_with_preferred_during_scheduling_ignored_during_execution
=== CONT  TestAccKubernetesPodV1_with_pod_affinity_with_preferred_during_scheduling_ignored_during_execution
--- PASS: TestAccKubernetesPodV1_with_pod_affinity_with_preferred_during_scheduling_ignored_during_execution 
PASS
ok      github.com/hashicorp/terraform-provider-kubernetes/kubernetes   12.208s

Release Note

Release note for CHANGELOG:

Added support for `namespace_selector` field in `PodAffinityTerm` to enhance pod affinity and anti-affinity rules, allowing selection of namespaces based on label selectors. (#2577)

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 size/M and removed size/S labels Sep 9, 2024
@JaylonmcShan03 JaylonmcShan03 marked this pull request as ready for review September 9, 2024 16:31
@JaylonmcShan03 JaylonmcShan03 requested a review from a team as a code owner September 9, 2024 16:31
kubernetes/structure_label_selector.go Show resolved Hide resolved
kubernetes/structure_label_selector.go Outdated Show resolved Hide resolved
kubernetes/structure_label_selector.go Show resolved Hide resolved
@BBBmau BBBmau added the no-documentation This issue or pull request does not have documentation changes. label Sep 9, 2024
@BBBmau
Copy link
Contributor

BBBmau commented Sep 9, 2024

Be sure to add a changelog entry!

Copy link
Contributor

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

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

Nice work! 🎉

@JaylonmcShan03 JaylonmcShan03 merged commit 52bccce into main Sep 10, 2024
24 checks passed
@JaylonmcShan03 JaylonmcShan03 deleted the namespaceSelectorField branch September 10, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-documentation This issue or pull request does not have documentation changes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support podAntiAffinity namespaceSelector field
2 participants