Skip to content

Commit 84d48e5

Browse files
committed
Run pre-commit on all files
1 parent 011e81f commit 84d48e5

File tree

28 files changed

+82
-82
lines changed

28 files changed

+82
-82
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A clear and concise description of what you expected to happen.
2525
* Kubernetes platform (e.g. Mini-kube or GCP)
2626
* Details on how you expose the NGINX Gateway Pod (e.g. Service of type LoadBalancer or port-forward)
2727
* Logs of NGINX container: `kubectl -n nginx-gateway logs -l app=nginx-gateway -c nginx`
28-
* NGINX Configuration: `kubectl -n nginx-gateway exec <gateway-pod> -c nginx -- nginx -T`
28+
* NGINX Configuration: `kubectl -n nginx-gateway exec <gateway-pod> -c nginx -- nginx -T`
2929

3030
**Additional context**
31-
Add any other context about the problem here. Any log files you want to share.
31+
Add any other context about the problem here. Any log files you want to share.

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
name: Enhancement Request
3-
about: Suggest an enhancement for this project
2+
name: Enhancement Request
3+
about: Suggest an enhancement for this project
44
labels: 'enhancement'
55
---
66

77
<!--
8-
WARNING: Prior to submitting an enhancement request, we ask that you create a discussion. If you have not yet
8+
WARNING: Prior to submitting an enhancement request, we ask that you create a discussion. If you have not yet
99
created a discussion related to your request, please do so now: https://github.com/nginxinc/nginx-kubernetes-gateway/discussions/new?category=ideas
1010
-->
1111

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
name: Gateway Conformance Tests
152152
runs-on: ubuntu-22.04
153153
needs: vars
154-
if: ${{ github.ref_type != 'tag' }}
154+
if: ${{ github.ref_type != 'tag' }}
155155
steps:
156156
- name: Checkout Repository
157157
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@@ -163,7 +163,7 @@ jobs:
163163

164164
- name: Docker Buildx
165165
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2.9.1
166-
166+
167167
- name: Docker meta
168168
id: meta
169169
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
@@ -182,7 +182,7 @@ jobs:
182182
nkg_tag=$(echo ${{ steps.meta.outputs.tags }} | cut -d ":" -f 2)
183183
make update-nkg-manifest NKG_PREFIX=${nkg_prefix} NKG_TAG=${nkg_tag}
184184
working-directory: ./conformance
185-
185+
186186
- name: Build binary
187187
uses: goreleaser/goreleaser-action@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.0
188188
with:
@@ -202,7 +202,7 @@ jobs:
202202
cache-from: type=gha
203203
cache-to: type=gha,mode=max
204204
pull: true
205-
205+
206206
- name: Build Test Docker Image
207207
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
208208
with:

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ DEPENDENCIES:
118118

119119
COMPATIBILITY:
120120
- The Gateway API version: `0.5.1`
121-
- NGINX version: `1.21.x` *
121+
- NGINX version: `1.21.x` *
122122
- Kubernetes version: `1.21+`
123123

124124
\*the installation manifests use the `nginx:1.21` image, which always points to the latest version of 1.21.x releases.
@@ -146,7 +146,7 @@ If you'd like to give us feedback or get involved, see the [README](https://gith
146146

147147
COMPATIBILITY:
148148
- The Gateway API version: `0.5.0`
149-
- NGINX version: `1.21.3`
149+
- NGINX version: `1.21.3`
150150
- Kubernetes version: `1.19+`
151151

