coder / coder/terraform-provider-coder

feature: support for checking against HTTP status code

Open
#183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
60
Forks
27
Avg merge
1d 21h
Merged PRs (30d)
2

Description

# Description

The integrated [healthcheck](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app#nested-schema-for-healthcheck) should be able to check a HTTP a status code.

E.g. we are deploying an K3D cluster inside out workspace. The healthcheck is already green but user facing a 404 error page from kubernetes as the app is not up and running. Checking against a status code 200 should solve this.

Setting a explicit statuscode should change the default checking.

```hcl
resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
slug = "code-server"
display_name = "VS Code"
icon = "${data.coder_workspace.me.access_url}/icon/code.svg"
url = "http://localhost:13337"
share = "owner"
subdomain = false
healthcheck {
url = "http://localhost:13337/healthz"
interval = 5
threshold = 6
statuscode = 200
}
}
```

### Expected Behavior
Button should be enabled when application is ready and not when kubernetes cluster has started. If a statuscode 200 is set then the button gets enabled when the application is ready.

### Actual Behavior
As soon kubernetes cluster is ready the healtcheck is green and buttons are enabled

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.