Skip to content

Commit 45b93eb

Browse files
authored
Merge pull request #309 from jumppad-labs/b-module-cache
fix bug with health check method and set module cache
2 parents eb9df85 + ded6207 commit 45b93eb

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

examples/single_file/container.hcl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ resource "container" "consul" {
7373
destination = "/cache"
7474
type = "volume"
7575
}
76+
77+
health_check {
78+
timeout = "30s"
79+
80+
http {
81+
address = "http://localhost:8500/v1/status/leader"
82+
success_codes = [200]
83+
method = "POST"
84+
}
85+
}
7686
}
7787

7888
output "consul_addr" {

pkg/clients/http/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (h *HTTPImpl) HealthCheckHTTP(address, method string, headers map[string][]
5555
return fmt.Errorf("timeout waiting for HTTP health check %s", address)
5656
}
5757

58-
if method != "" {
58+
if method == "" {
5959
method = http.MethodGet
6060
}
6161

pkg/config/zz_hclparser.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package config
22

33
import (
4+
"path"
5+
46
"github.com/jumppad-labs/hclconfig"
57
"github.com/jumppad-labs/hclconfig/types"
8+
"github.com/jumppad-labs/jumppad/pkg/utils"
69
sdk "github.com/jumppad-labs/plugin-sdk"
710
)
811

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

4246
p := hclconfig.NewParser(cfg)
4347

0 commit comments

Comments
 (0)