Skip to content

Commit eff85ad

Browse files
cheina97adamjensenbot
authored andcommitted
VirtualKubelet: pod nil labels map
1 parent 3e1f2e3 commit eff85ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/virtualKubelet/forge/pods.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ func RemoteShadowPod(local *corev1.Pod, remote *vkv1alpha1.ShadowPod,
157157

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

0 commit comments

Comments
 (0)