Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chrlic committed Nov 22, 2023
1 parent cba0a0f commit 8099339
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/instrumentation/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export %[4]s=$( { nginx -v ; } 2>&1 ) && echo ${%[4]s##*/} > %[3]s/version.txt
cloneContainer.LivenessProbe = nil
cloneContainer.ReadinessProbe = nil
cloneContainer.StartupProbe = nil
// remove lifecycle spec, since not supported on init containers
cloneContainer.Lifecycle = nil

pod.Spec.InitContainers = append(pod.Spec.InitContainers, *cloneContainer)

Expand Down
4 changes: 3 additions & 1 deletion pkg/instrumentation/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func TestInjectNginxSDK(t *testing.T) {
},
},
}},
// === Test Removal of probes =============================
// === Test Removal of probes and lifecycle =============================
{
name: "Probes removed on clone init container",
Nginx: v1alpha1.Nginx{
Expand All @@ -267,6 +267,7 @@ func TestInjectNginxSDK(t *testing.T) {
ReadinessProbe: &corev1.Probe{},
StartupProbe: &corev1.Probe{},
LivenessProbe: &corev1.Probe{},
Lifecycle: &corev1.Lifecycle{},
},
},
},
Expand Down Expand Up @@ -351,6 +352,7 @@ func TestInjectNginxSDK(t *testing.T) {
ReadinessProbe: &corev1.Probe{},
StartupProbe: &corev1.Probe{},
LivenessProbe: &corev1.Probe{},
Lifecycle: &corev1.Lifecycle{},
Env: []corev1.EnvVar{
{
Name: "LD_LIBRARY_PATH",
Expand Down

0 comments on commit 8099339

Please sign in to comment.