Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions cmd/utils/app/snapshots_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,19 +1116,17 @@ func doIntegrity(cliCtx *cli.Context) error {

skipChecks := cliCtx.String("skip-check")
if len(skipChecks) > 0 {
var finalChecks []integrity.Check
skipSet := map[integrity.Check]struct{}{}
for skipCheck := range strings.SplitSeq(skipChecks, ",") {
found := false
for _, chk := range requestedChecks {
if chk == integrity.Check(skipCheck) {
found = true
logger.Info("[integrity] skipping check", "check", chk)
break
}
}
if !found {
finalChecks = append(finalChecks, integrity.Check(skipCheck))
skipSet[integrity.Check(skipCheck)] = struct{}{}
}
var finalChecks []integrity.Check
for _, chk := range requestedChecks {
if _, skip := skipSet[chk]; skip {
logger.Info("[integrity] skipping check", "check", chk)
continue
}
finalChecks = append(finalChecks, chk)
}

requestedChecks = finalChecks
Expand Down
Loading