Skip to content

Commit 2f3d849

Browse files
committed
adm release new: simplify no operator error condition
The actual `operators` content is never used, so it does not need to be sorted, and treating `nil` as a silent good case and `len()==0` as an error case does not look right (`writePayload` never produces an empty non-nil `operators`).
1 parent 33cbfe1 commit 2f3d849

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/cli/admin/release/new.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,7 @@ func (o *NewOptions) Run(ctx context.Context) error {
782782
return err
783783
}
784784

785-
sort.Strings(operators)
786-
switch {
787-
case operators == nil:
788-
case len(operators) == 0:
785+
if len(operators) == 0 {
789786
fmt.Fprintf(o.ErrOut, "warning: No operator metadata was found, no operators will be part of the release.\n")
790787
}
791788

0 commit comments

Comments
 (0)