@@ -133,12 +133,12 @@ export class ComputeWorkloadManager implements WorkloadManager {
133133 // Strip image digest - resolve by tag, not digest
134134 const imageRef = stripImageDigest ( opts . image ) ;
135135
136- // Per-VM network endpoint labels, applied to the VM's network endpoint so
137- // network policy can select it. Mirrors the label the Kubernetes workload
138- // manager sets on the run pod.
139- const networkLabels : Record < string , string > = { } ;
136+ // Labels forwarded to the compute provider for network-policy selection;
137+ // the provider promotes a configured subset to its network layer. Mirrors
138+ // the privatelink label the Kubernetes workload manager sets on the run pod.
139+ const labels : Record < string , string > = { } ;
140140 if ( opts . hasPrivateLink ) {
141- networkLabels . privatelink = opts . orgId ;
141+ labels . privatelink = opts . orgId ;
142142 }
143143
144144 // Wide event: single canonical log line emitted in finally
@@ -181,9 +181,7 @@ export class ComputeWorkloadManager implements WorkloadManager {
181181 deploymentVersion : opts . deploymentVersion ,
182182 machine : opts . machine . name ,
183183 } ,
184- ...( Object . keys ( networkLabels ) . length > 0
185- ? { network_labels : networkLabels }
186- : { } ) ,
184+ ...( Object . keys ( labels ) . length > 0 ? { labels } : { } ) ,
187185 } )
188186 ) ;
189187
@@ -321,12 +319,12 @@ export class ComputeWorkloadManager implements WorkloadManager {
321319 TRIGGER_WORKER_INSTANCE_NAME : this . opts . runner . instanceName ,
322320 } ;
323321
324- // Carry the same network endpoint labels onto the restored VM (mirror of
325- // the create path) so network policy keeps matching after a restore —
326- // without them a restored run would lose its policy-based egress .
327- const networkLabels : Record < string , string > = { } ;
322+ // Resupply the same labels on restore (mirror of the create path); the
323+ // provider doesn't persist them across a snapshot, so without this a
324+ // restored run would lose its policy-based network selection .
325+ const labels : Record < string , string > = { } ;
328326 if ( opts . hasPrivateLink && opts . orgId ) {
329- networkLabels . privatelink = opts . orgId ;
327+ labels . privatelink = opts . orgId ;
330328 }
331329
332330 this . logger . verbose ( "restore request body" , {
@@ -342,9 +340,7 @@ export class ComputeWorkloadManager implements WorkloadManager {
342340 metadata,
343341 cpu : opts . machine . cpu ,
344342 memory_gb : opts . machine . memory ,
345- ...( Object . keys ( networkLabels ) . length > 0
346- ? { network_labels : networkLabels }
347- : { } ) ,
343+ ...( Object . keys ( labels ) . length > 0 ? { labels } : { } ) ,
348344 } )
349345 ) ;
350346
0 commit comments