func (j *TestJig) Run(tweak func(rc *v1.ReplicationController)) (*v1.ReplicationController, error) {
	rc := j.newRCTemplate()
	if tweak != nil {
		tweak(rc)
	}
	result, err := j.Client.CoreV1().ReplicationControllers(j.Namespace).Create(context.TODO(), rc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create RC %q: %v", rc.Name, err)
	}
	pods, err := j.waitForPodsCreated(int(*(rc.Spec.Replicas)))
	if err != nil {
		return nil, fmt.Errorf("failed to create pods: %v", err)
	}
	if err := j.waitForPodsReady(pods); err != nil {
		return nil, fmt.Errorf("failed waiting for pods to be running: %v", err)
	}
	return result, nil
}
// Run creates a ReplicationController and Pod(s) and waits for the
// Pod(s) to be running. Callers can provide a function to tweak the RC object
// before it is created.
Run creates a ReplicationController and Pod(s) and waits for the
Pod(s) to be running. Callers can provide a function to tweak the RC object
before it is created.
// Run creates a ReplicationController and Pod ( s ) and waits for the // Pod ( s ) to be running . Callers can provide a function to tweak the RC object // before it is created .
func (j *TestJig) Run(tweak func(rc *v1.ReplicationController)) (*v1.ReplicationController, error) {
	rc := j.newRCTemplate()
	if tweak != nil {
		tweak(rc)
	}
	result, err := j.Client.CoreV1().ReplicationControllers(j.Namespace).Create(context.TODO(), rc, metav1.CreateOptions{})
	if err != nil {
		return nil, fmt.Errorf("failed to create RC %q: %v", rc.Name, err)
	}
	pods, err := j.waitForPodsCreated(int(*(rc.Spec.Replicas)))
	if err != nil {
		return nil, fmt.Errorf("failed to create pods: %v", err)
	}
	if err := j.waitForPodsReady(pods); err != nil {
		return nil, fmt.Errorf("failed waiting for pods to be running: %v", err)
	}
	return result, nil
}
func ( j * TestJig ) Run ( tweak func ( rc * v1 . ReplicationController ) ) ( * v1 . ReplicationController , error ) { rc := j . newRCTemplate ( ) if tweak != nil { tweak ( rc ) } result , err := j . Client . CoreV1 ( ) . ReplicationControllers ( j . Namespace ) . Create ( context . TODO ( ) , rc , metav1 . CreateOptions { } ) if err != nil { return nil , fmt . Errorf ( " " , rc . Name , err ) } pods , err := j . waitForPodsCreated ( int ( * ( rc . Spec . Replicas ) ) ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if err := j . waitForPodsReady ( pods ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } return result , nil }
Run creates a ReplicationController and Pod(s) and waits for the
Pod(s) to be running.
Run creates a ReplicationController and Pod ( s ) and waits for the Pod ( s ) to be running .