mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-05 18:20:37 +01:00
Merge pull request #12966 from heww/cherry-pick-to-fix-12938
[Cherry pick]fix(scanner): move RemoveImmutableScanners before EnsureScanners
This commit is contained in:
commit
b0f807ecea
@ -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