152152
CONTAINER IMAGES:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Before beginning development, familiarize yourself with the following documents:
9090
- [Pull Request Guidelines](/docs/developer/pull-request.md): A guide for both pull request submitters and reviewers,
9191
outlining guidelines and best practices to ensure smooth and efficient pull request processes.
9292
- [Go Style Guide](/docs/developer/go-style-guide.md): A coding style guide for Go. Contains best practices and
93-
conventions to follow when writing Go code for the project.
93+
conventions to follow when writing Go code for the project.
9494
- [Architecture](/docs/architecture.md): A high-level overview of the project's architecture.
9595
- [Design Principles](/docs/developer/design-principles.md): An overview of the project's design principles.
9696

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For a list of supported Gateway API resources and features, see the [Gateway API
99
> Warning: This project is actively in development (beta feature state) and should not be deployed in a production environment.
1010
> All APIs, SDKs, designs, and packages are subject to change.
1111
12-
Learn about our [design principles](/docs/developer/design-principles.md) and [architecture](/docs/architecture.md).
12+
Learn about our [design principles](/docs/developer/design-principles.md) and [architecture](/docs/architecture.md).
1313

1414
## Getting Started
1515

conformance/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ load-images: preload-nginx-container ## Load NKG and NGINX containers on configu
4343
.PHONY: prepare-nkg-dependencies
4444
prepare-nkg-dependencies: ## Install NKG dependencies on configured kind cluster
4545
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
46-
kubectl wait --for=condition=available --timeout=60s deployment gateway-api-admission-server -n gateway-system
46+
kubectl wait --for=condition=available --timeout=60s deployment gateway-api-admission-server -n gateway-system
4747
kubectl apply -f ../deploy/manifests/namespace.yaml
4848
kubectl create configmap njs-modules --from-file=../internal/mode/static/nginx/modules/src/httpmatches.js -n nginx-gateway
4949
kubectl apply -f ../deploy/manifests/nginx-conf.yaml

conformance/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ make install-nkg-local-build
6565
```makefile
6666
make install-nkg-local-no-build
6767
```
68-
**Note:** You can optionally skip the actual *build* step. However, if choosing
68+
**Note:** You can optionally skip the actual *build* step. However, if choosing
6969
this option, the following step *must* be completed manually *before* the build step:
7070
* Set NKG_PREFIX=<nkg_repo_name> NKG_TAG=<nkg_image_tag> to preferred values.
7171
* Navigate to `deploy/manifests` and update values in `deployment.yaml` as specified in below code-block.

conformance/provisioner/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ https://github.com/nginxinc/nginx-kubernetes-gateway/issues/634). However, it ca
2020
tests, which expect a Gateway API implementation to provision an independent data plane per Gateway.
2121

2222
> Note: Provisioner uses [this manifest](/deploy/manifests/deployment.yaml) to create an NKG static mode Deployment.
23-
This manifest gets included into the NKG binary during the NKG build. To customize the Deployment, modify the manifest
23+
This manifest gets included into the NKG binary during the NKG build. To customize the Deployment, modify the manifest
2424
and **re-build** NKG.
2525

2626
How to deploy:
@@ -33,7 +33,7 @@ How to deploy:
3333
```
3434
1. Confirm the provisioner is running in nginx-gateway namespace:
3535
```shell
36-
kubectl get pods -n nginx-gateway
36+
kubectl get pods -n nginx-gateway
3737
```
3838
```console
3939
NAME READY STATUS RESTARTS AGE

deploy/manifests/service/nodeport.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: nginx-gateway
55
namespace: nginx-gateway
66
spec:
7-
type: NodePort
7+
type: NodePort
88
ports: # Update the following ports to match your Gateway Listener ports
99
- port: 80
1010
targetPort: 80

docs/cli-help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes the commands available in the `gateway` binary of `nginx
44

55
## Static Mode
66

7-
This command configures NGINX in the scope of a single Gateway resource.
7+
This command configures NGINX in the scope of a single Gateway resource.
88

99
Usage:
1010

docs/developer/design-principles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ users monitor the health of NGINX Kubernetes Gateway and to assist in diagnosing
4949

5050
NGINX Kubernetes Gateway must be easy and intuitive to use. This means that it should be easy to install, easy to
5151
configure, and easy to monitor. Its defaults should be sane and should lead to "out-of-box" success. The documentation
52-
should be clear and provide meaningful examples that customer's can use to inform their deployments and configurations.
52+
should be clear and provide meaningful examples that customer's can use to inform their deployments and configurations.

docs/developer/go-style-guide.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func longFunctionDefinition(
5757
paramZ bool,
5858
) (string, error){}
5959

60-
// and
60+
// and
6161

6262
s := myStruct{
6363
field1: 1,
@@ -73,14 +73,14 @@ func longFunctionDefinition(paramX int, paramY string,
7373
paramZ bool,
7474
) (string, error){}
7575

76-
// or
76+
// or
7777

7878
func longFunctionDefinition(
7979
paramX int, paramY string,
8080
paramZ bool,
8181
) (string, error){}
8282

83-
// or
83+
// or
8484
s := myStruct{field1: 1, field2: 2,
8585
field3: 3}
8686

@@ -174,9 +174,9 @@ dependencies adds side-effects which complicates testing.
174174

175175
DO NOT:
176176

177-
```go
177+
```go
178178
func(int required, int optional) {
179-
if optional {...}
179+
if optional {...}
180180
}
181181
```
182182

@@ -188,13 +188,13 @@ type Option func (o *Object)
188188
func Optional(string optional) Option {
189189
return func (o *Object) {
190190
o.optional = optional
191-
}
191+
}
192192
}
193193

