-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nginx debug flag #401
Add nginx debug flag #401
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my suggestions
cmd/nginx-ingress/main.go
Outdated
@@ -91,6 +91,9 @@ The external address of the service is used when reporting the status of Ingress | |||
|
|||
nginxStatus = flag.Bool("nginx-status", true, | |||
"Enable the NGINX stub_status, or the NGINX Plus API.") | |||
|
|||
nginxDebug = flag.Bool("nginx-debug", false, | |||
"Enable debugging for NGINX. Uses the `nginx-debug` binary. Requires 'error-log-level: debug' in the ConfigMap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add .
after ConfigMap
cmd/nginx-ingress/main.go
Outdated
@@ -91,6 +91,9 @@ The external address of the service is used when reporting the status of Ingress | |||
|
|||
nginxStatus = flag.Bool("nginx-status", true, | |||
"Enable the NGINX stub_status, or the NGINX Plus API.") | |||
|
|||
nginxDebug = flag.Bool("nginx-debug", false, | |||
"Enable debugging for NGINX. Uses the `nginx-debug` binary. Requires 'error-log-level: debug' in the ConfigMap") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add .
after ConfigMap
deployments/helm-chart/README.md
Outdated
@@ -61,6 +61,7 @@ Parameter | Description | Default | |||
`controller.kind` | The kind of the Ingress controller installation - deployment or daemonset. | deployment | |||
`controller.nginxplus` | Deploys the Ingress controller for NGINX Plus. | false | |||
`controller.hostNetwork` | Enables the Ingress controller pods to use the host's network namespace. | false | |||
`controller.nginxDebug` | Enables debugging for NGINX. Uses the `nginx-debug` binary. Requires `error-log-level: debug` in the ConfigMap via `controller.config.entries` | false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .
after controller.config.entries
1c1ac17
to
ffbe338
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my suggestions
internal/nginx/nginx.go
Outdated
@@ -202,6 +204,7 @@ func NewNginxController(nginxConfPath string, local bool) *Controller { | |||
nginxConfdPath: path.Join(nginxConfPath, "conf.d"), | |||
nginxSecretsPath: path.Join(nginxConfPath, "secrets"), | |||
local: local, | |||
nginxBinaryPath: path.Join("/usr/sbin/", nginxBinary), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not to set the absolute path in main.go
? similar to nginxConfPath
parameter.
* Add unit test for getNginxCommand * Fix cli-args documentation * nginxBinaryPath is now the second arg in NewNginxController
56629d3
to
14867b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my suggestions
internal/nginx/configurator_test.go
Outdated
@@ -852,3 +851,29 @@ func TestUpdateEndpointsMergeableIngressFailsWithInvalidTemplate(t *testing.T) { | |||
t.Errorf("UpdateEndpointsMergeableIngress returned \n%v, but expected \n%v", nil, "template execution error") | |||
} | |||
} | |||
|
|||
func TestGetNginxCommand(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test must be in nginx_test.go
you don't need to create a configurator, only the Controller
internal/nginx/configurator_test.go
Outdated
expected string | ||
}{ | ||
{"reload", "/usr/sbin/nginx -s reload"}, | ||
{"start", "/usr/sbin/nginx -s start"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the start one
* Improved test by allowing it to take an argument to specify which nginx binary you want to use in the configurator
Proposed changes
nginx-debug
flagnginxDebug
option to helm chartChecklist
Before creating a PR, run through this checklist and mark each as complete.