Skip to content

Commit

Permalink
Merge pull request #309 from jumppad-labs/b-module-cache
Browse files Browse the repository at this point in the history
fix bug with health check method and set module cache
  • Loading branch information
eveld authored Oct 9, 2024
2 parents eb9df85 + ded6207 commit 45b93eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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

0 comments on commit 45b93eb

Please sign in to comment.