-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add nginx-debug flag * Add nginx-debug flag documentation * Add nginxDebug support to helm chart * Add unit test for getNginxCommand
- Loading branch information
1 parent
814c10f
commit d0bea69
Showing
10 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package nginx | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestGetNginxCommand(t *testing.T) { | ||
tests := []struct { | ||
cmd string | ||
nginxBinaryPath string | ||
expected string | ||
}{ | ||
{"reload", "/usr/sbin/nginx", "/usr/sbin/nginx -s reload"}, | ||
{"stop", "/usr/sbin/nginx-debug", "/usr/sbin/nginx-debug -s stop"}, | ||
} | ||
for _, test := range tests { | ||
t.Run(test.cmd, func(t *testing.T) { | ||
nginx := NewNginxController("/etc/nginx", test.nginxBinaryPath, true) | ||
|
||
if got := nginx.getNginxCommand(test.cmd); got != test.expected { | ||
t.Errorf("getNginxCommand returned \n%v, but expected \n%v", got, test.expected) | ||
} | ||
}) | ||
} | ||
} |