test/e2e: fix flake in kubelet expose should create services for rc
Add a loop to retry the request to account for the TLS Timeout and API credential error responses outlined by the flakes in #29227. Fixes #29227 Signed-off-by: Jess Frazelle <me@jessfraz.com>
This commit is contained in:
		@@ -652,10 +652,15 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
 | 
				
			|||||||
				err := wait.Poll(framework.Poll, timeout, func() (bool, error) {
 | 
									err := wait.Poll(framework.Poll, timeout, func() (bool, error) {
 | 
				
			||||||
					endpoints, err := c.Endpoints(ns).Get(name)
 | 
										endpoints, err := c.Endpoints(ns).Get(name)
 | 
				
			||||||
					if err != nil {
 | 
										if err != nil {
 | 
				
			||||||
						if apierrs.IsNotFound(err) {
 | 
											// log the real error
 | 
				
			||||||
 | 
											framework.Logf("Get endpoints failed (interval %v): %v", framework.Poll, err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											// if the error is API not found or could not find default credentials or TLS handshake timeout, try again
 | 
				
			||||||
 | 
											if apierrs.IsNotFound(err) ||
 | 
				
			||||||
 | 
												apierrs.IsUnauthorized(err) ||
 | 
				
			||||||
 | 
												apierrs.IsServerTimeout(err) {
 | 
				
			||||||
							err = nil
 | 
												err = nil
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
						framework.Logf("Get endpoints failed (interval %v): %v", framework.Poll, err)
 | 
					 | 
				
			||||||
						return false, err
 | 
											return false, err
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user