Skip to content

Commit

Permalink
Allow to pass --insecure to curl
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Parent <[email protected]>
  • Loading branch information
sathieu authored and tklauser committed May 25, 2023
1 parent 3102ed3 commit b68f78a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions connectivity/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type Parameters struct {

ConnectTimeout time.Duration
RequestTimeout time.Duration
CurlInsecure bool

CollectSysdumpOnFailure bool
SysdumpOptions sysdump.Options
Expand Down
3 changes: 3 additions & 0 deletions connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ func (ct *ConnectivityTest) CurlCommand(peer TestPeer, ipFam IPFamily, opts ...s
if requestTimeout := ct.params.RequestTimeout.Seconds(); requestTimeout > 0.0 {
cmd = append(cmd, "--max-time", strconv.FormatFloat(requestTimeout, 'f', -1, 64))
}
if ct.params.CurlInsecure {
cmd = append(cmd, "--insecure")
}

cmd = append(cmd, opts...)
cmd = append(cmd, fmt.Sprintf("%s://%s%s",
Expand Down
1 change: 1 addition & 0 deletions internal/cli/cmd/connectivity.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func newCmdConnectivityTest(hooks Hooks) *cobra.Command {

cmd.Flags().DurationVar(&params.ConnectTimeout, "connect-timeout", defaults.ConnectTimeout, "Maximum time to allow initiation of the connection to take")
cmd.Flags().DurationVar(&params.RequestTimeout, "request-timeout", defaults.RequestTimeout, "Maximum time to allow a request to take")
cmd.Flags().BoolVar(&params.CurlInsecure, "curl-insecure", false, "Pass --insecure to curl")

cmd.Flags().BoolVar(&params.CollectSysdumpOnFailure, "collect-sysdump-on-failure", false, "Collect sysdump after a test fails")

Expand Down

0 comments on commit b68f78a

Please sign in to comment.