Skip to content

Commit e9ea421

Browse files
fix: reject negative --max-incremental-backups values
Fail fast if --max-incremental-backups is set to a negative value instead of silently treating it as unlimited. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d5c0182 commit e9ea421

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ func main() {
122122
opts.BindFlags(flag.CommandLine)
123123
flag.Parse()
124124

125+
if maxIncrementalBackups < 0 {
126+
fmt.Fprintln(os.Stderr, "--max-incremental-backups must be >= 0")
127+
os.Exit(1)
128+
}
129+
125130
// Allow DATAMOVER_IMAGE env var to override the default
126131
// This enables kustomize to set the image via environment variable
127132
if envImage := os.Getenv("DATAMOVER_IMAGE"); envImage != "" && datamoverImage == common.DefaultDatamoverImage {

0 commit comments

Comments
 (0)