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")