Skip to content

Commit

Permalink
pkg/karmadactl: unit test exec
Browse files Browse the repository at this point in the history
In this commit, we unit test exec on validating the execute options
on control plane and member clusters.

Signed-off-by: Mohamed Awnallah <[email protected]>
  • Loading branch information
mohamedawnallah committed Nov 22, 2024
1 parent 9416c08 commit 0f34ffe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/karmadactl/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package exec

import (
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -151,7 +152,7 @@ func (o *CommandExecOptions) Validate() error {
return err
}
if o.OperationScope == options.Members && len(o.Cluster) == 0 {
return fmt.Errorf("must specify a member cluster")
return errors.New("must specify a member cluster")
}
return o.KubectlExecOptions.Validate()
}
Expand Down

0 comments on commit 0f34ffe

Please sign in to comment.