Skip to content

Commit

Permalink
Add --tls-skip-verify for install command (#2095)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksmaus authored Sep 13, 2024
1 parent d25d70a commit 109c1ab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/elastic/elastic-package/internal/cobraext"
"github.com/elastic/elastic-package/internal/install"
"github.com/elastic/elastic-package/internal/kibana"
"github.com/elastic/elastic-package/internal/packages"
"github.com/elastic/elastic-package/internal/packages/installer"
"github.com/elastic/elastic-package/internal/stack"
Expand All @@ -34,6 +35,7 @@ func setupInstallCommand() *cobraext.Command {
cmd.Flags().StringP(cobraext.ZipPackageFilePathFlagName, cobraext.ZipPackageFilePathFlagShorthand, "", cobraext.ZipPackageFilePathFlagDescription)
cmd.Flags().Bool(cobraext.BuildSkipValidationFlagName, false, cobraext.BuildSkipValidationFlagDescription)
cmd.Flags().StringP(cobraext.ProfileFlagName, "p", "", fmt.Sprintf(cobraext.ProfileFlagDescription, install.ProfileNameEnvVar))
cmd.Flags().Bool(cobraext.TLSSkipVerifyFlagName, false, cobraext.TLSSkipVerifyFlagDescription)

return cobraext.NewCommand(cmd, cobraext.ContextPackage)
}
Expand All @@ -57,7 +59,13 @@ func installCommandAction(cmd *cobra.Command, _ []string) error {
return err
}

kibanaClient, err := stack.NewKibanaClientFromProfile(profile)
var opts []kibana.ClientOption
tlsSkipVerify, _ := cmd.Flags().GetBool(cobraext.TLSSkipVerifyFlagName)
if tlsSkipVerify {
opts = append(opts, kibana.TLSSkipVerify())
}

kibanaClient, err := stack.NewKibanaClientFromProfile(profile, opts...)
if err != nil {
return fmt.Errorf("could not create kibana client: %w", err)
}
Expand Down

0 comments on commit 109c1ab

Please sign in to comment.