Skip to content

Commit

Permalink
Add NetworkAttachments
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwede committed Jan 23, 2024
1 parent 77a04df commit be653df
Show file tree
Hide file tree
Showing 13 changed files with 224 additions and 1 deletion.
13 changes: 13 additions & 0 deletions api/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
override:
description: Override, provides the ability to override the generated
manifest of several child resources.
Expand Down Expand Up @@ -310,6 +316,13 @@ spec:
- type
type: object
type: array
networkAttachments:
additionalProperties:
items:
type: string
type: array
description: NetworkAttachments status of the deployment pods
type: object
readyCount:
description: ReadyCount of SwiftProxy instances
format: int32
Expand Down
18 changes: 18 additions & 0 deletions api/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ spec:
spec:
description: SwiftSpec defines the desired state of Swift
properties:
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
storageClass:
default: ""
description: Storage class. This is passed to SwiftStorage unless
Expand All @@ -63,6 +69,12 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
items:
type: string
type: array
override:
description: Override, provides the ability to override the generated
manifest of several child resources.
Expand Down Expand Up @@ -326,6 +338,12 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
items:
type: string
type: array
replicas:
default: 1
format: int32
Expand Down
13 changes: 13 additions & 0 deletions api/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -133,6 +139,13 @@ spec:
- type
type: object
type: array
networkAttachments:
additionalProperties:
items:
type: string
type: array
description: NetworkAttachments status of the deployment pods
type: object
readyCount:
description: ReadyCount of SwiftStorage instances
format: int32
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/swift_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ type SwiftSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:default=""
StorageClass string `json:"storageClass"`

// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`
}

// SwiftStatus defines the observed state of Swift
Expand Down
7 changes: 7 additions & 0 deletions api/v1beta1/swiftproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ type SwiftProxySpec struct {
// +kubebuilder:validation:Optional
// Override, provides the ability to override the generated manifest of several child resources.
Override ProxyOverrideSpec `json:"override,omitempty"`

// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`
}

// ProxyOverrideSpec to override the generated manifest of several child resources.
Expand All @@ -88,6 +92,9 @@ type SwiftProxyStatus struct {

// Conditions
Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
9 changes: 8 additions & 1 deletion api/v1beta1/swiftstorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ type SwiftStorageSpec struct {
// +kubebuilder:default=swift-conf
// Name of Secret containing swift.conf
SwiftConfSecret string `json:"swiftConfSecret"`

// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`
}

// SwiftStorageStatus defines the observed state of SwiftStorage
type SwiftStorageStatus struct {
// ReadyCount of SwiftStorage instances
ReadyCount int32 `json:"readyCount,omitempty"`

// Conditions
// Conditions
Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`

// NetworkAttachments status of the deployment pods
NetworkAttachments map[string][]string `json:"networkAttachments,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
45 changes: 45 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions config/crd/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
override:
description: Override, provides the ability to override the generated
manifest of several child resources.
Expand Down Expand Up @@ -310,6 +316,13 @@ spec:
- type
type: object
type: array
networkAttachments:
additionalProperties:
items:
type: string
type: array
description: NetworkAttachments status of the deployment pods
type: object
readyCount:
description: ReadyCount of SwiftProxy instances
format: int32
Expand Down
18 changes: 18 additions & 0 deletions config/crd/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ spec:
spec:
description: SwiftSpec defines the desired state of Swift
properties:
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
storageClass:
default: ""
description: Storage class. This is passed to SwiftStorage unless
Expand All @@ -63,6 +69,12 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
items:
type: string
type: array
override:
description: Override, provides the ability to override the generated
manifest of several child resources.
Expand Down Expand Up @@ -326,6 +338,12 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
items:
type: string
type: array
replicas:
default: 1
format: int32
Expand Down
13 changes: 13 additions & 0 deletions config/crd/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
items:
type: string
type: array
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -133,6 +139,13 @@ spec:
- type
type: object
type: array
networkAttachments:
additionalProperties:
items:
type: string
type: array
description: NetworkAttachments status of the deployment pods
type: object
readyCount:
description: ReadyCount of SwiftStorage instances
format: int32
Expand Down
2 changes: 2 additions & 0 deletions controllers/swift_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func (r *SwiftReconciler) storageCreateOrUpdate(ctx context.Context, instance *s
ContainerImageProxy: instance.Spec.SwiftStorage.ContainerImageProxy,
ContainerImageMemcached: instance.Spec.SwiftStorage.ContainerImageMemcached,
SwiftConfSecret: instance.Spec.SwiftConfSecret,
NetworkAttachments: instance.Spec.SwiftStorage.NetworkAttachments,
}

deployment := &swiftv1.SwiftStorage{
Expand Down Expand Up @@ -385,6 +386,7 @@ func (r *SwiftReconciler) proxyCreateOrUpdate(ctx context.Context, instance *swi
PasswordSelectors: instance.Spec.SwiftProxy.PasswordSelectors,
SwiftConfSecret: instance.Spec.SwiftConfSecret,
Override: instance.Spec.SwiftProxy.Override,
NetworkAttachments: instance.Spec.SwiftStorage.NetworkAttachments,
}

deployment := &swiftv1.SwiftProxy{
Expand Down
Loading

0 comments on commit be653df

Please sign in to comment.