Skip to content

Commit

Permalink
Add Single instance sample and update split instances sample
Browse files Browse the repository at this point in the history
This change updates the envTest samples area to provide and
validate both the single instance and the split related use
case (which is the default one).

Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Oct 24, 2023
1 parent f6a1cfd commit 1547ba8
Show file tree
Hide file tree
Showing 16 changed files with 436 additions and 406 deletions.
90 changes: 49 additions & 41 deletions api/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -840,50 +840,52 @@ spec:
override:
properties:
service:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
additionalProperties:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
type: object
labels:
additionalProperties:
externalTrafficPolicy:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
internalTrafficPolicy:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
type: object
type: object
type: object
type: object
passwordSelectors:
Expand Down Expand Up @@ -947,6 +949,12 @@ spec:
serviceUser:
default: glance
type: string
type:
default: split
enum:
- split
- single
type: string
required:
- containerImage
- databaseHostname
Expand Down
223 changes: 110 additions & 113 deletions api/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -818,126 +818,123 @@ spec:
- extraVol
type: object
type: array
glanceapis:
glanceAPI:
properties:
glanceAPI:
containerImage:
type: string
customServiceConfig:
type: string
customServiceConfigSecrets:
items:
type: string
type: array
debug:
properties:
containerImage:
type: string
customServiceConfig:
type: string
customServiceConfigSecrets:
items:
type: string
type: array
debug:
properties:
service:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
type: array
nodeSelector:
service:
default: false
type: boolean
type: object
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
networkAttachments:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
type: object
override:
properties:
service:
additionalProperties:
type: string
type: object
override:
properties:
service:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
spec:
properties:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
properties:
endpointURL:
type: string
metadata:
properties:
annotations:
additionalProperties:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: object
labels:
additionalProperties:
type: string
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
maximum: 32
minimum: 0
type: integer
resources:
properties:
claims:
items:
type: object
type: object
spec:
properties:
name:
externalName:
type: string
externalTrafficPolicy:
type: string
internalTrafficPolicy:
type: string
ipFamilyPolicy:
type: string
loadBalancerClass:
type: string
loadBalancerSourceRanges:
items:
type: string
type: array
sessionAffinity:
type: string
sessionAffinityConfig:
properties:
clientIP:
properties:
timeoutSeconds:
format: int32
type: integer
type: object
type: object
type:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
maximum: 32
minimum: 0
type: integer
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
required:
- containerImage
type: object
type:
default: split
Expand All @@ -946,7 +943,7 @@ spec:
- single
type: string
required:
- glanceAPI
- containerImage
type: object
imageCacheSize:
default: ""
Expand Down Expand Up @@ -1002,8 +999,8 @@ spec:
required:
- containerImage
- databaseInstance
- glanceAPI
- imageCacheSize
- glanceapis
- secret
- storageRequest
type: object
Expand Down
7 changes: 6 additions & 1 deletion api/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@ type GlanceAPITemplate struct {

// Override, provides the ability to override the generated manifest of several child resources.
Override APIOverrideSpec `json:"override,omitempty"`

// +kubebuilder:validation:Enum=split;single
// +kubebuilder:default:=split
Type string `json:"type,omitempty"`
}

// APIOverrideSpec to override the generated manifest of several child resources.
type APIOverrideSpec struct {
// Override configuration for the Service created to serve traffic to the cluster.
Service *service.RoutedOverrideSpec `json:"service,omitempty"`
// The key must be the endpoint type (public, internal)
Service map[service.Endpoint]service.RoutedOverrideSpec `json:"service,omitempty"`
}

// SetupDefaults - initializes any CRD field defaults based on environment variables (the defaulting mechanism itself is implemented via webhooks)
Expand Down
Loading

0 comments on commit 1547ba8

Please sign in to comment.