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

fix bug with health check method and set module cache #309

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions examples/single_file/container.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ resource "container" "consul" {
destination = "/cache"
type = "volume"
}

health_check {
timeout = "30s"

http {
address = "http://localhost:8500/v1/status/leader"
success_codes = [200]
method = "POST"
}
}
}

output "consul_addr" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/clients/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (h *HTTPImpl) HealthCheckHTTP(address, method string, headers map[string][]
return fmt.Errorf("timeout waiting for HTTP health check %s", address)
}

if method != "" {
if method == "" {
method = http.MethodGet
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/config/zz_hclparser.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package config

import (
"path"

"github.com/jumppad-labs/hclconfig"
"github.com/jumppad-labs/hclconfig/types"
"github.com/jumppad-labs/jumppad/pkg/utils"
sdk "github.com/jumppad-labs/plugin-sdk"
)

Expand Down Expand Up @@ -38,6 +41,7 @@ func NewParser(callback hclconfig.WalkCallback, variables map[string]string, var
cfg.VariableEnvPrefix = "JUMPPAD_VAR_"
cfg.Variables = variables
cfg.VariablesFiles = variablesFiles
cfg.ModuleCache = path.Join(utils.JumppadHome(), "modules")

p := hclconfig.NewParser(cfg)

Expand Down
Loading