// WaitForTPRReady waits for a third party resource to be available
// for use.
WaitForTPRReady waits for a third party resource to be available
for use.
// WaitForTPRReady waits for a third party resource to be available // for use .
func WaitForTPRReady(restClient rest.Interface, tprGroup, tprVersion, tprName string) error {
	return wait.Poll(3*time.Second, 30*time.Second, func() (bool, error) {
		res := restClient.Get().AbsPath("apis", tprGroup, tprVersion, tprName).Do()
		err := res.Error()
		if err != nil {
			if se, ok := err.(*apierrors.StatusError); ok {
				if se.Status().Code == http.StatusNotFound {
					return false, nil
				}
			}
			return false, err
		}
		var statusCode int
		res.StatusCode(&statusCode)
		if statusCode != http.StatusOK {
			return false, fmt.Errorf("invalid status code: %d", statusCode)
		}
		return true, nil
	})
}
func WaitForTPRReady ( restClient rest . Interface , tprGroup , tprVersion , tprName string ) error { return wait . Poll ( 3 * time . Second , 30 * time . Second , func ( ) ( bool , error ) { res := restClient . Get ( ) . AbsPath ( " " , tprGroup , tprVersion , tprName ) . Do ( ) err := res . Error ( ) if err != nil { if se , ok := err . ( * apierrors . StatusError ) ; ok { if se . Status ( ) . Code == http . StatusNotFound { return false , nil } } return false , err } var statusCode int res . StatusCode ( & statusCode ) if statusCode != http . StatusOK { return false , fmt . Errorf ( " " , statusCode ) } return true , nil } ) }
WaitForTPRReady waits for a third party resource to be available
for use.
WaitForTPRReady waits for a third party resource to be available for use .
// RESTClient returns *apierrors.StatusError for any status codes < 200 or > 206 // and http.Client.Do errors are returned directly.