Skip to content

Commit

Permalink
rename --label-keys to --labels
Browse files Browse the repository at this point in the history
  • Loading branch information
joemiller committed Nov 8, 2024
1 parent dd5044e commit 9480f49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ const leaderElectionId = "node-label-controller"
func main() {
var metricsAddr string
var enableLeaderElection bool
var labelKeysStr string
var labelsStr string
var cloudProvider string
var jsonLogs bool

logger := ctrl.Log.WithName("main")

flag.StringVar(&metricsAddr, "metrics-addr", ":8080", "The address the metric endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, "Enable leader election.") // TODO: should be on by default?
flag.StringVar(&labelKeysStr, "label-keys", "", "Comma-separated list of label keys to sync")
flag.StringVar(&labelsStr, "labels", "", "Comma-separated list of label keys to sync")
flag.StringVar(&cloudProvider, "cloud", "", "Cloud provider (aws or gcp)")
flag.BoolVar(&jsonLogs, "json", false, "Output logs in JSON format")
flag.Parse()
Expand All @@ -41,11 +41,11 @@ func main() {
ctrl.SetLogger(zap.New(opts...))

// validate flags
if labelKeysStr == "" {
if labelsStr == "" {
logger.Error(fmt.Errorf("label-keys is required"), "unable to start manager")
os.Exit(1)
}
labels := strings.Split(labelKeysStr, ",")
labels := strings.Split(labelsStr, ",")
logger.Info("Label keys to sync", "labelKeys", labels)

if cloudProvider != "aws" && cloudProvider != "gcp" {
Expand Down

0 comments on commit 9480f49

Please sign in to comment.