diff --git a/pkg/cinderapi/statefuleset.go b/pkg/cinderapi/statefuleset.go index 6ea429f7..bde646ca 100644 --- a/pkg/cinderapi/statefuleset.go +++ b/pkg/cinderapi/statefuleset.go @@ -136,10 +136,9 @@ func StatefulSet( Args: []string{ "--single-child", "--", - "/usr/bin/tail", - "-n+1", - "-F", - LogFile, + "/bin/sh", + "-c", + "/usr/bin/tail -n+1 -F " + LogFile + " 2>/dev/null", }, Image: instance.Spec.ContainerImage, SecurityContext: &corev1.SecurityContext{ diff --git a/templates/cinderapi/config/01-service-defaults.conf b/templates/cinderapi/config/01-service-defaults.conf index a0141b9b..2962dca5 100644 --- a/templates/cinderapi/config/01-service-defaults.conf +++ b/templates/cinderapi/config/01-service-defaults.conf @@ -1,5 +1,8 @@ [DEFAULT] log_file = {{ .LogFile }} +log_rotation_type = size +max_logfile_count = 1 +max_logfile_size_mb = 20 [oslo_policy] enforce_scope = true diff --git a/test/kuttl/common/assert_sample_deployment.yaml b/test/kuttl/common/assert_sample_deployment.yaml index c882aea3..dabb98f0 100644 --- a/test/kuttl/common/assert_sample_deployment.yaml +++ b/test/kuttl/common/assert_sample_deployment.yaml @@ -61,10 +61,9 @@ spec: - args: - --single-child - -- - - /usr/bin/tail - - -n+1 - - -F - - /var/log/cinder/cinder-api.log + - /bin/sh + - -c + - /usr/bin/tail -n+1 -F /var/log/cinder/cinder-api.log 2>/dev/null command: - /usr/bin/dumb-init imagePullPolicy: IfNotPresent diff --git a/test/kuttl/common/assert_tls_sample_deployment.yaml b/test/kuttl/common/assert_tls_sample_deployment.yaml index 8539fc27..41b891b1 100644 --- a/test/kuttl/common/assert_tls_sample_deployment.yaml +++ b/test/kuttl/common/assert_tls_sample_deployment.yaml @@ -60,10 +60,9 @@ spec: - args: - --single-child - -- - - /usr/bin/tail - - -n+1 - - -F - - /var/log/cinder/cinder-api.log + - /bin/sh + - -c + - /usr/bin/tail -n+1 -F /var/log/cinder/cinder-api.log 2>/dev/null volumeMounts: - mountPath: /var/log/cinder name: logs