Skip to content

Commit cf94405

Browse files
committed
mark ingress config fields as optional for controller-gen CRD generation
Signed-off-by: kahirokunn <okinakahiro@gmail.com>
1 parent 5318e21 commit cf94405

File tree

4 files changed

+16
-34
lines changed

4 files changed

+16
-34
lines changed

config/charts/knative-operator/templates/crds/knativeservings.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,16 +1575,12 @@ spec:
15751575
properties:
15761576
enabled:
15771577
type: boolean
1578-
required:
1579-
- enabled
15801578
type: object
15811579
gateway-api:
15821580
description: GatewayAPIIngressConfiguration specifies whether to enable the gateway-api ingresses.
15831581
properties:
15841582
enabled:
15851583
type: boolean
1586-
required:
1587-
- enabled
15881584
type: object
15891585
istio:
15901586
description: IstioIngressConfiguration specifies options for the istio ingresses.
@@ -2027,8 +2023,6 @@ spec:
20272023
type: object
20282024
type: array
20292025
type: object
2030-
required:
2031-
- enabled
20322026
type: object
20332027
kourier:
20342028
description: KourierIngressConfiguration specifies whether to enable the kourier ingresses.
@@ -2052,14 +2046,7 @@ spec:
20522046
service-type:
20532047
description: ServiceType specifies the service type for kourier gateway.
20542048
type: string
2055-
required:
2056-
- enabled
20572049
type: object
2058-
required:
2059-
- contour
2060-
- gateway-api
2061-
- istio
2062-
- kourier
20632050
type: object
20642051
manifests:
20652052
description: A means to specify the manifests to install

config/crd/bases/operator.knative.dev_knativeservings.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,17 +1647,13 @@ spec:
16471647
properties:
16481648
enabled:
16491649
type: boolean
1650-
required:
1651-
- enabled
16521650
type: object
16531651
gateway-api:
16541652
description: GatewayAPIIngressConfiguration specifies whether
16551653
to enable the gateway-api ingresses.
16561654
properties:
16571655
enabled:
16581656
type: boolean
1659-
required:
1660-
- enabled
16611657
type: object
16621658
istio:
16631659
description: IstioIngressConfiguration specifies options for the
@@ -2181,8 +2177,6 @@ spec:
21812177
type: object
21822178
type: array
21832179
type: object
2184-
required:
2185-
- enabled
21862180
type: object
21872181
kourier:
21882182
description: KourierIngressConfiguration specifies whether to
@@ -2212,14 +2206,7 @@ spec:
22122206
description: ServiceType specifies the service type for kourier
22132207
gateway.
22142208
type: string
2215-
required:
2216-
- enabled
22172209
type: object
2218-
required:
2219-
- contour
2220-
- gateway-api
2221-
- istio
2222-
- kourier
22232210
type: object
22242211
manifests:
22252212
description: A means to specify the manifests to install

pkg/apis/operator/base/ingressconfiguration.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import (
2323

2424
// IstioIngressConfiguration specifies options for the istio ingresses.
2525
type IstioIngressConfiguration struct {
26-
Enabled bool `json:"enabled"`
26+
// +optional
27+
Enabled bool `json:"enabled,omitempty"`
2728

2829
// KnativeIngressGateway overrides the knative-ingress-gateway.
2930
// +optional
@@ -36,7 +37,8 @@ type IstioIngressConfiguration struct {
3637

3738
// KourierIngressConfiguration specifies whether to enable the kourier ingresses.
3839
type KourierIngressConfiguration struct {
39-
Enabled bool `json:"enabled"`
40+
// +optional
41+
Enabled bool `json:"enabled,omitempty"`
4042

4143
// ServiceType specifies the service type for kourier gateway.
4244
ServiceType v1.ServiceType `json:"service-type,omitempty"`
@@ -56,12 +58,14 @@ type KourierIngressConfiguration struct {
5658

5759
// ContourIngressConfiguration specifies whether to enable the contour ingresses.
5860
type ContourIngressConfiguration struct {
59-
Enabled bool `json:"enabled"`
61+
// +optional
62+
Enabled bool `json:"enabled,omitempty"`
6063
}
6164

6265
// GatewayAPIIngressConfiguration specifies whether to enable the gateway-api ingresses.
6366
type GatewayAPIIngressConfiguration struct {
64-
Enabled bool `json:"enabled"`
67+
// +optional
68+
Enabled bool `json:"enabled,omitempty"`
6569
}
6670

6771
// IstioGatewayOverride override the knative-ingress-gateway and knative-local-gateway(cluster-local-gateway)

pkg/apis/operator/v1beta1/knativeserving_types.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ type KnativeServingList struct {
8989

9090
// IngressConfigs specifies options for the ingresses.
9191
type IngressConfigs struct {
92-
Istio base.IstioIngressConfiguration `json:"istio"`
93-
Kourier base.KourierIngressConfiguration `json:"kourier"`
94-
Contour base.ContourIngressConfiguration `json:"contour"`
95-
GatewayAPI base.GatewayAPIIngressConfiguration `json:"gateway-api"`
92+
// +optional
93+
Istio base.IstioIngressConfiguration `json:"istio,omitempty"`
94+
// +optional
95+
Kourier base.KourierIngressConfiguration `json:"kourier,omitempty"`
96+
// +optional
97+
Contour base.ContourIngressConfiguration `json:"contour,omitempty"`
98+
// +optional
99+
GatewayAPI base.GatewayAPIIngressConfiguration `json:"gateway-api,omitempty"`
96100
}
97101

98102
// SecurityConfigs specifies options for the security

0 commit comments

Comments
 (0)