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

Make attribute ingress_class_name of resource kubernetes_ingress_v1 computed #1947

Merged
merged 2 commits into from
Jan 9, 2023

Conversation

arybolovlev
Copy link
Contributor

@arybolovlev arybolovlev commented Jan 3, 2023

Description

This PR fixes an issue when the provider removes the attribute ingress_class_name that is set by Kubernetes to the default ingress class value if it does not explicitly define. The attribute ingress_class_name of resource kubernetes_ingress_v1 is now marked as computed.

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="-count 1 -run ^TestAccKubernetesIngressV1_defaultIngressClass"
==> Checking that code complies with gofmt requirements...
go vet .
TF_ACC=1 go test "/Users/sacha/Documents/code/hashicorp/terraform-provider-kubernetes/kubernetes" -v -count 1 -run ^TestAccKubernetesIngressV1_defaultIngressClass -timeout 3h
=== RUN   TestAccKubernetesIngressV1_defaultIngressClass
--- PASS: TestAccKubernetesIngressV1_defaultIngressClass (2.12s)
PASS
ok  	github.com/hashicorp/terraform-provider-kubernetes/kubernetes	2.702s

Release Note

Release note for CHANGELOG:

`resource/kubernetes_ingress_v1`: make the attribute `spec.ingress_class_name` computed.

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

@@ -185,21 +185,6 @@ func TestAccKubernetesIngress_WaitForLoadBalancerGoogleCloud(t *testing.T) {
})
}

func testAccCheckKubernetesIngressForceNew(old, new *api.Ingress, wantNew bool) resource.TestCheckFunc {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the original issue, just noticed that it is not in use, and since I touched this file, I cleaned it up a bit.

@@ -452,47 +437,3 @@ resource "kubernetes_ingress" "test" {
wait_for_load_balancer = true
}`, name, name, name, name, name, name, name)
}

func testAccKubernetesIngressConfig_stateUpgradev0(provider, name string) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the original issue, just noticed that it is not in use, and since I touched this file, I cleaned it up a bit.

@@ -310,19 +310,33 @@ func TestAccKubernetesIngressV1_multipleRulesDifferentHosts(t *testing.T) {
})
}

func testAccCheckKubernetesIngressV1ForceNew(old, new *networking.Ingress, wantNew bool) resource.TestCheckFunc {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the original issue, just noticed that it is not in use, and since I touched this file, I cleaned it up a bit.

@arybolovlev arybolovlev changed the title [WIP] Make attribute ingress_class_name of resource kubernetes_ingress_v1 computed Make attribute ingress_class_name of resource kubernetes_ingress_v1 computed Jan 3, 2023
@arybolovlev arybolovlev marked this pull request as ready for review January 3, 2023 15:02
@arybolovlev arybolovlev requested a review from a team as a code owner January 3, 2023 15:02
Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

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

LGTM! Great that you spotted the dead test code and cleaned it up!

@arybolovlev arybolovlev merged commit 7e1ac6b into main Jan 9, 2023
@arybolovlev arybolovlev deleted the fix-ingress-class-name branch January 9, 2023 13:52
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Perpetual diff on ingress without ingress_class_name
2 participants