Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1801543: Add missing enum validations #589

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/v1/0000_10_config-operator_01_apiserver.crd.yaml
Expand Up @@ -165,6 +165,11 @@ spec:
\n minTLSVersion: TLSv1.1 \n NOTE: currently the highest
minTLSVersion allowed is VersionTLS12"
type: string
enum:
- VersionTLS10
- VersionTLS11
- VersionTLS12
- VersionTLS13
nullable: true
intermediate:
description: "intermediate is a TLS security profile based on: \n
Expand Down Expand Up @@ -215,5 +220,10 @@ spec:
profile is currently not supported because it is not yet well
adopted by common software libraries."
type: string
enum:
- Old
- Intermediate
- Modern
- Custom
status:
type: object
2 changes: 2 additions & 0 deletions config/v1/types_tlssecurityprofile.go
Expand Up @@ -136,6 +136,7 @@ type CustomTLSProfile struct {
}

// TLSProfileType defines a TLS security profile type.
// +kubebuilder:validation:Enum=Old;Intermediate;Modern;Custom
type TLSProfileType string

const (
Expand Down Expand Up @@ -180,6 +181,7 @@ type TLSProfileSpec struct {
//
// Note that SSLv3.0 is not a supported protocol version due to well known
// vulnerabilities such as POODLE: https://en.wikipedia.org/wiki/POODLE
// +kubebuilder:validation:Enum=VersionTLS10;VersionTLS11;VersionTLS12;VersionTLS13
type TLSProtocolVersion string

const (
Expand Down
Expand Up @@ -106,6 +106,9 @@ spec:
description: scope indicates the scope at which the load balancer
is exposed. Possible values are "External" and "Internal".
type: string
enum:
- Internal
- External
nodePort:
description: nodePort holds parameters for the NodePortService endpoint
publishing strategy. Present only if type is NodePortService.
Expand Down Expand Up @@ -143,6 +146,11 @@ spec:
changes to the node port field of the managed NodePort Service
will preserved."
type: string
enum:
- LoadBalancerService
- HostNetwork
- Private
- NodePortService
namespaceSelector:
description: "namespaceSelector is used to filter the set of namespaces
serviced by the ingress controller. This is useful for implementing
Expand Down Expand Up @@ -303,6 +311,9 @@ spec:
different paths of the same host name across namespaces. \n
If empty, the default is Strict."
type: string
enum:
- InterNamespaceAllowed
- Strict
routeSelector:
description: "routeSelector is used to filter the set of Routes serviced
by the ingress controller. This is useful for implementing shards.
Expand Down Expand Up @@ -386,6 +397,11 @@ spec:
\n minTLSVersion: TLSv1.1 \n NOTE: currently the highest
minTLSVersion allowed is VersionTLS12"
type: string
enum:
- VersionTLS10
- VersionTLS11
- VersionTLS12
- VersionTLS13
nullable: true
intermediate:
description: "intermediate is a TLS security profile based on: \n
Expand Down Expand Up @@ -436,6 +452,11 @@ spec:
profile is currently not supported because it is not yet well
adopted by common software libraries."
type: string
enum:
- Old
- Intermediate
- Modern
- Custom
status:
description: status is the most recently observed status of the IngressController.
type: object
Expand Down Expand Up @@ -504,6 +525,9 @@ spec:
description: scope indicates the scope at which the load balancer
is exposed. Possible values are "External" and "Internal".
type: string
enum:
- Internal
- External
nodePort:
description: nodePort holds parameters for the NodePortService endpoint
publishing strategy. Present only if type is NodePortService.
Expand Down Expand Up @@ -541,6 +565,11 @@ spec:
changes to the node port field of the managed NodePort Service
will preserved."
type: string
enum:
- LoadBalancerService
- HostNetwork
- Private
- NodePortService
observedGeneration:
description: observedGeneration is the most recent generation observed.
type: integer
Expand Down Expand Up @@ -570,6 +599,11 @@ spec:
TLSv1.1 \n NOTE: currently the highest minTLSVersion allowed is
VersionTLS12"
type: string
enum:
- VersionTLS10
- VersionTLS11
- VersionTLS12
- VersionTLS13
version: v1
versions:
- name: v1
Expand Down
3 changes: 3 additions & 0 deletions operator/v1/types_ingress.go
Expand Up @@ -185,6 +185,7 @@ type NodePlacement struct {
}

// EndpointPublishingStrategyType is a way to publish ingress controller endpoints.
// +kubebuilder:validation:Enum=LoadBalancerService;HostNetwork;Private;NodePortService
type EndpointPublishingStrategyType string

const (
Expand All @@ -204,6 +205,7 @@ const (
)

// LoadBalancerScope is the scope at which a load balancer is exposed.
// +kubebuilder:validation:Enum=Internal;External
type LoadBalancerScope string

var (
Expand Down Expand Up @@ -337,6 +339,7 @@ type RouteAdmissionPolicy struct {

// NamespaceOwnershipCheck is a route admission policy component that describes
// how host name claims across namespaces should be handled.
// +kubebuilder:validation:Enum=InterNamespaceAllowed;Strict
type NamespaceOwnershipCheck string

const (
Expand Down