Skip to content

Commit

Permalink
VirtualKubelet: pod nil labels map
Browse files Browse the repository at this point in the history
  • Loading branch information
cheina97 authored and adamjensenbot committed Aug 4, 2023
1 parent 3e1f2e3 commit eff85ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/virtualKubelet/forge/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ func RemoteShadowPod(local *corev1.Pod, remote *vkv1alpha1.ShadowPod,

// Remove the label which identifies offloaded pods, as meaningful only locally.
localMetaFiltered := local.ObjectMeta.DeepCopy()
if localMetaFiltered.GetLabels() == nil {
localMetaFiltered.Labels = map[string]string{}
}
delete(localMetaFiltered.GetLabels(), liqoconst.LocalPodLabelKey)
localMetaFiltered.GetLabels()[LiqoOriginClusterNodeName] = LiqoNodeName

Expand Down

0 comments on commit eff85ad

Please sign in to comment.