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 kubernetes_ingress_v1 timeouts #1936

Merged
merged 6 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubernetes/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func skipIfNotRunningInGke(t *testing.T) {
t.Skip("The Kubernetes endpoint must come from GKE for this test to run - skipping")
}
for _, ev := range []string{"GOOGLE_PROJECT", "GOOGLE_REGION", "GOOGLE_ZONE"} {
if os.Getenv("ev") == "" {
if os.Getenv(ev) == "" {
t.Skipf("%s must be set for GoogleCloud tests", ev)
}
}
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/resource_kubernetes_ingress_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"log"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
networking "k8s.io/api/networking/v1"
Expand All @@ -25,6 +26,10 @@ func resourceKubernetesIngressV1() *schema.Resource {
StateContext: schema.ImportStatePassthroughContext,
},
Schema: resourceKubernetesIngressV1Schema(),
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(20 * time.Minute),
Delete: schema.DefaultTimeout(20 * time.Minute),
},
}
}

Expand Down
12 changes: 12 additions & 0 deletions kubernetes/resource_kubernetes_ingress_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ func testAccKubernetesIngressV1Config_serviceBackend(name string) string {
}
}
}
timeouts {
create = "45m"
}
}`, name)
}

Expand Down Expand Up @@ -590,6 +593,12 @@ func testAccKubernetesIngressV1Config_waitForLoadBalancer(name string) string {
protocol = "TCP"
}
}
lifecycle {
ignore_changes = [
metadata[0].annotations["cloud.google.com/neg"],
metadata[0].annotations["cloud.google.com/neg-status"],
]
}
}

resource "kubernetes_deployment" "test" {
Expand Down Expand Up @@ -641,6 +650,9 @@ resource "kubernetes_ingress_v1" "test" {
}
}
wait_for_load_balancer = true
timeouts {
create = "45m"
}
}`, name, name, name, name, name, name, name)
}

Expand Down
7 changes: 6 additions & 1 deletion website/docs/r/ingress_v1.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ description: |-

Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.


## Example Usage

```hcl
Expand Down Expand Up @@ -306,6 +305,12 @@ The following arguments are supported:
* `ip` - IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers).
* `hostname` - Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers).

## Timeouts

The following [Timeout](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) configuration options are available for the `kubernetes_ingress_v1` resource:

* `create` - ingress load balancer creation timeout (default `20 minutes`).
* `delete` - ingress load balancer deletion timeout (default `20 minutes`).

## Import

Expand Down