@@ -65,7 +65,7 @@ func (w *statusWaiter) WatchUntilReady(resourceList ResourceList, timeout time.D
6565 if timeout == 0 {
6666 timeout = DefaultStatusWatcherTimeout
6767 }
68- ctx , cancel := context . WithTimeout ( context . Background (), timeout )
68+ ctx , cancel := w . contextWithTimeout ( timeout )
6969 defer cancel ()
7070 slog .Debug ("waiting for resources" , "count" , len (resourceList ), "timeout" , timeout )
7171 sw := watcher .NewDefaultStatusWatcher (w .client , w .restMapper )
@@ -86,33 +86,21 @@ func (w *statusWaiter) WatchUntilReady(resourceList ResourceList, timeout time.D
8686}
8787
8888func (w * statusWaiter ) Wait (resourceList ResourceList , timeout time.Duration ) error {
89- << << << < HEAD
90- ctx , cancel := w .contextWithTimeout (timeout )
91- || || || | parent of 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
92- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
93- == == == =
9489 if timeout == 0 {
9590 timeout = DefaultStatusWatcherTimeout
9691 }
97- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
98- >> >> >> > 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
92+ ctx , cancel := w .contextWithTimeout (timeout )
9993 defer cancel ()
10094 slog .Debug ("waiting for resources" , "count" , len (resourceList ), "timeout" , timeout )
10195 sw := watcher .NewDefaultStatusWatcher (w .client , w .restMapper )
10296 return w .wait (ctx , resourceList , sw )
10397}
10498
10599func (w * statusWaiter ) WaitWithJobs (resourceList ResourceList , timeout time.Duration ) error {
106- << << << < HEAD
107- ctx , cancel := w .contextWithTimeout (timeout )
108- || || || | parent of 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
109- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
110- == == == =
111100 if timeout == 0 {
112101 timeout = DefaultStatusWatcherTimeout
113102 }
114- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
115- >> >> >> > 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
103+ ctx , cancel := w .contextWithTimeout (timeout )
116104 defer cancel ()
117105 slog .Debug ("waiting for resources" , "count" , len (resourceList ), "timeout" , timeout )
118106 sw := watcher .NewDefaultStatusWatcher (w .client , w .restMapper )
@@ -123,16 +111,10 @@ func (w *statusWaiter) WaitWithJobs(resourceList ResourceList, timeout time.Dura
123111}
124112
125113func (w * statusWaiter ) WaitForDelete (resourceList ResourceList , timeout time.Duration ) error {
126- << << << < HEAD
127- ctx , cancel := w .contextWithTimeout (timeout )
128- || || || | parent of 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
129- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
130- == == == =
131114 if timeout == 0 {
132115 timeout = DefaultStatusWatcherTimeout
133116 }
134- ctx , cancel := context .WithTimeout (context .TODO (), timeout )
135- >> >> >> > 86 f98f870 (Prevent surprising failure with SDK when timeout is not set )
117+ ctx , cancel := w .contextWithTimeout (timeout )
136118 defer cancel ()
137119 slog .Debug ("waiting for resources to be deleted" , "count" , len (resourceList ), "timeout" , timeout )
138120 sw := watcher .NewDefaultStatusWatcher (w .client , w .restMapper )
0 commit comments