func ReplicationControllerUpdate(d *schema.ResourceData, meta interface{}) error {
	log.Printf("[DEBUG] ReplicationControllerUpdate")

	kubeClient := meta.(*config.KubeProviderClient)

	rc := build.ReplicationController(d, kubeClient.Version)

	kubeRepControllers := kubeClient.KubeClient.ReplicationControllers(kubeClient.Namespace)

	originalRepController, err := kubeRepControllers.Get(d.Id())

	if err != nil {
		log.Printf("Error getting original replication controller: %v", err)
		return err
	}

	originalRepController.Spec.Replicas = 0
	_, err = kubeRepControllers.Update(originalRepController)

	if err != nil {
		log.Printf("Error updating replication controller replica count to 0: %v", err)
		return err
	}

	// Just to be sure lets delete any pods matching the selectors for the RC

	kubePods := kubeClient.KubeClient.Pods(kubeClient.Namespace)

	podsList, podGetErr := kubePods.List(
		labels.SelectorFromSet(
			originalRepController.Spec.Selector),
		fields.Everything())

	if podGetErr != nil {
		log.Printf("Error listing pods for old RC: %v", podGetErr)
	} else if podsList != nil {
		if len(podsList.Items) > 0 {
			for _, pod := range podsList.Items {
				podDeleteErr := kubePods.Delete(pod.Name, nil)
				if podDeleteErr != nil {
					log.Printf("Error deleting pod (%s) for old RC: %v", pod.ObjectMeta.Name, podDeleteErr)
				}
			}
		}
	}

	updatedRepController, updateErr := kubeRepControllers.Update(rc)

	if updateErr != nil {
		return updateErr
	}

	d.SetId(updatedRepController.ObjectMeta.Name)
	return ReplicationControllerRead(d, meta)
}
func ReplicationControllerCreate(d *schema.ResourceData, meta interface{}) error {
	log.Printf("[DEBUG] ReplicationControllerCreate")

	kubeClient := meta.(*config.KubeProviderClient)

	rc := build.ReplicationController(d, kubeClient.Version)

	kubeRepControllers := kubeClient.KubeClient.ReplicationControllers(kubeClient.Namespace)
	rcCreate, errCreate := kubeRepControllers.Create(rc)

	if errCreate != nil {
		return errCreate
	}

	d.SetId(rcCreate.ObjectMeta.Name)
	return ReplicationControllerRead(d, meta)
}