Skip to content

Commit

Permalink
Fix param names in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
strideynet committed Jan 17, 2025
1 parent f8d8ab4 commit b42cb11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/tbot/cli/start_workload_identity_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ func (c *WorkloadIdentityJWTCommand) ApplyConfig(cfg *config.BotConfig, l *slog.

switch {
case c.NameSelector != "" && c.LabelSelector != "":
return trace.BadParameter("workload-identity-name and workload-identity-labels flags are mutually exclusive")
return trace.BadParameter("name-selector and label-selector flags are mutually exclusive")
case c.NameSelector != "":
svc.Selector.Name = c.NameSelector
case c.LabelSelector != "":
labels, err := client.ParseLabelSpec(c.LabelSelector)
if err != nil {
return trace.Wrap(err, "parsing --workload-identity-labels")
return trace.Wrap(err, "parsing --label-selector")
}
svc.Selector.Labels = map[string][]string{}
for k, v := range labels {
svc.Selector.Labels[k] = []string{v}
}
default:
return trace.BadParameter("workload-identity-name or workload-identity-labels must be specified")
return trace.BadParameter("name-selector or label-selector must be specified")
}

cfg.Services = append(cfg.Services, svc)
Expand Down

0 comments on commit b42cb11

Please sign in to comment.