Skip to content
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

Merged
merged 9 commits into from
Oct 29, 2018
Merged

Add nginx debug flag #401

merged 9 commits into from
Oct 29, 2018

Conversation

Dean-Coakley
Copy link
Contributor

@Dean-Coakley Dean-Coakley commented Oct 19, 2018

Proposed changes

  • Add nginx-debug flag
  • Add nginxDebug option to helm chart

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@Dean-Coakley Dean-Coakley added the enhancement Pull requests for new features/feature enhancements label Oct 19, 2018
@Dean-Coakley Dean-Coakley self-assigned this Oct 19, 2018
Copy link
Contributor

@pleshakov pleshakov left a 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

@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add . after ConfigMap

@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add . after ConfigMap

@@ -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
Copy link
Contributor

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

internal/nginx/nginx.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pleshakov pleshakov left a 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

docs/cli-arguments.md Outdated Show resolved Hide resolved
docs/cli-arguments.md Outdated Show resolved Hide resolved
@@ -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),
Copy link
Contributor

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.

internal/nginx/nginx.go Outdated Show resolved Hide resolved
internal/nginx/nginx.go Show resolved Hide resolved
cmd/nginx-ingress/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pleshakov pleshakov left a 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

@@ -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) {
Copy link
Contributor

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

expected string
}{
{"reload", "/usr/sbin/nginx -s reload"},
{"start", "/usr/sbin/nginx -s start"},
Copy link
Contributor

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
@Dean-Coakley Dean-Coakley merged commit d0bea69 into master Oct 29, 2018
@Dean-Coakley Dean-Coakley deleted the add-nginx-debug branch October 29, 2018 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants