mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
Warn if pod has no labels
This commit is contained in:
@@ -66,6 +66,10 @@ func (r RealPodControl) createReplica(namespace string, controller api.Replicati
|
||||
glog.Errorf("Unable to convert pod template: %v", err)
|
||||
return
|
||||
}
|
||||
if labels.Set(pod.Labels).AsSelector().Empty() {
|
||||
glog.Errorf("Unable to create pod replica, no labels")
|
||||
return
|
||||
}
|
||||
if _, err := r.kubeClient.Pods(namespace).Create(pod); err != nil {
|
||||
glog.Errorf("Unable to create pod replica: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user