mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 01:23:48 +00:00
generated: run refactor
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package pod
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
@@ -34,7 +35,7 @@ func PatchPodStatus(c clientset.Interface, namespace, name string, uid types.UID
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
updatedPod, err := c.CoreV1().Pods(namespace).Patch(name, types.StrategicMergePatchType, patchBytes, "status")
|
||||
updatedPod, err := c.CoreV1().Pods(namespace).Patch(context.TODO(), name, types.StrategicMergePatchType, patchBytes, "status")
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to patch status %q for pod %q/%q: %v", patchBytes, namespace, name, err)
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package pod
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
@@ -33,7 +34,7 @@ func TestPatchPodStatus(t *testing.T) {
|
||||
name := "name"
|
||||
uid := types.UID("myuid")
|
||||
client := &fake.Clientset{}
|
||||
client.CoreV1().Pods(ns).Create(&v1.Pod{
|
||||
client.CoreV1().Pods(ns).Create(context.TODO(), &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: ns,
|
||||
Name: name,
|
||||
|
Reference in New Issue
Block a user