Unverified Commit f4938ca9 authored by He Weiwei's avatar He Weiwei Committed by GitHub
Browse files

fix(scanner): move RemoveImmutableScanners before EnsureScanners (#12957)



RemoveImmutableScanners may delete the default scanner, so move it
before the EnsureScanners.

Closes #12938
Signed-off-by: default avatarHe Weiwei <hweiwei@vmware.com>
parent 262f22f5
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment