Skip to content

Commit 9e8264f

Browse files
Merge branch 'main' into chore/improving-set-targets
2 parents be48c0f + 712cfe3 commit 9e8264f

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: bug_fix
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: auto-instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Apache instrumentation sidecar fails to start if target container define lifecycle
9+
10+
# One or more tracking issues related to the change
11+
issues: [3547]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.16.5
498498
# renovate: datasource=go depName=github.com/golangci/golangci-lint/cmd/golangci-lint
499499
GOLANGCI_LINT_VERSION ?= v1.57.2
500500
# renovate: datasource=go depName=sigs.k8s.io/kind
501-
KIND_VERSION ?= v0.25.0
501+
KIND_VERSION ?= v0.26.0
502502
# renovate: datasource=go depName=github.com/kyverno/chainsaw
503503
CHAINSAW_VERSION ?= v0.2.12
504504

pkg/instrumentation/apachehttpd.go

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ func injectApacheHttpdagent(_ logr.Logger, apacheSpec v1alpha1.ApacheHttpd, pod
103103
cloneContainer.LivenessProbe = nil
104104
cloneContainer.ReadinessProbe = nil
105105
cloneContainer.StartupProbe = nil
106+
// remove lifecycle, since not supported on init containers
107+
cloneContainer.Lifecycle = nil
106108

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

pkg/instrumentation/apachehttpd_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func TestInjectApacheHttpdagent(t *testing.T) {
215215
},
216216
},
217217
},
218-
// === Test Removal of probes =============================
218+
// === Test Removal of probes and lifecycle =============================
219219
{
220220
name: "Probes removed on clone init container",
221221
ApacheHttpd: v1alpha1.ApacheHttpd{Image: "foo/bar:1"},
@@ -226,6 +226,7 @@ func TestInjectApacheHttpdagent(t *testing.T) {
226226
ReadinessProbe: &corev1.Probe{},
227227
StartupProbe: &corev1.Probe{},
228228
LivenessProbe: &corev1.Probe{},
229+
Lifecycle: &corev1.Lifecycle{},
229230
},
230231
},
231232
},
@@ -307,6 +308,7 @@ func TestInjectApacheHttpdagent(t *testing.T) {
307308
ReadinessProbe: &corev1.Probe{},
308309
StartupProbe: &corev1.Probe{},
309310
LivenessProbe: &corev1.Probe{},
311+
Lifecycle: &corev1.Lifecycle{},
310312
},
311313
},
312314
},

tests/e2e-instrumentation/instrumentation-apache-httpd/01-install-app.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ spec:
2626
allowPrivilegeEscalation: false
2727
capabilities:
2828
drop: ["ALL"]
29+
# following to test lifecycle removal in cloned init container
30+
lifecycle:
31+
postStart:
32+
exec:
33+
command: [ "/bin/sh", "-c", "echo Hello from the postStart handler" ]
2934
ports:
3035
- containerPort: 8080
3136
resources:

0 commit comments

Comments
 (0)