194194
func (int required, ...Options) {
195195
for o := range Options {
196196
o(self)
197-
}
197+
}
198198
}
199199
```
200200

@@ -270,14 +270,14 @@ Example:
270270

271271
```go
272272
func onError(err error) {
273-
// got an asynchronous error
273+
// got an asynchronous error
274274
}
275275

276276
func ReadAsync(r io.Reader, onError) {
277277
err := r()
278278
if err != nil {
279279
onError(err)
280-
}
280+
}
281281
}
282282

283283
go ReadAsync(reader, onError)
@@ -307,12 +307,12 @@ func readFile(filename string) ([]byte, error) {
307307
return nil, fmt.Errorf("failed to open file: %w", err)
308308
}
309309
defer file.Close()
310-
310+
311311
data, err := ioutil.ReadAll(file)
312312
if err != nil {
313313
return nil, fmt.Errorf("failed to read file: %w", err)
314314
}
315-
315+
316316
return data, nil
317317
}
318318

@@ -454,7 +454,7 @@ type Object struct{
454454
func New() *Object {
455455
return &Object{
456456
subobject: &SubObject{},
457-
}
457+
}
458458
}
459459
```
460460

@@ -477,7 +477,7 @@ DO NOT:
477477
```go
478478
func(s string) *string {
479479
s := s + "more strings"
480-
return &s // this will move to heap
480+
return &s // this will move to heap
481481
}
482482
```
483483

docs/developer/pull-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ A FIXME is for things that should be fixed in the future. If FIXMEs cannot be ad
100100
merged, but they _MUST_ include your username and a link to the issue. For example:
101101

102102
```go
103-
// FIXME(username): This is currently a hack to work around known issue X.
103+
// FIXME(username): This is currently a hack to work around known issue X.
104104
// Issue <LINK TO GITHUB ISSUE> will remove need for this work around.
105105
```

docs/developer/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ This will build the docker image `nginx-kubernetes-gateway:<your-user>`.
8787
Alternatively, you can update the image name and pull policy by using the following command when applying
8888
`deployment.yaml`:
8989
90-
```shell
90+
```shell
9191
cat deploy/manifests/deployment.yaml | sed "s|image: ghcr.io/nginxinc/nginx-kubernetes-gateway.*|image: nginx-kubernetes-gateway:$(whoami)|" | sed "s|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|" | kubectl apply -f -
9292
```
9393

docs/developer/testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Testing
22

33
This document provides guidelines for testing, including instructions on running the unit tests, accessing the code
4-
coverage report, performing manual testing, and running the conformance tests. By following these guidelines, you will
4+
coverage report, performing manual testing, and running the conformance tests. By following these guidelines, you will
55
gain a thorough understanding of the project's approach to unit testing, enabling you to ensure code quality, validate
66
functionality, and maintain robust test coverage.
77

