@@ -83,8 +83,9 @@ func (c *PodClient) Create(pod *v1.Pod) *v1.Pod {
83
83
return p
84
84
}
85
85
86
- // CreateSyncInNamespace creates a new pod according to the framework specifications in the given namespace, and waits for it to start.
87
- func (c * PodClient ) CreateSyncInNamespace (pod * v1.Pod , namespace string ) * v1.Pod {
86
+ // CreateSync creates a new pod according to the framework specifications, and wait for it to start.
87
+ func (c * PodClient ) CreateSync (pod * v1.Pod ) * v1.Pod {
88
+ namespace := c .f .Namespace .Name
88
89
p := c .Create (pod )
89
90
ExpectNoError (e2epod .WaitForPodNameRunningInNamespace (c .f .ClientSet , p .Name , namespace ))
90
91
// Get the newest pod after it becomes running, some status may change after pod created, such as pod ip.
@@ -93,11 +94,6 @@ func (c *PodClient) CreateSyncInNamespace(pod *v1.Pod, namespace string) *v1.Pod
93
94
return p
94
95
}
95
96
96
- // CreateSync creates a new pod according to the framework specifications, and wait for it to start.
97
- func (c * PodClient ) CreateSync (pod * v1.Pod ) * v1.Pod {
98
- return c .CreateSyncInNamespace (pod , c .f .Namespace .Name )
99
- }
100
-
101
97
// CreateBatch create a batch of pods. All pods are created before waiting.
102
98
func (c * PodClient ) CreateBatch (pods []* v1.Pod ) []* v1.Pod {
103
99
ps := make ([]* v1.Pod , len (pods ))
@@ -140,12 +136,7 @@ func (c *PodClient) Update(name string, updateFn func(pod *v1.Pod)) {
140
136
// DeleteSync deletes the pod and wait for the pod to disappear for `timeout`. If the pod doesn't
141
137
// disappear before the timeout, it will fail the test.
142
138
func (c * PodClient ) DeleteSync (name string , options * metav1.DeleteOptions , timeout time.Duration ) {
143
- c .DeleteSyncInNamespace (name , c .f .Namespace .Name , options , timeout )
144
- }
145
-
146
- // DeleteSyncInNamespace deletes the pod from the namespace and wait for the pod to disappear for `timeout`. If the pod doesn't
147
- // disappear before the timeout, it will fail the test.
148
- func (c * PodClient ) DeleteSyncInNamespace (name string , namespace string , options * metav1.DeleteOptions , timeout time.Duration ) {
139
+ namespace := c .f .Namespace .Name
149
140
err := c .Delete (name , options )
150
141
if err != nil && ! apierrors .IsNotFound (err ) {
151
142
Failf ("Failed to delete pod %q: %v" , name , err )
0 commit comments