Skip to content

Commit

Permalink
Merge pull request #376 from fmount/dumb-init
Browse files Browse the repository at this point in the history
Move -log sidecar container to dumb-init
  • Loading branch information
openshift-merge-bot[bot] authored Dec 1, 2023
2 parents 120de04 + 0860fe3 commit 1cede1d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
11 changes: 9 additions & 2 deletions pkg/glanceapi/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,16 @@ func StatefulSet(
{
Name: glance.ServiceName + "-log",
Command: []string{
"/bin/bash",
"/usr/bin/dumb-init",
},
Args: []string{
"--single-child",
"--",
"/usr/bin/tail",
"-n+1",
"-F",
string(glance.GlanceLogPath + instance.Name + ".log"),
},
Args: []string{"-c", "tail -n+1 -F " + glance.GlanceLogPath + instance.Name + ".log"},
Image: instance.Spec.ContainerImage,
SecurityContext: &corev1.SecurityContext{
RunAsUser: &runAsUser,
Expand Down
20 changes: 14 additions & 6 deletions test/kuttl/tests/glance_scale/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ spec:
spec:
containers:
- args:
- -c
- tail -n+1 -F /var/log/glance/glance-external.log
- --single-child
- --
- /usr/bin/tail
- -n+1
- -F
- /var/log/glance/glance-external.log
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-log
- args:
- -c
Expand Down Expand Up @@ -116,10 +120,14 @@ spec:
spec:
containers:
- args:
- -c
- tail -n+1 -F /var/log/glance/glance-internal.log
- --single-child
- --
- /usr/bin/tail
- -n+1
- -F
- /var/log/glance/glance-internal.log
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-log
- args:
- -c
Expand Down
10 changes: 7 additions & 3 deletions test/kuttl/tests/glance_single/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ spec:
spec:
containers:
- args:
- -c
- tail -n+1 -F /var/log/glance/glance-single.log
- --single-child
- --
- /usr/bin/tail
- -n+1
- -F
- /var/log/glance/glance-single.log
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-log
- args:
- -c
Expand Down

0 comments on commit 1cede1d

Please sign in to comment.