Skip to content

Commit 1e0225a

Browse files
api: standardise image configuration for Cell and Shard
Replaces the standalone `MultiGatewayImage` field in `CellSpec` with a `CellImages` struct to align with the `Shard` resource structure. Additionally, adds `ImagePullPolicy` and `ImagePullSecrets` to both `CellImages` and `ShardImages`. This allows proper configuration of private registry credentials and pull policies at the Cell and Shard levels.
1 parent 00754e3 commit 1e0225a

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

api/v1alpha1/cell_types.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20+
corev1 "k8s.io/api/core/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -45,9 +46,8 @@ type CellSpec struct {
4546
// +kubebuilder:validation:MaxLength=63
4647
Region string `json:"region,omitempty"`
4748

48-
// MultiGatewayImage is the image used for the gateway in this cell.
49-
// +kubebuilder:validation:MaxLength=512
50-
MultiGatewayImage string `json:"multigatewayImage"`
49+
// Images defines the container images used in this cell.
50+
Images CellImages `json:"images"`
5151

5252
// MultiGateway fully resolved config.
5353
MultiGateway StatelessSpec `json:"multigateway"`
@@ -69,6 +69,22 @@ type CellSpec struct {
6969
TopologyReconciliation TopologyReconciliation `json:"topologyReconciliation,omitempty"`
7070
}
7171

72+
// CellImages defines the images required for a Cell.
73+
type CellImages struct {
74+
// ImagePullPolicy overrides the default image pull policy.
75+
// +optional
76+
// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
77+
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
78+
79+
// ImagePullSecrets is a list of references to secrets in the same namespace.
80+
// +optional
81+
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
82+
83+
// MultiGateway is the image used for the gateway.
84+
// +kubebuilder:validation:MaxLength=512
85+
MultiGateway string `json:"multigateway"`
86+
}
87+
7288
// TopologyReconciliation defines flags for the cell controller.
7389
type TopologyReconciliation struct {
7490
// RegisterCell indicates if the cell should register itself in the topology.

api/v1alpha1/shard_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ type ShardSpec struct {
112112

113113
// ShardImages defines the images required for a Shard.
114114
type ShardImages struct {
115+
// ImagePullPolicy overrides the default image pull policy.
116+
// +optional
117+
// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
118+
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
119+
120+
// ImagePullSecrets is a list of references to secrets in the same namespace.
121+
// +optional
122+
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
123+
115124
// MultiOrch is the image for the shard orchestrator.
116125
// +kubebuilder:validation:MaxLength=512
117126
MultiOrch string `json:"multiorch"`

0 commit comments

Comments
 (0)