mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
fix(scanner): move RemoveImmutableScanners before EnsureScanners (#12957)
RemoveImmutableScanners may delete the default scanner, so move it before the EnsureScanners. Closes #12938 Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
parent
262f22f5ef
commit
f4938ca966
@ -259,6 +259,10 @@ func registerScanners() {
|
||||
uninstallScannerNames = append(uninstallScannerNames, clairScanner)
|
||||
}
|
||||
|
||||
if err := scan.RemoveImmutableScanners(uninstallScannerNames); err != nil {
|
||||
log.Warningf("failed to remove scanners: %v", err)
|
||||
}
|
||||
|
||||
if err := scan.EnsureScanners(wantedScanners); err != nil {
|
||||
log.Fatalf("failed to register scanners: %v", err)
|
||||
}
|
||||
@ -269,11 +273,6 @@ func registerScanners() {
|
||||
log.Fatalf("failed to set default scanner: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := scan.RemoveImmutableScanners(uninstallScannerNames); err != nil {
|
||||
log.Warningf("failed to remove scanners: %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func getDefaultScannerName() string {
|
||||
|
Loading…
Reference in New Issue
Block a user