diff --git a/internal/mode/static/nginx/config/generator.go b/internal/mode/static/nginx/config/generator.go index fcb2c0c03..df43d0fb5 100644 --- a/internal/mode/static/nginx/config/generator.go +++ b/internal/mode/static/nginx/config/generator.go @@ -47,9 +47,6 @@ const ( // streamConfigFile is the path to the configuration file with Stream configuration. streamConfigFile = streamFolder + "/stream.conf" - // configVersionFile is the path to the config version configuration file. - configVersionFile = httpFolder + "/config-version.conf" - // httpMatchVarsFile is the path to the http_match pairs configuration file. httpMatchVarsFile = httpFolder + "/matches.json" @@ -60,10 +57,6 @@ const ( mgmtIncludesFile = mainIncludesFolder + "/mgmt.conf" ) -// ConfigFolders is a list of folders where NGINX configuration files are stored. -// Volumes here also need to be added to our crossplane ephemeral test container. -var ConfigFolders = []string{httpFolder, secretsFolder, includesFolder, mainIncludesFolder, streamFolder} - // Generator generates NGINX configuration files. // This interface is used for testing purposes only. type Generator interface { @@ -198,7 +191,6 @@ func (g GeneratorImpl) getExecuteFuncs( g.executeStreamServers, g.executeStreamUpstreams, executeStreamMaps, - executeVersion, } } diff --git a/internal/mode/static/nginx/config/version.go b/internal/mode/static/nginx/config/version.go deleted file mode 100644 index 6e29f3605..000000000 --- a/internal/mode/static/nginx/config/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package config - -import ( - gotemplate "text/template" - - "github.com/nginxinc/nginx-gateway-fabric/internal/framework/helpers" - "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/state/dataplane" -) - -var versionTemplate = gotemplate.Must(gotemplate.New("version").Parse(versionTemplateText)) - -func executeVersion(conf dataplane.Configuration) []executeResult { - result := executeResult{ - dest: configVersionFile, - data: helpers.MustExecuteTemplate(versionTemplate, conf.Version), - } - - return []executeResult{result} -} diff --git a/internal/mode/static/nginx/config/version_template.go b/internal/mode/static/nginx/config/version_template.go deleted file mode 100644 index ccf46e02c..000000000 --- a/internal/mode/static/nginx/config/version_template.go +++ /dev/null @@ -1,12 +0,0 @@ -package config - -const versionTemplateText = ` -server { - listen unix:/var/run/nginx/nginx-config-version.sock; - access_log off; - - location /version { - return 200 {{.}}; - } -} -` diff --git a/internal/mode/static/nginx/config/version_test.go b/internal/mode/static/nginx/config/version_test.go deleted file mode 100644 index 3d30c6c3b..000000000 --- a/internal/mode/static/nginx/config/version_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package config - -import ( - "testing" - - . "github.com/onsi/gomega" - - "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/state/dataplane" -) - -func TestExecuteVersion(t *testing.T) { - t.Parallel() - g := NewWithT(t) - - conf := dataplane.Configuration{Version: 42} - res := executeVersion(conf) - g.Expect(res).To(HaveLen(1)) - g.Expect(res[0].dest).To(Equal(configVersionFile)) - g.Expect(string(res[0].data)).To(ContainSubstring("return 200 42;")) -}