func MigrateAppsCRDs() error {
	config.Set("kubernetes:use-pool-namespaces", false)
	defer config.Unset("kubernetes:use-pool-namespaces")
	prov := kubernetes.GetProvisioner()
	pools, err := pool.ListAllPools()
	if err != nil {
		return errors.Wrap(err, "failed to list pools")
	}
	var kubePools []string
	for _, p := range pools {
		if p.Provisioner == prov.GetName() {
			kubePools = append(kubePools, p.Name)
		}
	}
	apps, err := app.List(&app.Filter{Pools: kubePools})
	if err != nil {
		return errors.Wrap(err, "failed to list apps")
	}
	multiErr := tsuruerrors.NewMultiError()
	for _, a := range apps {
		errProv := prov.Provision(&a)
		if errProv != nil {
			multiErr.Add(errProv)
		}
	}
	return multiErr.ToError()
}
func MigrateAppsCRDs() error {
	config.Set("kubernetes:use-pool-namespaces", false)
	defer config.Unset("kubernetes:use-pool-namespaces")
	prov := kubernetes.GetProvisioner()
	pools, err := pool.ListAllPools()
	if err != nil {
		return errors.Wrap(err, "failed to list pools")
	}
	var kubePools []string
	for _, p := range pools {
		if p.Provisioner == prov.GetName() {
			kubePools = append(kubePools, p.Name)
		}
	}
	apps, err := app.List(&app.Filter{Pools: kubePools})
	if err != nil {
		return errors.Wrap(err, "failed to list apps")
	}
	multiErr := tsuruerrors.NewMultiError()
	for _, a := range apps {
		errProv := prov.Provision(&a)
		if errProv != nil {
			multiErr.Add(errProv)
		}
	}
	return multiErr.ToError()
}
func MigrateAppsCRDs ( ) error { config . Set ( " " , false ) defer config . Unset ( " " ) prov := kubernetes . GetProvisioner ( ) pools , err := pool . ListAllPools ( ) if err != nil { return errors . Wrap ( err , " " ) } var kubePools [ ] string for _ , p := range pools { if p . Provisioner == prov . GetName ( ) { kubePools = append ( kubePools , p . Name ) } } apps , err := app . List ( & app . Filter { Pools : kubePools } ) if err != nil { return errors . Wrap ( err , " " ) } multiErr := tsuruerrors . NewMultiError ( ) for _ , a := range apps { errProv := prov . Provision ( & a ) if errProv != nil { multiErr . Add ( errProv ) } } return multiErr . ToError ( ) }
// MigrateAppsCRDs creates the necessary CRDs for every application
// on a Kubernetes cluster. This is done by re-provisioning the App
// on the cluster.
MigrateAppsCRDs creates the necessary CRDs for every application on a Kubernetes cluster . This is done by re - provisioning the App on the cluster .