@@ -78,13 +78,13 @@ Follow the steps below for manual testing:
7878
```
7979
- The statuses of the Gateway API Resources. Make sure they look correct.
8080
```shell
81-
kubectl describe <resource> <resource name>
81+
kubectl describe <resource> <resource name>
8282
```
83-
- NGINX proxies traffic successfully (when applicable).
83+
- NGINX proxies traffic successfully (when applicable).
8484
- [Examples](/examples) work correctly. This will ensure that your changes have not introduced any regressions.
8585
8686
> **Note**
87-
>
87+
>
8888
> Don't limit yourself to happy path testing. Make an effort to cover various scenarios, including edge cases and potential error conditions. By testing a wide range of scenarios, you can uncover hidden issues and ensure the robustness of your changes.
8989

9090
Performing manual testing helps guarantee the stability, reliability, and effectiveness of your changes before

docs/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ This guide walks you through how to install NGINX Kubernetes Gateway on a generi
7676
You can gain access to NGINX Kubernetes Gateway by creating a `NodePort` Service or a `LoadBalancer` Service.
7777

7878
> Important
79-
>
79+
>
8080
> The Service manifests expose NGINX Kubernetes Gateway on ports 80 and 443, which exposes any Gateway [Listener](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.Listener) configured for those ports. If you'd like to use different ports in your listeners,
81-
> update the manifests accordingly.
81+
> update the manifests accordingly.
8282

8383
### Create a NodePort Service
8484

docs/release-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To create a new release, follow these steps:
3232
4. If a problem is found, prepare a fix PR, merge it into the main branch and return to the previous step.
3333
5. Create a release branch with a name that follows the `release-X.Y` format.
3434
6. Prepare and merge a PR into the release branch to update the repo files for the release:
35-
1. Update the tag of NKG container images used in the installation manifests (both the
35+
1. Update the tag of NKG container images used in the installation manifests (both the
3636
[deployment manifest](../deploy/manifests/deployment.yaml) and the
3737
[provisioner manifest](../conformance/provisioner/provisioner.yaml)) and docs to `X.Y.Z`.
3838
2. Ensure that the `imagePullPolicy` is `IfNotPresent` in the installation manifests.

docs/resource-validation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ For example, if you create an HTTPRoute with an invalid hostname `cafe.!@#$%exam
5353
with the following error:
5454

5555
```shell
56-
kubectl apply -f coffee-route.yaml
56+
kubectl apply -f coffee-route.yaml
5757
```
5858
```
5959
The HTTPRoute "coffee" is invalid: spec.hostnames[0]: Invalid value: "cafe.!@#$%example.com": spec.hostnames[0] in body should match '^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
@@ -70,7 +70,7 @@ you create a Gateway resource with a TCP listener that configures a hostname, th
7070
following error:
7171

7272
```shell
73-
kubectl apply -f prod-gateway.yaml
73+
kubectl apply -f prod-gateway.yaml
7474
```
7575
```
7676
Error from server: error when creating "prod-gateway.yaml": admission webhook "validate.gateway.networking.k8s.io" denied the request: spec.listeners[1].hostname: Forbidden: should be empty for protocol TCP

docs/running-on-kind.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Create a cluster with `kind`. You can follow their [instructions](https://kind.s
1414
```makefile
1515
make create-kind-cluster
1616
```
17-
17+
1818
## Deploy NGINX Kubernetes Gateway
1919

20-
Follow the [installation](./installation.md) instructions to deploy NGINX Kubernetes Gateway on your Kind cluster.
20+
Follow the [installation](./installation.md) instructions to deploy NGINX Kubernetes Gateway on your Kind cluster.
2121

2222
## Access NGINX Kubernetes Gateway
2323

@@ -27,7 +27,7 @@ Forward local ports 8080 and 8443 to ports 80 and 443 of the nginx-gateway Pod:
2727
kubectl -n nginx-gateway port-forward <pod-name> 8080:80 8443:443
2828
```
2929

30-
> Note: NGINX will not listen on any ports until you configure a [Gateway](https://gateway-api.sigs.k8s.io/api-types/gateway/#gateway) resource with a valid listener.
30+
> Note: NGINX will not listen on any ports until you configure a [Gateway](https://gateway-api.sigs.k8s.io/api-types/gateway/#gateway) resource with a valid listener.
3131
3232
## Use NGINX Kubernetes Gateway
3333
To get started, follow the tutorials in the [examples](../examples) directory.

0 commit comments

Comments
 (0)