Skip to content

Commit

Permalink
Validate configmap & secret names
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Aug 1, 2024
1 parent fa62144 commit bc92b83
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -295,6 +296,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -304,6 +306,7 @@ spec:
type: array
type: object
ansibleSSHPrivateKeySecret:
maxLength: 253
type: string
extraMounts:
items:
Expand Down Expand Up @@ -1109,6 +1112,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -1119,6 +1123,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
default: false
type: boolean
caCerts:
maxLength: 253
type: string
certsFrom:
type: string
Expand All @@ -48,6 +49,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -58,6 +60,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions apis/dataplane/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type LocalObjectReference struct {
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
// TODO: Add other useful fields. apiVersion, kind, uid?
// +optional
// +kubebuilder:validation:MaxLength:=253
Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

Expand Down Expand Up @@ -155,6 +156,7 @@ type NodeTemplate struct {
// Secret.data.ssh-privatekey: <base64 encoded private key contents>
// <https://kubernetes.io/docs/concepts/configuration/secret/#ssh-authentication-secrets>
// +kubebuilder:validation:Required
// +kubebuilder:validation:MaxLength:=253
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:io.kubernetes:Secret"}
AnsibleSSHPrivateKeySecret string `json:"ansibleSSHPrivateKeySecret"`
// ManagementNetwork - Name of network to use for management (SSH/Ansible)
Expand Down
1 change: 1 addition & 0 deletions apis/dataplane/v1beta1/openstackdataplaneservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type OpenStackDataPlaneServiceSpec struct {

// CACerts - Secret containing the CA certificate chain
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MaxLength:=253
CACerts string `json:"caCerts,omitempty" yaml:"caCerts,omitempty"`

// OpenStackAnsibleEERunnerImage image to use as the ansibleEE runner image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -295,6 +296,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -304,6 +306,7 @@ spec:
type: array
type: object
ansibleSSHPrivateKeySecret:
maxLength: 253
type: string
extraMounts:
items:
Expand Down Expand Up @@ -1109,6 +1112,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -1119,6 +1123,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
default: false
type: boolean
caCerts:
maxLength: 253
type: string
certsFrom:
type: string
Expand All @@ -48,6 +49,7 @@ spec:
configMapRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand All @@ -58,6 +60,7 @@ spec:
secretRef:
properties:
name:
maxLength: 253
type: string
optional:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ spec:
- description: TLS - overrides tls parameters for public endpoint
displayName: TLS
path: horizon.apiOverride.tls
- description: Enabled - Whether Horizon services should be deployed and managed
displayName: Enabled
path: horizon.enabled
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Template - Overrides to use when creating the Horizon services
displayName: Template
path: horizon.template
Expand Down Expand Up @@ -518,6 +523,11 @@ spec:
path: conditions
x-descriptors:
- urn:alm:descriptor:io.kubernetes.conditions
- description: Deployed
displayName: Deployed
path: deployed
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
version: v1beta1
- description: OpenStackDataPlaneNodeSet is the Schema for the openstackdataplanenodesets
API OpenStackDataPlaneNodeSet name must be a valid RFC1123 as it is used in
Expand Down Expand Up @@ -573,6 +583,13 @@ spec:
path: addCertMounts
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: DeployOnAllNodeSets - should the service be deploy across all
nodesets This will override default target of a service play, setting it
to 'all'.
displayName: Deploy On All Node Sets
path: deployOnAllNodeSets
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
statusDescriptors:
- description: Conditions
displayName: Conditions
Expand Down
Loading

0 comments on commit bc92b83

Please sign in to comment.