Merge pull request #12966 from heww/cherry-pick-to-fix-12938

[Cherry pick]fix(scanner): move RemoveImmutableScanners before EnsureScanners
This commit is contained in:
He Weiwei 2020-09-07 12:26:57 +08:00 committed by GitHub
commit b0f807ecea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {