From 76974f2f471e14d8c4d5c4981d6755de3d16770e Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 5 Jul 2023 21:08:34 +0000 Subject: [PATCH] Fix failure to set default audit-log-path If audit-log-path is not set when audit-policy-file is set, use default value Signed-off-by: Brad Davidson --- pkg/podexecutor/staticpod.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/podexecutor/staticpod.go b/pkg/podexecutor/staticpod.go index 5dfc71affc..a8ff5f8246 100644 --- a/pkg/podexecutor/staticpod.go +++ b/pkg/podexecutor/staticpod.go @@ -280,10 +280,11 @@ func (s *StaticPodConfig) APIServer(_ context.Context, etcdReady <-chan struct{} "--audit-log-maxbackup=10", "--audit-log-maxsize=100", } - args = append(extraArgs, args...) if auditLogFile == "" { auditLogFile = filepath.Join(s.DataDir, "server/logs/audit.log") + extraArgs = append(extraArgs, "--audit-log-path="+auditLogFile) } + args = append(extraArgs, args...) } args = append([]string{"--admission-control-config-file=" + s.PSAConfigFile}, args...)