mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-21 23:21:26 +01:00
refactor: Use if/else statements
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
This commit is contained in:
parent
4755439b75
commit
fdf70f5dc9
@ -220,9 +220,7 @@ func main() {
|
||||
if err := scan.EnsureScanner(reg, true); err != nil {
|
||||
log.Fatalf("failed to register Trivy scanner: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if !config.WithTrivy() {
|
||||
} else {
|
||||
log.Debug("Removing Trivy scanner")
|
||||
if err := scan.RemoveImmutableScanner(config.TrivyAdapterURL()); err != nil {
|
||||
log.Warningf("failed to remove Trivy scanner: %v", err)
|
||||
@ -250,9 +248,7 @@ func main() {
|
||||
if err := scan.EnsureScanner(reg, true); err != nil {
|
||||
log.Fatalf("failed to register Clair scanner: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if !config.WithClair() {
|
||||
} else {
|
||||
log.Debug("Removing Clair scanner")
|
||||
if err := scan.RemoveImmutableScanner(config.ClairAdapterEndpoint()); err != nil {
|
||||
log.Warningf("failed to remove Clair scanners: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user