Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/rollouts-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ func newCommand() *cobra.Command {
command.Flags().StringVar(&logFormat, "logformat", "", "Set the logging format. One of: text|json")
command.Flags().IntVar(&klogLevel, "kloglevel", 0, "Set the klog logging level")
command.Flags().IntVar(&metricsPort, "metricsPort", controller.DefaultMetricsPort, "Set the port the metrics endpoint should be exposed over")
command.Flags().IntVar(&metricsPort, "metricsport", controller.DefaultMetricsPort, "Set the port the metrics endpoint should be exposed over (deprecated, use --metricsPort)")
command.Flags().MarkDeprecated("metricsport", "use --metricsPort instead")
command.Flags().IntVar(&healthzPort, "healthzPort", controller.DefaultHealthzPort, "Set the port the healthz endpoint should be exposed over")
command.Flags().StringVar(&instanceID, "instance-id", "", "Indicates which argo rollout objects the controller should operate on")
command.Flags().Float32Var(&qps, "qps", defaults.DefaultQPS, "Maximum QPS (queries per second) to the K8s API server")
Expand Down
21 changes: 21 additions & 0 deletions cmd/rollouts-controller/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestMetricsPortFlagCompatibility(t *testing.T) {
cmd := newCommand()

// Test that both flags are available
metricsPortFlag := cmd.Flags().Lookup("metricsPort")
assert.NotNil(t, metricsPortFlag, "metricsPort flag should exist")

metricsportFlag := cmd.Flags().Lookup("metricsport")
assert.NotNil(t, metricsportFlag, "metricsport flag should exist for backward compatibility")

// Test that deprecated flag is marked as deprecated
assert.True(t, metricsportFlag.Deprecated != "", "metricsport flag should be marked as deprecated")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ spec:
- name: web
interval: 7s
inconclusiveLimit: 3
successCondition: result.status == "success"
failureCondition: result.status == "failure"
successCondition: result.json.status == "success"
failureCondition: result.json.status == "failure"
provider:
web:
url: "{{args.url-val}}"
method: POST
jsonBody:
status: "inconclusive"
jsonPath: "{$.json}"
jsonPath: "{$}"
Loading