diff --git a/api/gateway-operator/v1beta1/dataplane_types.go b/api/gateway-operator/v1beta1/dataplane_types.go index 7dc6dae0e3..226845e3b3 100644 --- a/api/gateway-operator/v1beta1/dataplane_types.go +++ b/api/gateway-operator/v1beta1/dataplane_types.go @@ -180,6 +180,8 @@ type DataPlaneNetworkOptions struct { // Services indicates the configuration of Kubernetes Services needed for // the topology of various forms of traffic (including ingress, e.t.c.) to // and from the DataPlane. + // + // +kubebuilder:default={ingress:{type: "LoadBalancer"}} Services *DataPlaneServices `json:"services,omitempty"` // KonnectCA is the certificate authority that the operator uses to provision client certificates the DataPlane diff --git a/api/gateway-operator/v2beta1/controlplane_types.go b/api/gateway-operator/v2beta1/controlplane_types.go index 739ace4a8c..b4b7c68f11 100644 --- a/api/gateway-operator/v2beta1/controlplane_types.go +++ b/api/gateway-operator/v2beta1/controlplane_types.go @@ -138,6 +138,7 @@ type ControlPlaneOptions struct { // DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. // // +optional + // +kubebuilder:default={reverseSync: "disabled"} DataPlaneSync *ControlPlaneDataPlaneSync `json:"dataplaneSync,omitempty"` // Translation defines the configuration for translating Kong configuration. @@ -149,6 +150,7 @@ type ControlPlaneOptions struct { // ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. // // +optional + // +kubebuilder:default={state: "disabled", dumpSensitive: "disabled"} ConfigDump *ControlPlaneConfigDump `json:"configDump,omitempty"` // ObjectFilters defines the filters to limit watched objects by the controllers. @@ -176,6 +178,7 @@ type ControlPlaneTranslationOptions struct { // FallbackConfiguration defines the fallback configuration options for the ControlPlane. // // +optional + // +kubebuilder:default={useLastValidConfig: "enabled"} FallbackConfiguration *ControlPlaneFallbackConfiguration `json:"fallbackConfiguration,omitempty"` // DrainSupport defines the configuration for the ControlPlane to include diff --git a/api/gateway-operator/v2beta1/gatewayconfiguration_types.go b/api/gateway-operator/v2beta1/gatewayconfiguration_types.go index 7ef7ef08b4..145ff0bbfa 100644 --- a/api/gateway-operator/v2beta1/gatewayconfiguration_types.go +++ b/api/gateway-operator/v2beta1/gatewayconfiguration_types.go @@ -179,6 +179,7 @@ type GatewayConfigDataPlaneNetworkOptions struct { // and from the DataPlane. // // +optional + // +kubebuilder:default={ingress:{type: "LoadBalancer"}} Services *GatewayConfigDataPlaneServices `json:"services,omitempty"` } diff --git a/charts/kong-operator/charts/ko-crds/templates/ko-crds.yaml b/charts/kong-operator/charts/ko-crds/templates/ko-crds.yaml index b96e30daa5..464f82d84c 100644 --- a/charts/kong-operator/charts/ko-crds/templates/ko-crds.yaml +++ b/charts/kong-operator/charts/ko-crds/templates/ko-crds.yaml @@ -9422,6 +9422,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: @@ -9507,6 +9510,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: @@ -9750,6 +9755,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: @@ -19483,6 +19490,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -38645,6 +38655,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: @@ -38698,6 +38711,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: @@ -38899,6 +38914,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: @@ -48304,6 +48321,9 @@ spec: related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/affinity-values.snap b/charts/kong-operator/ci/__snapshots__/affinity-values.snap index 831c2cd590..13e2200656 100644 --- a/charts/kong-operator/ci/__snapshots__/affinity-values.snap +++ b/charts/kong-operator/ci/__snapshots__/affinity-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/controlplane-config-dump.snap b/charts/kong-operator/ci/__snapshots__/controlplane-config-dump.snap index 64854fbb74..edb1f7c451 100644 --- a/charts/kong-operator/ci/__snapshots__/controlplane-config-dump.snap +++ b/charts/kong-operator/ci/__snapshots__/controlplane-config-dump.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/disable-gateway-controller-values.snap b/charts/kong-operator/ci/__snapshots__/disable-gateway-controller-values.snap index 95ebdeaf20..3309b8dc11 100644 --- a/charts/kong-operator/ci/__snapshots__/disable-gateway-controller-values.snap +++ b/charts/kong-operator/ci/__snapshots__/disable-gateway-controller-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/env-and-args-values.snap b/charts/kong-operator/ci/__snapshots__/env-and-args-values.snap index 55c38d9967..c91143d821 100644 --- a/charts/kong-operator/ci/__snapshots__/env-and-args-values.snap +++ b/charts/kong-operator/ci/__snapshots__/env-and-args-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/env-and-customenv-values.snap b/charts/kong-operator/ci/__snapshots__/env-and-customenv-values.snap index 9588d0fdb1..c29eb2d717 100644 --- a/charts/kong-operator/ci/__snapshots__/env-and-customenv-values.snap +++ b/charts/kong-operator/ci/__snapshots__/env-and-customenv-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/extra-labels-values.snap b/charts/kong-operator/ci/__snapshots__/extra-labels-values.snap index 731a493125..1c6a0a6e3c 100644 --- a/charts/kong-operator/ci/__snapshots__/extra-labels-values.snap +++ b/charts/kong-operator/ci/__snapshots__/extra-labels-values.snap @@ -8958,6 +8958,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9039,6 +9042,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9261,6 +9266,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18471,6 +18478,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36399,6 +36409,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36448,6 +36461,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36627,6 +36642,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45422,6 +45439,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/image-pull-secrets-and-image-digest-values.snap b/charts/kong-operator/ci/__snapshots__/image-pull-secrets-and-image-digest-values.snap index 3e4997f851..46f98ab69f 100644 --- a/charts/kong-operator/ci/__snapshots__/image-pull-secrets-and-image-digest-values.snap +++ b/charts/kong-operator/ci/__snapshots__/image-pull-secrets-and-image-digest-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/nightly-can-be-used-values.snap b/charts/kong-operator/ci/__snapshots__/nightly-can-be-used-values.snap index a341f65325..63fd1be3c1 100644 --- a/charts/kong-operator/ci/__snapshots__/nightly-can-be-used-values.snap +++ b/charts/kong-operator/ci/__snapshots__/nightly-can-be-used-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/pod-annotations-values.snap b/charts/kong-operator/ci/__snapshots__/pod-annotations-values.snap index 172bce1cca..979ba3e874 100644 --- a/charts/kong-operator/ci/__snapshots__/pod-annotations-values.snap +++ b/charts/kong-operator/ci/__snapshots__/pod-annotations-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/probes-and-args-values.snap b/charts/kong-operator/ci/__snapshots__/probes-and-args-values.snap index a2a93bb3a0..b109cfacab 100644 --- a/charts/kong-operator/ci/__snapshots__/probes-and-args-values.snap +++ b/charts/kong-operator/ci/__snapshots__/probes-and-args-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/tolerations-values.snap b/charts/kong-operator/ci/__snapshots__/tolerations-values.snap index 5e0dc69fcc..eab96a4cb5 100644 --- a/charts/kong-operator/ci/__snapshots__/tolerations-values.snap +++ b/charts/kong-operator/ci/__snapshots__/tolerations-values.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/validating-policies-dataplane-ports-disabled.snap b/charts/kong-operator/ci/__snapshots__/validating-policies-dataplane-ports-disabled.snap index 5d744ca8d8..9328b315f5 100644 --- a/charts/kong-operator/ci/__snapshots__/validating-policies-dataplane-ports-disabled.snap +++ b/charts/kong-operator/ci/__snapshots__/validating-policies-dataplane-ports-disabled.snap @@ -8957,6 +8957,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -9038,6 +9041,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9260,6 +9265,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18470,6 +18477,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36398,6 +36408,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36447,6 +36460,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36626,6 +36641,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45421,6 +45438,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/webhook-conversion-disabled-values.snap b/charts/kong-operator/ci/__snapshots__/webhook-conversion-disabled-values.snap index f6e49e0aa0..82caae8f7c 100644 --- a/charts/kong-operator/ci/__snapshots__/webhook-conversion-disabled-values.snap +++ b/charts/kong-operator/ci/__snapshots__/webhook-conversion-disabled-values.snap @@ -630,6 +630,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -711,6 +714,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -933,6 +938,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -10147,6 +10154,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -10738,6 +10748,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -10787,6 +10800,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -10966,6 +10981,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -19761,6 +19778,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/webhook-conversion-enabled-cert-manager.snap b/charts/kong-operator/ci/__snapshots__/webhook-conversion-enabled-cert-manager.snap index b28e4362e0..47e1310f27 100644 --- a/charts/kong-operator/ci/__snapshots__/webhook-conversion-enabled-cert-manager.snap +++ b/charts/kong-operator/ci/__snapshots__/webhook-conversion-enabled-cert-manager.snap @@ -8907,6 +8907,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -8988,6 +8991,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -9210,6 +9215,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -18420,6 +18427,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -36348,6 +36358,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -36397,6 +36410,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -36576,6 +36591,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -45371,6 +45388,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/charts/kong-operator/ci/__snapshots__/webhooks-validating-and-conversion-disabled-values.snap b/charts/kong-operator/ci/__snapshots__/webhooks-validating-and-conversion-disabled-values.snap index 8899829008..403d529c4b 100644 --- a/charts/kong-operator/ci/__snapshots__/webhooks-validating-and-conversion-disabled-values.snap +++ b/charts/kong-operator/ci/__snapshots__/webhooks-validating-and-conversion-disabled-values.snap @@ -605,6 +605,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -686,6 +689,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -908,6 +913,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -10122,6 +10129,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to @@ -10713,6 +10723,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: dumpSensitive: @@ -10762,6 +10775,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: interval: @@ -10941,6 +10956,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: useLastValidConfig: @@ -19736,6 +19753,9 @@ spec: description: GatewayConfigDataPlaneNetworkOptions defines network related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/config/crd/kong-operator/gateway-operator.konghq.com_controlplanes.yaml b/config/crd/kong-operator/gateway-operator.konghq.com_controlplanes.yaml index d61b4368e7..97487ee59a 100644 --- a/config/crd/kong-operator/gateway-operator.konghq.com_controlplanes.yaml +++ b/config/crd/kong-operator/gateway-operator.konghq.com_controlplanes.yaml @@ -8814,6 +8814,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: @@ -8899,6 +8902,8 @@ spec: - message: Ref cannot be provided when type is set to managedByOwner rule: self.type != 'managedByOwner' || !has(self.ref) dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: @@ -9142,6 +9147,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: diff --git a/config/crd/kong-operator/gateway-operator.konghq.com_dataplanes.yaml b/config/crd/kong-operator/gateway-operator.konghq.com_dataplanes.yaml index d4db599ce1..115267969d 100644 --- a/config/crd/kong-operator/gateway-operator.konghq.com_dataplanes.yaml +++ b/config/crd/kong-operator/gateway-operator.konghq.com_dataplanes.yaml @@ -9378,6 +9378,9 @@ spec: - issuer type: object services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, e.t.c.) to diff --git a/config/crd/kong-operator/gateway-operator.konghq.com_gatewayconfigurations.yaml b/config/crd/kong-operator/gateway-operator.konghq.com_gatewayconfigurations.yaml index 29d3652619..e5fe286d14 100644 --- a/config/crd/kong-operator/gateway-operator.konghq.com_gatewayconfigurations.yaml +++ b/config/crd/kong-operator/gateway-operator.konghq.com_gatewayconfigurations.yaml @@ -18578,6 +18578,9 @@ spec: type: string type: object configDump: + default: + dumpSensitive: disabled + state: disabled description: ConfigDump defines the options for dumping generated Kong configuration from a diagnostics server. properties: @@ -18631,6 +18634,8 @@ spec: - name x-kubernetes-list-type: map dataplaneSync: + default: + reverseSync: disabled description: DataPlaneSync defines the configuration for syncing Kong configuration to the DataPlane. properties: @@ -18832,6 +18837,8 @@ spec: - disabled type: string fallbackConfiguration: + default: + useLastValidConfig: enabled description: FallbackConfiguration defines the fallback configuration options for the ControlPlane. properties: @@ -28237,6 +28244,9 @@ spec: related options for a DataPlane. properties: services: + default: + ingress: + type: LoadBalancer description: |- Services indicates the configuration of Kubernetes Services needed for the topology of various forms of traffic (including ingress, etc.) to diff --git a/test/crdsvalidation/gateway-operator.konghq.com/controlplane_v2_test.go b/test/crdsvalidation/gateway-operator.konghq.com/controlplane_v2_test.go index 06102c9f91..b73d1413e2 100644 --- a/test/crdsvalidation/gateway-operator.konghq.com/controlplane_v2_test.go +++ b/test/crdsvalidation/gateway-operator.konghq.com/controlplane_v2_test.go @@ -795,6 +795,71 @@ func TestControlPlaneV2(t *testing.T) { }) }) + t.Run("defaults", func(t *testing.T) { + common.TestCasesGroup[*operatorv2beta1.ControlPlane]{ + { + Name: "dataplaneSync defaults", + TestObject: &operatorv2beta1.ControlPlane{ + ObjectMeta: common.CommonObjectMeta(ns.Name), + Spec: operatorv2beta1.ControlPlaneSpec{ + DataPlane: validDataPlaneTarget, + ControlPlaneOptions: operatorv2beta1.ControlPlaneOptions{ + IngressClass: lo.ToPtr("kong"), + }, + }, + }, + Assert: func(t *testing.T, cp *operatorv2beta1.ControlPlane) { + require.NotNil(t, cp.Spec.DataPlaneSync) + require.NotNil(t, cp.Spec.DataPlaneSync.ReverseSync) + require.Equal(t, + operatorv2beta1.ControlPlaneReverseSyncStateDisabled, + *cp.Spec.DataPlaneSync.ReverseSync, + ) + }, + }, + { + Name: "configDump defaults", + TestObject: &operatorv2beta1.ControlPlane{ + ObjectMeta: common.CommonObjectMeta(ns.Name), + Spec: operatorv2beta1.ControlPlaneSpec{ + DataPlane: validDataPlaneTarget, + ControlPlaneOptions: operatorv2beta1.ControlPlaneOptions{ + IngressClass: lo.ToPtr("kong"), + }, + }, + }, + Assert: func(t *testing.T, cp *operatorv2beta1.ControlPlane) { + require.NotNil(t, cp.Spec.ConfigDump) + require.Equal(t, operatorv2beta1.ConfigDumpStateDisabled, cp.Spec.ConfigDump.State) + require.Equal(t, operatorv2beta1.ConfigDumpStateDisabled, cp.Spec.ConfigDump.DumpSensitive) + }, + }, + { + Name: "translation fallbackConfiguration defaults", + TestObject: &operatorv2beta1.ControlPlane{ + ObjectMeta: common.CommonObjectMeta(ns.Name), + Spec: operatorv2beta1.ControlPlaneSpec{ + DataPlane: validDataPlaneTarget, + ControlPlaneOptions: operatorv2beta1.ControlPlaneOptions{ + IngressClass: lo.ToPtr("kong"), + Translation: &operatorv2beta1.ControlPlaneTranslationOptions{}, + }, + }, + }, + Assert: func(t *testing.T, cp *operatorv2beta1.ControlPlane) { + require.NotNil(t, cp.Spec.Translation) + require.NotNil(t, cp.Spec.Translation.FallbackConfiguration) + require.NotNil(t, cp.Spec.Translation.FallbackConfiguration.UseLastValidConfig) + require.Equal(t, + operatorv2beta1.ControlPlaneFallbackConfigurationStateEnabled, + *cp.Spec.Translation.FallbackConfiguration.UseLastValidConfig, + ) + }, + }, + }. + RunWithConfig(t, cfg, scheme) + }) + t.Run("konnect", func(t *testing.T) { t.Run("basic configuration", func(t *testing.T) { common.TestCasesGroup[*operatorv2beta1.ControlPlane]{ diff --git a/test/crdsvalidation/gateway-operator.konghq.com/dataplane_test.go b/test/crdsvalidation/gateway-operator.konghq.com/dataplane_test.go index bdd5ef311c..5d93e16e83 100644 --- a/test/crdsvalidation/gateway-operator.konghq.com/dataplane_test.go +++ b/test/crdsvalidation/gateway-operator.konghq.com/dataplane_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/samber/lo" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -421,6 +422,23 @@ func TestDataplane(t *testing.T) { }) t.Run("service ingress type", func(t *testing.T) { common.TestCasesGroup[*operatorv1beta1.DataPlane]{ + { + Name: "service ingress type defaults to LoadBalancer", + TestObject: &operatorv1beta1.DataPlane{ + ObjectMeta: common.CommonObjectMeta(ns.Name), + Spec: operatorv1beta1.DataPlaneSpec{ + DataPlaneOptions: operatorv1beta1.DataPlaneOptions{ + Deployment: validDataplaneOptions.Deployment, + Network: operatorv1beta1.DataPlaneNetworkOptions{}, + }, + }, + }, + Assert: func(t *testing.T, dp *operatorv1beta1.DataPlane) { + require.NotNil(t, dp.Spec.Network.Services) + require.NotNil(t, dp.Spec.Network.Services.Ingress) + require.Equal(t, corev1.ServiceTypeLoadBalancer, dp.Spec.Network.Services.Ingress.Type) + }, + }, { Name: "service ingress type LoadBalancer", TestObject: &operatorv1beta1.DataPlane{ diff --git a/test/crdsvalidation/gateway-operator.konghq.com/gatewayconfiguration_v2_test.go b/test/crdsvalidation/gateway-operator.konghq.com/gatewayconfiguration_v2_test.go index 32add5381a..e3d398737e 100644 --- a/test/crdsvalidation/gateway-operator.konghq.com/gatewayconfiguration_v2_test.go +++ b/test/crdsvalidation/gateway-operator.konghq.com/gatewayconfiguration_v2_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/samber/lo" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -156,6 +157,23 @@ func TestGatewayConfigurationV2(t *testing.T) { }, }, }, + { + Name: "services ingress type defaults to LoadBalancer", + TestObject: &operatorv2beta1.GatewayConfiguration{ + ObjectMeta: common.CommonObjectMeta(ns.Name), + Spec: operatorv2beta1.GatewayConfigurationSpec{ + DataPlaneOptions: &operatorv2beta1.GatewayConfigDataPlaneOptions{ + Network: operatorv2beta1.GatewayConfigDataPlaneNetworkOptions{}, + }, + }, + }, + Assert: func(t *testing.T, gc *operatorv2beta1.GatewayConfiguration) { + require.NotNil(t, gc.Spec.DataPlaneOptions) + require.NotNil(t, gc.Spec.DataPlaneOptions.Network.Services) + require.NotNil(t, gc.Spec.DataPlaneOptions.Network.Services.Ingress) + require.Equal(t, corev1.ServiceTypeLoadBalancer, gc.Spec.DataPlaneOptions.Network.Services.Ingress.Type) + }, + }, { Name: "specifying resources.PodDisruptionBudget", TestObject: &operatorv2beta1.GatewayConfiguration{