Skip to content

Commit 1789701

Browse files
committed
Merge branch 'main' into tests/cel-clientsettingspolicies
2 parents e5479fb + 6d9f902 commit 1789701

File tree

11 files changed

+630
-30
lines changed

11 files changed

+630
-30
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282

8383
- name: Authenticate to Google Cloud
8484
id: auth
85-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
85+
uses: google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
8686
with:
8787
token_format: access_token
8888
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
if: github.ref_type == 'tag'
166166

167167
- name: Install Cosign
168-
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
168+
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
169169
if: github.ref_type == 'tag'
170170

171171
- name: Build binary

.github/workflows/nfr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: Authenticate to Google Cloud
8888
id: auth
89-
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
89+
uses: google-github-actions/auth@140bb5113ffb6b65a7e9b937a81fa96cf5064462 # v2.1.11
9090
with:
9191
token_format: access_token
9292
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY }}
@@ -100,7 +100,7 @@ jobs:
100100
password: ${{ steps.auth.outputs.access_token }}
101101

102102
- name: Set up Cloud SDK
103-
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
103+
uses: google-github-actions/setup-gcloud@6a7c903a70c8625ed6700fa299f5ddb4ca6022e9 # v2.1.5
104104
with:
105105
project_id: ${{ secrets.GCP_PROJECT_ID }}
106106
install_components: kubectl

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
exclude: (^examples/|^docs/|.*_test.go$)
2828

2929
- repo: https://github.com/gitleaks/gitleaks
30-
rev: v8.27.2
30+
rev: v8.28.0
3131
hooks:
3232
- id: gitleaks
3333

apis/v1alpha2/nginxproxy_types.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package v1alpha2
22

