This commit is contained in:
Josh Soref 2020-11-27 12:26:53 -05:00
parent fe65e9d22f
commit a8728f3d2c
38 changed files with 1120 additions and 1120 deletions

View file

@ -301,7 +301,7 @@ func (n *NGINXController) getStreamServices(configmapName string, proto apiv1.Pr
nginx.StreamPort,
}
reserverdPorts := sets.NewInt(rp...)
reservedPorts := sets.NewInt(rp...)
// svcRef format: <(str)namespace>/<(str)service>:<(intstr)port>[:<("PROXY")decode>:<("PROXY")encode>]
for port, svcRef := range configmap.Data {
externalPort, err := strconv.Atoi(port) // #nosec
@ -309,7 +309,7 @@ func (n *NGINXController) getStreamServices(configmapName string, proto apiv1.Pr
klog.Warningf("%q is not a valid %v port number", port, proto)
continue
}
if reserverdPorts.Has(externalPort) {
if reservedPorts.Has(externalPort) {
klog.Warningf("Port %d cannot be used for %v stream services. It is reserved for the Ingress controller.", externalPort, proto)
continue
}
@ -1451,7 +1451,7 @@ func extractTLSSecretName(host string, ing *ingress.Ingress,
return ""
}
// getRemovedHosts returns a list of the hostsnames
// getRemovedHosts returns a list of the hostnames
// that are not associated anymore to the NGINX configuration.
func getRemovedHosts(rucfg, newcfg *ingress.Configuration) []string {
old := sets.NewString()

View file

@ -1404,7 +1404,7 @@ func TestGetBackendServers(t *testing.T) {
}
if upstreams[0].Name != "example-http-svc-1-80" {
t.Errorf("example-http-svc-1-80 should be frist upstream, got %s", upstreams[0].Name)
t.Errorf("example-http-svc-1-80 should be first upstream, got %s", upstreams[0].Name)
return
}
if upstreams[0].NoServer {

View file

@ -86,7 +86,7 @@ var (
true,
false,
},
"when secure backend, stickeness and dynamic config enabled": {
"when secure backend, stickiness and dynamic config enabled": {
"/",
"/",
"/",
@ -874,10 +874,10 @@ func TestEscapeLiteralDollar(t *testing.T) {
t.Errorf("Expected %v but returned %v", expected, escapedPath)
}
leaveUnchagned := "/leave-me/unchagned"
escapedPath = escapeLiteralDollar(leaveUnchagned)
if escapedPath != leaveUnchagned {
t.Errorf("Expected %v but returned %v", leaveUnchagned, escapedPath)
leaveUnchanged := "/leave-me/unchanged"
escapedPath = escapeLiteralDollar(leaveUnchanged)
if escapedPath != leaveUnchanged {
t.Errorf("Expected %v but returned %v", leaveUnchanged, escapedPath)
}
escapedPath = escapeLiteralDollar(false)