Support authentication and TLS in k6 load testing script (#391)

This commit is contained in:
Nikolay Edigaryev
2026-01-29 09:00:32 +01:00
committed by GitHub
parent a234ec8995
commit 81a2c7b2df
2 changed files with 39 additions and 4 deletions
+9
View File
@@ -36,6 +36,7 @@ var experimentalPingInterval time.Duration
var deprecatedPrometheusMetrics bool
var experimentalDisableDBCompression bool
var workerOfflineTimeout time.Duration
var synthetic bool
func newRunCommand() *cobra.Command {
cmd := &cobra.Command{
@@ -90,6 +91,10 @@ func newRunCommand() *cobra.Command {
"of scheduling (no new VMs will be scheduled on such worker and already assigned VMs will be "+
"marked as failed)")
// Hidden flags
cmd.Flags().BoolVar(&synthetic, "synthetic", false, "")
cmd.Flags().MarkHidden("synthetic")
return cmd
}
@@ -152,6 +157,10 @@ func runController(cmd *cobra.Command, args []string) (err error) {
controllerOpts = append(controllerOpts, controller.WithAPIPrefix(apiPrefix))
}
if synthetic {
controllerOpts = append(controllerOpts, controller.WithSynthetic())
}
var controllerCert tls.Certificate
if !noTLS {