33
import (
44
corev1 "k8s.io/api/core/v1"
5+
apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
56
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
67

78
"github.com/nginx/nginx-gateway-fabric/apis/v1alpha1"
@@ -388,6 +389,36 @@ type KubernetesSpec struct {
388389
Service *ServiceSpec `json:"service,omitempty"`
389390
}
390391

392+
// Patch defines a patch to apply to a Kubernetes object.
393+
type Patch struct {
394+
// Type is the type of patch. Defaults to StrategicMerge.
395+
//
396+
// +optional
397+
// +kubebuilder:default:=StrategicMerge
398+
Type *PatchType `json:"type,omitempty"`
399+
400+
// Value is the patch data as raw JSON.
401+
// For StrategicMerge and Merge patches, this should be a JSON object.
402+
// For JSONPatch patches, this should be a JSON array of patch operations.
403+
//
404+
// +optional
405+
// +kubebuilder:validation:XPreserveUnknownFields
406+
Value *apiextv1.JSON `json:"value,omitempty"`
407+
}
408+
409+
// PatchType specifies the type of patch.
410+
// +kubebuilder:validation:Enum=StrategicMerge;Merge;JSONPatch
411+
type PatchType string
412+
413+
const (
414+
// PatchTypeStrategicMerge uses strategic merge patch.
415+
PatchTypeStrategicMerge PatchType = "StrategicMerge"
416+
// PatchTypeMerge uses merge patch (RFC 7386).
417+
PatchTypeMerge PatchType = "Merge"
418+
// PatchTypeJSONPatch uses JSON patch (RFC 6902).
419+
PatchTypeJSONPatch PatchType = "JSONPatch"
420+
)
421+
391422
// Deployment is the configuration for the NGINX Deployment.
392423
type DeploymentSpec struct {
393424
// Container defines container fields for the NGINX container.
@@ -404,6 +435,11 @@ type DeploymentSpec struct {
404435
//
405436
// +optional
406437
Pod PodSpec `json:"pod"`
438+
439+
// Patches are custom patches to apply to the NGINX Deployment.
440+
//
441+
// +optional
442+
Patches []Patch `json:"patches,omitempty"`
407443
}
408444

409445
// DaemonSet is the configuration for the NGINX DaemonSet.
@@ -417,6 +453,11 @@ type DaemonSetSpec struct {
417453
//
418454
// +optional
419455
Pod PodSpec `json:"pod"`
456+
457+
// Patches are custom patches to apply to the NGINX DaemonSet.
458+
//
459+
// +optional
460+
Patches []Patch `json:"patches,omitempty"`
420461
}
421462

422463
// PodSpec defines Pod-specific fields.
@@ -594,6 +635,11 @@ type ServiceSpec struct {
594635
//
595636
// +optional
596637
NodePorts []NodePort `json:"nodePorts,omitempty"`
638+
639+
// Patches are custom patches to apply to the NGINX Service.
640+
//
641+
// +optional
642+
Patches []Patch `json:"patches,omitempty"`
597643
}
598644

599645
// ServiceType describes ingress method for the Service.

apis/v1alpha2/zz_generated.deepcopy.go

Lines changed: 55 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/gateway.nginx.org_nginxproxies.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,30 @@ spec:
511511
type: object
512512
type: array
513513
type: object
514+
patches:
515+
description: Patches are custom patches to apply to the NGINX
516+
DaemonSet.
517+
items:
518+
description: Patch defines a patch to apply to a Kubernetes
519+
object.
520+
properties:
521+
type:
522+
default: StrategicMerge
523+
description: Type is the type of patch. Defaults to
524+
StrategicMerge.
525+
enum:
526+
- StrategicMerge
527+
- Merge
528+
- JSONPatch
529+
type: string
530+
value:
531+
description: |-
532+
Value is the patch data as raw JSON.
533+
For StrategicMerge and Merge patches, this should be a JSON object.
534+
For JSONPatch patches, this should be a JSON array of patch operations.
535+
x-kubernetes-preserve-unknown-fields: true
536+
type: object
537+
type: array
514538
pod:
515539
description: Pod defines Pod-specific fields.
516540
properties:
@@ -3944,6 +3968,30 @@ spec:
39443968
type: object
39453969
type: array
39463970
type: object
3971+
patches:
3972+
description: Patches are custom patches to apply to the NGINX
3973+
Deployment.
3974+
items:
3975+
description: Patch defines a patch to apply to a Kubernetes
3976+
object.
3977+
properties:
3978+
type:
3979+
default: StrategicMerge
3980+
description: Type is the type of patch. Defaults to
3981+
StrategicMerge.
3982+
enum:
3983+
- StrategicMerge
3984+
- Merge
3985+
- JSONPatch
3986+
type: string
3987+
value:
3988+
description: |-
3989+
Value is the patch data as raw JSON.
3990+
For StrategicMerge and Merge patches, this should be a JSON object.
3991+
For JSONPatch patches, this should be a JSON array of patch operations.
3992+
x-kubernetes-preserve-unknown-fields: true
3993+
type: object
3994+
type: array
39473995
pod:
39483996
description: Pod defines Pod-specific fields.
39493997
properties:
@@ -6996,6 +7044,30 @@ spec:
69967044
- port
69977045
type: object
69987046
type: array
7047+
patches:
7048+
description: Patches are custom patches to apply to the NGINX
7049+
Service.
7050+
items:
7051+
description: Patch defines a patch to apply to a Kubernetes
7052+
object.
7053+
properties:
7054+
type:
7055+
default: StrategicMerge
7056+
description: Type is the type of patch. Defaults to
7057+
StrategicMerge.
7058+
enum:
7059+
- StrategicMerge
7060+
- Merge
7061+
- JSONPatch
7062+
type: string
7063+
value:
7064+
description: |-
7065+
Value is the patch data as raw JSON.
7066+
For StrategicMerge and Merge patches, this should be a JSON object.
7067+
For JSONPatch patches, this should be a JSON array of patch operations.
7068+
x-kubernetes-preserve-unknown-fields: true
7069+
type: object
7070+
type: array
69997071
type:
70007072
default: LoadBalancer
70017073
description: ServiceType describes ingress method for the

0 commit comments

Comments
 (0)