Skip to content

Commit 8dedb6e

Browse files
committed
Remove default debug value and change container command
1 parent 472374d commit 8dedb6e

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

apis/v1alpha2/nginxproxy_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ type ContainerSpec struct {
438438
// Debug enables debugging for NGINX by using the nginx-debug binary.
439439
//
440440
// +optional
441-
// +kubebuilder:default=false
442441
Debug *bool `json:"debug,omitempty"`
443442

444443
// Image is the NGINX image to use.

build/entrypoint.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ rm -rf /var/run/nginx/*.sock
1616

1717
# Launch nginx
1818
echo "starting nginx ..."
19-
/usr/sbin/nginx -g "daemon off;" &
19+
20+
# if we want to use the nginx-debug binary, we will call this script with an argument "debug"
21+
if [ "${1:-false}" = "debug" ]; then
22+
/usr/sbin/nginx-debug -g "daemon off;" &
23+
else
24+
/usr/sbin/nginx -g "daemon off;" &
25+
fi
2026

2127
nginx_pid=$!
2228

@@ -31,7 +37,7 @@ done
3137

3238
# start nginx-agent, pass args
3339
echo "starting nginx-agent ..."
34-
nginx-agent "$@" &
40+
nginx-agent &
3541

3642
agent_pid=$!
3743

config/crd/bases/gateway.nginx.org_nginxproxies.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ spec:
8080
container.
8181
properties:
8282
debug:
83-
default: false
8483
description: Debug enables debugging for NGINX by using
8584
the nginx-debug binary.
8685
type: boolean

deploy/crds.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ spec:
665665
container.
666666
properties:
667667
debug:
668-
default: false
669668
description: Debug enables debugging for NGINX by using
670669
the nginx-debug binary.
671670
type: boolean

internal/mode/static/provisioner/objects.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
449449
container.VolumeMounts = append(container.VolumeMounts, containerSpec.VolumeMounts...)
450450

451451
if containerSpec.Debug != nil && *containerSpec.Debug {
452-
container.Command = append(container.Command, "/bin/sh")
453-
container.Args = append(container.Args, "-c", "rm -rf /var/run/nginx/*sock && nginx-debug -g 'daemon off;'")
452+
container.Command = append(container.Command, "/agent/entrypoint.sh")
453+
container.Args = append(container.Args, "debug")
454454
}
455455
spec.Spec.Containers[0] = container
456456
}

0 commit comments

Comments
 (0)