@@ -242,7 +242,19 @@ func (c *commonControl) buildClaimOptions(ctx context.Context, claim *agentsv1al
242242 User : string (claim .UID ), // Use UID to ensure uniqueness across claim recreations
243243 Template : sandboxSet .Name ,
244244 Modifier : func (sbx infra.Sandbox ) {
245- // 1. apply labels
245+ // propagate annotations to sandbox
246+ if len (claim .Spec .Annotations ) > 0 {
247+ annotations := sbx .GetAnnotations ()
248+ if annotations == nil {
249+ annotations = make (map [string ]string )
250+ }
251+ for k , v := range claim .Spec .Annotations {
252+ annotations [k ] = v
253+ }
254+ sbx .SetAnnotations (annotations )
255+ }
256+
257+ // propagate labels to sandbox
246258 labels := sbx .GetLabels ()
247259 if labels == nil {
248260 labels = make (map [string ]string )
@@ -254,19 +266,18 @@ func (c *commonControl) buildClaimOptions(ctx context.Context, claim *agentsv1al
254266 }
255267 sbx .SetLabels (labels )
256268
257- // 2. apply annotations
258- if len (claim .Spec .Annotations ) > 0 {
259- annotations := sbx .GetAnnotations ()
260- if annotations == nil {
261- annotations = make (map [string ]string )
262- }
263- for k , v := range claim .Spec .Annotations {
264- annotations [k ] = v
265- }
266- sbx .SetAnnotations (annotations )
269+ // propagate annotations to podtemplate
270+ labels = sbx .GetPodLabels ()
271+ if labels == nil {
272+ labels = make (map [string ]string )
273+ }
274+
275+ for k , v := range claim .Spec .Labels {
276+ labels [k ] = v
267277 }
278+ sbx .SetPodLabels (labels )
268279
269- // 3. apply shutdownTime
280+ // apply shutdownTime
270281 if claim .Spec .ShutdownTime != nil {
271282 sbx .SetTimeout (infra.TimeoutOptions {
272283 ShutdownTime : claim .Spec .ShutdownTime .Time ,
0 commit comments