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 ServerStatusZones support in vs/vsr #693

Merged
merged 2 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/configs/version2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type UpstreamServer struct {
// Server defines a server.
type Server struct {
ServerName string
StatusZone string
ProxyProtocol bool
SSL *SSL
RedirectToHTTPSBasedOnXForwarderProto bool
Expand Down
1 change: 1 addition & 0 deletions internal/configs/version2/nginx-plus.virtualserver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ server {
listen 80{{ if $s.ProxyProtocol }} proxy_protocol{{ end }};

server_name {{ $s.ServerName }};
status_zone {{ $s.StatusZone }};

{{ with $ssl := $s.SSL }}
listen 443 ssl{{ if $ssl.HTTP2 }} http2{{ end }}{{ if $s.ProxyProtocol }} proxy_protocol{{ end }};
Expand Down
1 change: 1 addition & 0 deletions internal/configs/version2/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ var virtualServerCfg = VirtualServerConfig{
},
Server: Server{
ServerName: "example.com",
StatusZone: "example.com",
ProxyProtocol: true,
SSL: &SSL{
HTTP2: true,
Expand Down
1 change: 1 addition & 0 deletions internal/configs/virtualserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ func generateVirtualServerConfig(virtualServerEx *VirtualServerEx, tlsPemFileNam
StatusMatches: statusMatches,
Server: version2.Server{
ServerName: virtualServerEx.VirtualServer.Spec.Host,
StatusZone: virtualServerEx.VirtualServer.Spec.Host,
ProxyProtocol: baseCfgParams.ProxyProtocol,
SSL: ssl,
RedirectToHTTPSBasedOnXForwarderProto: baseCfgParams.RedirectToHTTPS,
Expand Down
3 changes: 3 additions & 0 deletions internal/configs/virtualserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func TestGenerateVirtualServerConfig(t *testing.T) {
},
Server: version2.Server{
ServerName: "cafe.example.com",
StatusZone: "cafe.example.com",
ProxyProtocol: true,
RedirectToHTTPSBasedOnXForwarderProto: true,
ServerTokens: "off",
Expand Down Expand Up @@ -456,6 +457,7 @@ func TestGenerateVirtualServerConfigForVirtualServerWithSplits(t *testing.T) {
},
Server: version2.Server{
ServerName: "cafe.example.com",
StatusZone: "cafe.example.com",
InternalRedirectLocations: []version2.InternalRedirectLocation{
{
Path: "/tea",
Expand Down Expand Up @@ -713,6 +715,7 @@ func TestGenerateVirtualServerConfigForVirtualServerWithRules(t *testing.T) {
},
Server: version2.Server{
ServerName: "cafe.example.com",
StatusZone: "cafe.example.com",
InternalRedirectLocations: []version2.InternalRedirectLocation{
{
Path: "/tea",
Expand Down