// WaitUntilServiceState waits until isState returns true
WaitUntilServiceState waits until isState returns true
// WaitUntilServiceState waits until isState returns true
func (m *AppManager) WaitUntilServiceState(isState func(*apiv1.Service, error) bool) (*apiv1.Service, error) {
	serviceClient := m.client.Services(m.namespace)
	var lastService *apiv1.Service
	waitErr := wait.PollImmediate(PollInterval, PollTimeout, func() (bool, error) {
		var err error
		lastService, err = serviceClient.Get(m.app.AppName, metav1.GetOptions{})
		done := isState(lastService, err)
		if !done && err != nil {
			return true, err
		}
		return done, nil
	})
	if waitErr != nil {
		return lastService, fmt.Errorf("service %q is not in desired state, received: %+v: %s", m.app.AppName, lastService, waitErr)
	}
	return lastService, nil
}
func ( m * AppManager ) WaitUntilServiceState ( isState func ( * apiv1 . Service , error ) bool ) ( * apiv1 . Service , error ) { serviceClient := m . client . Services ( m . namespace ) var lastService * apiv1 . Service waitErr := wait . PollImmediate ( PollInterval , PollTimeout , func ( ) ( bool , error ) { var err error lastService , err = serviceClient . Get ( m . app . AppName , metav1 . GetOptions { } ) done := isState ( lastService , err ) if ! done && err != nil { return true , err } return done , nil } ) if waitErr != nil { return lastService , fmt . Errorf ( " " , m . app . AppName , lastService , waitErr ) } return lastService , nil }
WaitUntilServiceState waits until isState returns true
WaitUntilServiceState waits until isState returns true