Fix sync pod log format and a func typo.

This commit is contained in:
KEBE 2019-08-29 14:39:43 +08:00
parent 37016c3364
commit 8dc401d141
2 changed files with 3 additions and 3 deletions

View File

@ -477,7 +477,7 @@ func (m *manager) syncPod(uid types.UID, status versionedPodStatus) {
// TODO: make me easier to express from client code // TODO: make me easier to express from client code
pod, err := m.kubeClient.CoreV1().Pods(status.podNamespace).Get(status.podName, metav1.GetOptions{}) pod, err := m.kubeClient.CoreV1().Pods(status.podNamespace).Get(status.podName, metav1.GetOptions{})
if errors.IsNotFound(err) { if errors.IsNotFound(err) {
klog.V(3).Infof("Pod %q (%s) does not exist on the server", status.podName, uid) klog.V(3).Infof("Pod %q does not exist on the server", format.PodDesc(status.podName, status.podNamespace, uid))
// If the Pod is deleted the status will be cleared in // If the Pod is deleted the status will be cleared in
// RemoveOrphanedStatuses, so we just ignore the update here. // RemoveOrphanedStatuses, so we just ignore the update here.
return return

View File

@ -28,7 +28,7 @@ import (
// PatchPodStatus patches pod status. // PatchPodStatus patches pod status.
func PatchPodStatus(c clientset.Interface, namespace, name string, oldPodStatus, newPodStatus v1.PodStatus) (*v1.Pod, []byte, error) { func PatchPodStatus(c clientset.Interface, namespace, name string, oldPodStatus, newPodStatus v1.PodStatus) (*v1.Pod, []byte, error) {
patchBytes, err := preparePatchBytesforPodStatus(namespace, name, oldPodStatus, newPodStatus) patchBytes, err := preparePatchBytesForPodStatus(namespace, name, oldPodStatus, newPodStatus)
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
@ -40,7 +40,7 @@ func PatchPodStatus(c clientset.Interface, namespace, name string, oldPodStatus,
return updatedPod, patchBytes, nil return updatedPod, patchBytes, nil
} }
func preparePatchBytesforPodStatus(namespace, name string, oldPodStatus, newPodStatus v1.PodStatus) ([]byte, error) { func preparePatchBytesForPodStatus(namespace, name string, oldPodStatus, newPodStatus v1.PodStatus) ([]byte, error) {
oldData, err := json.Marshal(v1.Pod{ oldData, err := json.Marshal(v1.Pod{
Status: oldPodStatus, Status: oldPodStatus,
}) })