Migrate lock commands to independent objects
This commit is contained in:
@@ -76,13 +76,13 @@ func SessionValidate(ctx context.Context, args []string, out io.Writer) error {
|
||||
}
|
||||
}
|
||||
|
||||
locks := inspectEffectiveLocks(ctx, cfg, store)
|
||||
locks := inspectRemoteLocks(ctx, cfg, store)
|
||||
if locks.Err != nil {
|
||||
findings = append(findings, errorFinding("locks", locks.Err.Error()))
|
||||
} else if len(locks.Locks.All) == 0 {
|
||||
findings = append(findings, okFinding("locks", "no effective publish locks"))
|
||||
} else if len(locks.Locks) == 0 {
|
||||
findings = append(findings, okFinding("locks", "no publish locks"))
|
||||
} else {
|
||||
for _, lock := range locks.Locks.All {
|
||||
for _, lock := range locks.Locks {
|
||||
findings = append(findings, warnFinding("locks", fmt.Sprintf("%s locked: %s", lock.Source, strings.TrimSpace(lock.Reason))))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user