Skip to content

Commit

Permalink
Fix OADP-5183: Ensure containers are all using FallbackToLogsOnError …
Browse files Browse the repository at this point in the history
…in terminationMessagePolicy
  • Loading branch information
shubham-pampattiwar committed Nov 14, 2024
1 parent bead97f commit d55863c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions bundle/manifests/oadp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ spec:
path: /healthz
port: 8081
periodSeconds: 10
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/run/secrets/openshift/serviceaccount
name: bound-sa-token
Expand Down
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
image: controller:latest
imagePullPolicy: Always
name: manager
terminationMessagePolicy: FallbackToLogsOnError
securityContext:
allowPrivilegeEscalation: false
startupProbe:
Expand Down
2 changes: 1 addition & 1 deletion controllers/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func setContainerDefaults(container *corev1.Container) {
container.TerminationMessagePath = "/dev/termination-log"
}
if container.TerminationMessagePolicy == "" {
container.TerminationMessagePolicy = corev1.TerminationMessageReadFile
container.TerminationMessagePolicy = corev1.TerminationMessageFallbackToLogsOnError
}
for i := range container.Ports {
if container.Ports[i].Protocol == "" {
Expand Down
2 changes: 1 addition & 1 deletion controllers/nodeagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func createTestBuiltNodeAgentDaemonSet(options TestBuiltNodeAgentDaemonSetOption
Image: common.VeleroImage,
ImagePullPolicy: corev1.PullAlways,
TerminationMessagePath: "/dev/termination-log",
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
SecurityContext: &corev1.SecurityContext{Privileged: ptr.To(true)},
Ports: []corev1.ContainerPort{
{
Expand Down
1 change: 1 addition & 0 deletions controllers/nonadmin_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func ensureRequiredSpecs(deploymentObject *appsv1.Deployment, image string, imag
nonAdminContainer.Image = image
nonAdminContainer.ImagePullPolicy = imagePullPolicy
nonAdminContainer.Env = []corev1.EnvVar{namespaceEnvVar}
nonAdminContainer.TerminationMessagePolicy = corev1.TerminationMessageFallbackToLogsOnError
nonAdminContainerFound = true
break
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/velero.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ func (r *DPAReconciler) appendPluginSpecificSpecs(veleroDeployment *appsv1.Deplo
ImagePullPolicy: imagePullPolicy,
Resources: init_container_resources,
TerminationMessagePath: "/dev/termination-log",
TerminationMessagePolicy: "File",
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
VolumeMounts: []corev1.VolumeMount{
{
MountPath: "/target",
Expand Down Expand Up @@ -494,7 +494,7 @@ func (r *DPAReconciler) appendPluginSpecificSpecs(veleroDeployment *appsv1.Deplo
ImagePullPolicy: imagePullPolicy,
Resources: init_container_resources,
TerminationMessagePath: "/dev/termination-log",
TerminationMessagePolicy: "File",
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
VolumeMounts: []corev1.VolumeMount{
{
MountPath: "/target",
Expand Down
4 changes: 2 additions & 2 deletions controllers/velero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var (
},
},
TerminationMessagePath: "/dev/termination-log",
TerminationMessagePolicy: "File",
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
VolumeMounts: []corev1.VolumeMount{
{MountPath: "/target", Name: "plugins"},
},
Expand Down Expand Up @@ -385,7 +385,7 @@ func createTestBuiltVeleroDeployment(options TestBuiltVeleroDeploymentOptions) *
Image: common.VeleroImage,
ImagePullPolicy: corev1.PullAlways,
TerminationMessagePath: "/dev/termination-log",
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
Ports: []corev1.ContainerPort{{
Name: "metrics",
ContainerPort: 8085,
Expand Down

0 comments on commit d55863c

Please sign in to comment.