Skip to content

Commit fd8ccaf

Browse files
committed
Update directory structure
Problem: Now that the original provisioner mode has been removed, we don't need the nested `mode/static` directory structure. The naming no longer makes sense. Solution: Updated `mode/static` directory to `controller`, and moved some of the `framework` packages into `controller`. Other packages in `framework` were left alone since many of them are general enough for "controller building" use.
1 parent b7c7c2d commit fd8ccaf

File tree

291 files changed

+1298
-1371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+1298
-1371
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ jobs:
149149
sbom: true
150150
provenance: mode=max
151151
build-args: |
152-
NJS_DIR=internal/mode/static/nginx/modules/src
153-
NGINX_CONF_DIR=internal/mode/static/nginx/conf
152+
NJS_DIR=internal/controller/nginx/modules/src
153+
NGINX_CONF_DIR=internal/controller/nginx/conf
154154
BUILD_AGENT=gha
155155
secrets: |
156156
${{ contains(inputs.image, 'plus') && format('"nginx-repo.crt={0}"', secrets.NGINX_CRT) || '' }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
node-version-file: .nvmrc
120120

121121
- name: Run tests
122-
run: npm --prefix ${{ github.workspace }}/internal/mode/static/nginx/modules install-ci-test
122+
run: npm --prefix ${{ github.workspace }}/internal/controller/nginx/modules install-ci-test
123123

124124
- name: Upload coverage reports to Codecov
125125
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3

.github/workflows/conformance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ jobs:
106106
cache-from: type=gha,scope=${{ inputs.image }}
107107
pull: true
108108
build-args: |
109-
NJS_DIR=internal/mode/static/nginx/modules/src
110-
NGINX_CONF_DIR=internal/mode/static/nginx/conf
109+
NJS_DIR=internal/controller/nginx/modules/src
110+
NGINX_CONF_DIR=internal/controller/nginx/conf
111111
BUILD_AGENT=gha
112112
113113
- name: Update Go Modules

.github/workflows/functional.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
cache-from: type=gha,scope=${{ inputs.image }}
101101
pull: true
102102
build-args: |
103-
NJS_DIR=internal/mode/static/nginx/modules/src
104-
NGINX_CONF_DIR=internal/mode/static/nginx/conf
103+
NJS_DIR=internal/controller/nginx/modules/src
104+
NGINX_CONF_DIR=internal/controller/nginx/conf
105105
BUILD_AGENT=gha
106106
107107
- name: Setup license file for plus

.github/workflows/helm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ jobs:
8080
cache-from: type=gha,scope=${{ inputs.image }}
8181
pull: true
8282
build-args: |
83-
NJS_DIR=internal/mode/static/nginx/modules/src
84-
NGINX_CONF_DIR=internal/mode/static/nginx/conf
83+
NJS_DIR=internal/controller/nginx/modules/src
84+
NGINX_CONF_DIR=internal/controller/nginx/conf
8585
BUILD_AGENT=gha
8686
8787
- name: Install cloud-provider-kind

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
id: prettier-run
5959
uses: rutajdash/prettier-cli-action@d42c4325a3b344f3bd4be482bc34de521998d557 # v1.0.2
6060
with:
61-
config_path: ${{ github.workspace }}/internal/mode/static/nginx/modules/.prettierrc
62-
file_pattern: ${{ github.workspace }}/internal/mode/static/nginx/modules/**/*.js
61+
config_path: ${{ github.workspace }}/internal/controller/nginx/modules/.prettierrc
62+
file_pattern: ${{ github.workspace }}/internal/controller/nginx/modules/**/*.js
6363
prettier_version: 3.3.3 # renovate: datasource=npm depName=prettier
6464

6565
- name: Prettier Output

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ tests/**/*.csv
3737
node_modules/
3838

3939
# JS test coverage
40-
internal/mode/static/nginx/modules/coverage
40+
internal/controller/nginx/modules/coverage
4141

4242
# MacOS Finder
4343
.DS_Store

.gitleaksignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
68d1f6eb80d23c8650c11629459dd6a06c986ca1:internal/state/graph/graph_test.go:private-key:44
44
890fddb787ff3560b9b743647a36b649d498ae51:internal/state/graph/secret_test.go:private-key:35
55
890fddb787ff3560b9b743647a36b649d498ae51:internal/state/change_processor_test.go:private-key:211
6-
internal/mode/static/state/graph/config_maps_test.go:private-key:35
6+
internal/controller/state/graph/config_maps_test.go:private-key:35

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
VERSION = edge
33
SELF_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
44
CHART_DIR = $(SELF_DIR)charts/nginx-gateway-fabric
5-
NGINX_CONF_DIR = internal/mode/static/nginx/conf
6-
NJS_DIR = internal/mode/static/nginx/modules/src
5+
NGINX_CONF_DIR = internal/controller/nginx/conf
6+
NJS_DIR = internal/controller/nginx/modules/src
77
KIND_CONFIG_FILE = $(SELF_DIR)config/cluster/kind-cluster.yaml
88
NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=$(SELF_DIR)nginx-repo.crt --secret id=nginx-repo.key,src=$(SELF_DIR)nginx-repo.key
99
BUILD_AGENT = local
@@ -202,7 +202,7 @@ unit-test: ## Run unit tests for the go code
202202
.PHONY: njs-unit-test
203203
njs-unit-test: ## Run unit tests for the njs httpmatches module
204204
docker run --rm -w /modules \
205-
-v $(CURDIR)/internal/mode/static/nginx/modules:/modules/ \
205+
-v $(CURDIR)/internal/controller/nginx/modules:/modules/ \
206206
node:${NODE_VERSION} \
207207
/bin/bash -c "npm ci && npm test && npm run clean"
208208

cmd/gateway/commands.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020
"sigs.k8s.io/controller-runtime/pkg/log"
2121
ctlrZap "sigs.k8s.io/controller-runtime/pkg/log/zap"
2222

23+
"github.com/nginx/nginx-gateway-fabric/internal/controller"
24+
"github.com/nginx/nginx-gateway-fabric/internal/controller/config"
25+
"github.com/nginx/nginx-gateway-fabric/internal/controller/licensing"
26+
ngxConfig "github.com/nginx/nginx-gateway-fabric/internal/controller/nginx/config"
2327
"github.com/nginx/nginx-gateway-fabric/internal/framework/file"
24-
"github.com/nginx/nginx-gateway-fabric/internal/mode/static"
25-
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/config"
26-
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/licensing"
27-
ngxConfig "github.com/nginx/nginx-gateway-fabric/internal/mode/static/nginx/config"
2828
)
2929

3030
// These flags are shared by multiple commands.
@@ -259,7 +259,7 @@ func createControllerCommand() *cobra.Command {
259259
NGINXSCCName: nginxSCCName.value,
260260
}
261261

262-
if err := static.StartManager(conf); err != nil {
262+
if err := controller.StartManager(conf); err != nil {
263263
return fmt.Errorf("failed to start control loop: %w", err)
264264
}
265265

0 commit comments

Comments
 (0)