Skip to content

Commit

Permalink
Followup to review comment: etcdctl checks for min > max.
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Ferretti <[email protected]>
  • Loading branch information
jcferretti committed Jul 2, 2024
1 parent e1872c7 commit 90db063
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions etcdctl/ctlv3/command/get_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ func getGetOp(args []string) (string, []clientv3.OpOption) {
}

if getMaxCreateRev > 0 {
if getMinCreateRev > getMaxCreateRev {
cobrautl.ExitWithError(cobrautl.ExitBadFeature,
fmt.Errorf("getMinCreateRev(=%v) > getMaxCreateRev(=%v)", getMinCreateRev, getMaxCreateRev))

}
opts = append(opts, clientv3.WithMaxCreateRev(getMaxCreateRev))
}

Expand All @@ -205,6 +210,10 @@ func getGetOp(args []string) (string, []clientv3.OpOption) {
}

if getMaxModRev > 0 {
if getMinModRev > getMaxModRev {
cobrautl.ExitWithError(cobrautl.ExitBadFeature,
fmt.Errorf("getMinModRev(=%v) > getMaxModRev(=%v)", getMinModRev, getMaxModRev))
}
opts = append(opts, clientv3.WithMaxModRev(getMaxModRev))
}

Expand Down

0 comments on commit 90db063

Please sign in to comment.