mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Correct errors in the netpol test suite
It was confusing to see message saying "unable to update pod" when it was actually trying to create a Pod. Signed-off-by: Quan Tian <qtian@vmware.com>
This commit is contained in:
parent
cae22d8b8a
commit
b792f7392f
@ -179,7 +179,7 @@ func (k *kubeManager) createNamespace(ns *v1.Namespace) (*v1.Namespace, error) {
|
|||||||
enforcePodSecurityBaseline(ns)
|
enforcePodSecurityBaseline(ns)
|
||||||
createdNamespace, err := k.clientSet.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
createdNamespace, err := k.clientSet.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to update namespace %s: %w", ns.Name, err)
|
return nil, fmt.Errorf("unable to create namespace %s: %w", ns.Name, err)
|
||||||
}
|
}
|
||||||
return createdNamespace, nil
|
return createdNamespace, nil
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ func (k *kubeManager) createPod(pod *v1.Pod) (*v1.Pod, error) {
|
|||||||
|
|
||||||
createdPod, err := k.clientSet.CoreV1().Pods(ns).Create(context.TODO(), pod, metav1.CreateOptions{})
|
createdPod, err := k.clientSet.CoreV1().Pods(ns).Create(context.TODO(), pod, metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to update pod %s/%s: %w", ns, pod.Name, err)
|
return nil, fmt.Errorf("unable to create pod %s/%s: %w", ns, pod.Name, err)
|
||||||
}
|
}
|
||||||
return createdPod, nil
|
return createdPod, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user