refactor(cache delete): simplify condition
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
926327ce6d
commit
842d3449b4
1 changed files with 2 additions and 3 deletions
5
pkg/cmd/cache/delete/delete.go
vendored
5
pkg/cmd/cache/delete/delete.go
vendored
|
|
@ -95,9 +95,8 @@ func NewCmdDelete(f *cmdutil.Factory, runF func(*DeleteOptions) error) *cobra.Co
|
|||
return cmdutil.FlagErrorf("must provide either cache id, cache key, or use --all")
|
||||
}
|
||||
|
||||
if len(args) > 0 {
|
||||
_, isID := parseCacheID(args[0])
|
||||
if opts.Ref != "" && isID {
|
||||
if len(args) > 0 && opts.Ref != "" {
|
||||
if _, ok := parseCacheID(args[0]); ok {
|
||||
return cmdutil.FlagErrorf("--ref cannot be used with cache ID")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue