Skip to content

Commit 5abffd1

Browse files
committed
Move DisableHTTP2 to top level in spec
1 parent 97b3321 commit 5abffd1

File tree

8 files changed

+19
-59
lines changed

8 files changed

+19
-59
lines changed

apis/v1alpha1/nginxproxy_types.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ type NginxProxySpec struct {
3232
//
3333
// +optional
3434
Telemetry *Telemetry `json:"telemetry,omitempty"`
35-
// BaseHTTPConfig specifies the base http context configuration.
35+
// DisableHTTP2 defines if http2 should be disabled for all servers.
36+
// Default is false, meaning http2 will be enabled for all servers.
3637
//
3738
// +optional
38-
BaseHTTPConfig *BaseHTTPConfig `json:"baseHTTPConfig,omitempty"`
39+
DisableHTTP2 bool `json:"disableHTTP2"`
3940
}
4041

4142
// Telemetry specifies the OpenTelemetry configuration.
@@ -92,12 +93,3 @@ type TelemetryExporter struct {
9293
// +kubebuilder:validation:Pattern=`^(?:http?:\/\/)?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*(?::\d{1,5})?$`
9394
Endpoint string `json:"endpoint"`
9495
}
95-
96-
// BaseHTTPConfig defines the http context level settings that should be applied across all servers.
97-
type BaseHTTPConfig struct {
98-
// DisableHTTP2 defines if http2 should be disabled for all servers.
99-
// Default is false, meaning http2 will be enabled for all servers.
100-
//
101-
// +optional
102-
DisableHTTP2 bool `json:"disableHTTP2"`
103-
}

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 20 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: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,11 @@ spec:
4747
spec:
4848
description: Spec defines the desired state of the NginxProxy.
4949
properties:
50-
baseHTTPConfig:
51-
description: BaseHTTPConfig specifies the base http context configuration.
52-
properties:
53-
disableHTTP2:
54-
description: |-
55-
DisableHTTP2 defines if http2 should be disabled for all servers.
56-
Default is false, meaning http2 will be enabled for all servers.
57-
type: boolean
58-
type: object
50+
disableHTTP2:
51+
description: |-
52+
DisableHTTP2 defines if http2 should be disabled for all servers.
53+
Default is false, meaning http2 will be enabled for all servers.
54+
type: boolean
5955
telemetry:
6056
description: Telemetry specifies the OpenTelemetry configuration.
6157
properties:

deploy/crds.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,11 @@ spec:
700700
spec:
701701
description: Spec defines the desired state of the NginxProxy.
702702
properties:
703-
baseHTTPConfig:
704-
description: BaseHTTPConfig specifies the base http context configuration.
705-
properties:
706-
disableHTTP2:
707-
description: |-
708-
DisableHTTP2 defines if http2 should be disabled for all servers.
709-
Default is false, meaning http2 will be enabled for all servers.
710-
type: boolean
711-
type: object
703+
disableHTTP2:
704+
description: |-
705+
DisableHTTP2 defines if http2 should be disabled for all servers.
706+
Default is false, meaning http2 will be enabled for all servers.
707+
type: boolean
712708
telemetry:
713709
description: Telemetry specifies the OpenTelemetry configuration.
714710
properties:

internal/mode/static/state/dataplane/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,11 @@ func buildBaseHTTPConfig(g *graph.Graph) BaseHTTPConfig {
628628
// HTTP2 should be enabled by default
629629
HTTP2: true,
630630
}
631-
if g.NginxProxy == nil || g.NginxProxy.Spec.BaseHTTPConfig == nil {
631+
if g.NginxProxy == nil {
632632
return baseConfig
633633
}
634634

635-
if g.NginxProxy.Spec.BaseHTTPConfig.DisableHTTP2 {
635+
if g.NginxProxy.Spec.DisableHTTP2 {
636636
baseConfig.HTTP2 = false
637637
}
638638

internal/mode/static/state/dataplane/configuration_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,7 @@ func TestBuildConfiguration(t *testing.T) {
555555
},
556556
ServiceName: helpers.GetPointer("my-svc"),
557557
},
558-
BaseHTTPConfig: &ngfAPI.BaseHTTPConfig{
559-
DisableHTTP2: true,
560-
},
558+
DisableHTTP2: true,
561559
},
562560
}
563561

internal/mode/static/state/graph/grpcroute_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ func TestBuildGRPCRoutes(t *testing.T) {
130130

131131
npCfg := &ngfAPI.NginxProxy{
132132
Spec: ngfAPI.NginxProxySpec{
133-
BaseHTTPConfig: &ngfAPI.BaseHTTPConfig{
134-
DisableHTTP2: false,
135-
},
133+
DisableHTTP2: false,
136134
},
137135
}
138136

internal/mode/static/state/graph/route_common.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ func buildRoutesForGateways(
163163
}
164164

165165
func isHTTP2Disabled(npCfg *ngfAPI.NginxProxy) bool {
166-
if npCfg == nil || npCfg.Spec.BaseHTTPConfig == nil {
166+
if npCfg == nil {
167167
return false
168168
}
169-
return npCfg.Spec.BaseHTTPConfig.DisableHTTP2
169+
return npCfg.Spec.DisableHTTP2
170170
}
171171

172172
func buildSectionNameRefs(

0 commit comments

Comments
 (0)