@@ -138,6 +138,16 @@ type SandboxContainer struct {
138138 // so replicate the structure here too.
139139 Env []corev1.EnvVar `json:"env,omitempty"`
140140
141+ // List of sources to populate environment variables in the container.
142+ // The keys defined within a source must be a C_IDENTIFIER. All invalid
143+ // keys will be reported as an event when the container is starting. When a
144+ // key exists in multiple sources, the value associated with the last source
145+ // will take precedence. Values defined by an Env with a duplicate key will
146+ // take precedence.
147+ //
148+ // +kubebuilder:validation:Optional
149+ EnvFrom []EnvFromSource `json:"envFrom,omitempty"`
150+
141151 // The resource requirements for the container, such as CPU, memory, and GPUs.
142152 //
143153 // +kubebuilder:validation:Optional
@@ -156,6 +166,54 @@ type SandboxContainer struct {
156166 Ports []NamedPort `json:"ports,omitempty"`
157167}
158168
169+ // EnvFromSource represents a source for a set of ConfigMaps or Secrets to be
170+ // used as environment variables in a container.
171+ type EnvFromSource struct {
172+ // An optional identifier to prepend to each key in the referenced
173+ // ConfigMap or Secret. Must be a valid C_IDENTIFIER.
174+ //
175+ // +kubebuilder:validation:Optional
176+ Prefix string `json:"prefix,omitempty"`
177+
178+ // The ConfigMap to select from.
179+ //
180+ // +kubebuilder:validation:Optional
181+ ConfigMapRef * ConfigMapEnvSource `json:"configMapRef,omitempty"`
182+
183+ // The Secret to select from.
184+ //
185+ // +kubebuilder:validation:Optional
186+ SecretRef * SecretEnvSource `json:"secretRef,omitempty"`
187+ }
188+
189+ // ConfigMapEnvSource selects a ConfigMap to populate the environment variables
190+ // of a container.
191+ type ConfigMapEnvSource struct {
192+ // Name of the ConfigMap in the same namespace as the Workload.
193+ //
194+ // +kubebuilder:validation:Required
195+ Name string `json:"name"`
196+
197+ // Specify whether the ConfigMap must be defined.
198+ //
199+ // +kubebuilder:validation:Optional
200+ Optional * bool `json:"optional,omitempty"`
201+ }
202+
203+ // SecretEnvSource selects a Secret to populate the environment variables
204+ // of a container.
205+ type SecretEnvSource struct {
206+ // Name of the Secret in the same namespace as the Workload.
207+ //
208+ // +kubebuilder:validation:Required
209+ Name string `json:"name"`
210+
211+ // Specify whether the Secret must be defined.
212+ //
213+ // +kubebuilder:validation:Optional
214+ Optional * bool `json:"optional,omitempty"`
215+ }
216+
159217type ContainerResourceRequirements struct {
160218 // Limits describes the maximum amount of compute resources allowed.
161219 //
@@ -414,6 +472,38 @@ const (
414472
415473 // InstanceQuotaGranted indicates whether quota has been allocated for the instance
416474 InstanceQuotaGranted = "QuotaGranted"
475+
476+ // ReferencedDataReady indicates whether all ConfigMaps and Secrets referenced
477+ // by the workload template have been resolved and delivered to the cell.
478+ // This condition is set on both WorkloadDeployment (resolver view) and
479+ // Instance (cell view).
480+ ReferencedDataReady = "ReferencedDataReady"
481+ )
482+
483+ const (
484+ // ReferencedDataReasonResolving indicates the resolver is in the process of
485+ // reading source ConfigMaps/Secrets from the project control plane.
486+ ReferencedDataReasonResolving = "Resolving"
487+
488+ // ReferencedDataReasonAwaitingPropagation indicates the expected companions
489+ // have not yet all arrived on the cell.
490+ ReferencedDataReasonAwaitingPropagation = "AwaitingPropagation"
491+
492+ // ReferencedDataReasonSourceNotFound indicates one or more referenced
493+ // ConfigMaps or Secrets could not be found in the project namespace.
494+ ReferencedDataReasonSourceNotFound = "SourceNotFound"
495+
496+ // ReferencedDataReasonSourceUnauthorized indicates the management identity
497+ // does not have permission to read one or more referenced objects.
498+ ReferencedDataReasonSourceUnauthorized = "SourceUnauthorized"
499+
500+ // ReferencedDataReasonSourceTooLarge indicates one or more referenced objects
501+ // exceed the allowed size limit.
502+ ReferencedDataReasonSourceTooLarge = "SourceTooLarge"
503+
504+ // ReferencedDataReasonReady indicates all referenced data has been resolved
505+ // and is present on the cell.
506+ ReferencedDataReasonReady = "Ready"
417507)
418508
419509const (
0 commit comments