Skip to content

Commit

Permalink
add host support for the HTTP health check
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Jul 1, 2023
1 parent cac4f4c commit 5922886
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
8 changes: 8 additions & 0 deletions cmd/healthcheck_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func createHTTPHealthcheckCmd() *cobra.Command {
var query []string
var protocol string
var path string
var host string

var createHTTPHealthcheck = &cobra.Command{
Use: "create",
Expand Down Expand Up @@ -63,6 +64,7 @@ func createHTTPHealthcheckCmd() *cobra.Command {
Headers: headersMap,
Protocol: protocol,
Path: path,
Host: host,
},
}
ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
Expand Down Expand Up @@ -111,6 +113,8 @@ func createHTTPHealthcheckCmd() *cobra.Command {

createHTTPHealthcheck.PersistentFlags().StringVar(&path, "path", "", "Path to use for the healthcheck")

createHTTPHealthcheck.PersistentFlags().StringVar(&host, "host", "", "Host header to use for the health check HTTP requests")

createHTTPHealthcheck.PersistentFlags().StringVar(&timeout, "timeout", "5s", "healthcheck timeout")

createHTTPHealthcheck.PersistentFlags().StringSliceVar(&headers, "headers", []string{}, "healthchecks http headers (example: foo=bar)")
Expand Down Expand Up @@ -142,6 +146,7 @@ func updateHTTPHealthcheckCmd() *cobra.Command {
var query []string
var protocol string
var path string
var host string

var updateHTTPHealthcheck = &cobra.Command{
Use: "update",
Expand Down Expand Up @@ -176,6 +181,7 @@ func updateHTTPHealthcheckCmd() *cobra.Command {
Headers: headersMap,
Protocol: protocol,
Path: path,
Host: host,
},
}
ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
Expand Down Expand Up @@ -228,6 +234,8 @@ func updateHTTPHealthcheckCmd() *cobra.Command {

updateHTTPHealthcheck.PersistentFlags().StringVar(&path, "path", "", "Path to use for the healthcheck")

updateHTTPHealthcheck.PersistentFlags().StringVar(&host, "host", "", "Host header to use for the health check HTTP requests")

updateHTTPHealthcheck.PersistentFlags().StringVar(&timeout, "timeout", "5s", "healthcheck timeout")

updateHTTPHealthcheck.PersistentFlags().StringSliceVar(&headers, "headers", []string{}, "healthchecks http headers (example: foo=bar)")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/appclacks/cli
go 1.20

require (
github.com/appclacks/go-types v0.0.0-20230514202307-77b895c55c7e
github.com/appclacks/go-types v0.0.0-20230701132920-beebbdd4d0ee
github.com/cheynewallace/tabby v1.1.1
github.com/spf13/cobra v1.5.0
gopkg.in/yaml.v3 v3.0.1
Expand Down
12 changes: 2 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
github.com/appclacks/go-types v0.0.0-20230401151938-70e500ff5d8e h1:q6F3f7rKacyM3KLHHOETUAVbfa0sZXcUVKy8ULbglJU=
github.com/appclacks/go-types v0.0.0-20230401151938-70e500ff5d8e/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/appclacks/go-types v0.0.0-20230412203547-193f76f5534c h1:I7lIy2VALaTMr+MMCLaoscCJIlHkAQRfk+zETxnca2o=
github.com/appclacks/go-types v0.0.0-20230412203547-193f76f5534c/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/appclacks/go-types v0.0.0-20230509204234-07f206f7c4af h1:Du12cHfa7Gvv2f2XDQXxtat2vZ65IGnOmSrAjvyDJqU=
github.com/appclacks/go-types v0.0.0-20230509204234-07f206f7c4af/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/appclacks/go-types v0.0.0-20230510191813-4ccfbeee3e7c h1:3pByBZlbOlA23fFCDhWnh0UfCbLBlDzdjWOxHJ7QBF0=
github.com/appclacks/go-types v0.0.0-20230510191813-4ccfbeee3e7c/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/appclacks/go-types v0.0.0-20230514202307-77b895c55c7e h1:bw0mnSpPTUEAMa1vGqAF/+fXA7RTCxoby/cIRg6ETy4=
github.com/appclacks/go-types v0.0.0-20230514202307-77b895c55c7e/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/appclacks/go-types v0.0.0-20230701132920-beebbdd4d0ee h1:fqC3uBkZc33S3XAxHmZzcUfmzoGR3GLalryD8YJq4Qw=
github.com/appclacks/go-types v0.0.0-20230701132920-beebbdd4d0ee/go.mod h1:ULkbKlyVigBCY+eSEV0scorq+akwJlVbdnLI5xI8IwU=
github.com/cheynewallace/tabby v1.1.1 h1:JvUR8waht4Y0S3JF17G6Vhyt+FRhnqVCkk8l4YrOU54=
github.com/cheynewallace/tabby v1.1.1/go.mod h1:Pba/6cUL8uYqvOc9RkyvFbHGrQ9wShyrn6/S/1OYVys=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
Expand Down
1 change: 1 addition & 0 deletions vendor/github.com/appclacks/go-types/healthcheck_http.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/appclacks/go-types v0.0.0-20230514202307-77b895c55c7e
# github.com/appclacks/go-types v0.0.0-20230701132920-beebbdd4d0ee
## explicit; go 1.19
github.com/appclacks/go-types
# github.com/cheynewallace/tabby v1.1.1
Expand Down

0 comments on commit 5922886

Please sign in to comment.