From f99985c49c523ccb5f92d7bd4070e65299e2d267 Mon Sep 17 00:00:00 2001 From: Gianni Carafa Date: Thu, 24 Sep 2020 20:31:21 +0200 Subject: [PATCH] Run Auditlocal, even when kubeaudit detected to run in a cluster. (#304) --- cmd/commands/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/commands/root.go b/cmd/commands/root.go index b844d3ea..3ad6841a 100644 --- a/cmd/commands/root.go +++ b/cmd/commands/root.go @@ -100,7 +100,7 @@ func getReport(auditors ...kubeaudit.Auditable) *kubeaudit.Report { return report } - if k8s.IsRunningInCluster(k8s.DefaultClient) { + if ( k8s.IsRunningInCluster(k8s.DefaultClient) && rootConfig.kubeConfig == "" ) { report, err := auditor.AuditCluster(k8s.ClientOptions{Namespace: rootConfig.namespace}) if err != nil { log.WithError(err).Fatal("Error auditing cluster")