func Delete(yaml string) error {
	kbCfg, err := config.GetConfig()
	if err != nil {
		return err
	}
	mgr, err := manager.New(kbCfg,
		manager.Options{MetricsBindAddress: ":8081"})
	if err != nil {
		return err
	}

	err = tenancyv1alpha1.AddToScheme(mgr.GetScheme())
	if err != nil {
		return err
	}

	ro, err := vcctlutil.YamlToObj(mgr.GetScheme(), yaml)
	if err != nil {
		return err
	}

	vc, ok := ro.(*tenancyv1alpha1.Virtualcluster)
	if !ok {
		return errors.New("please specify a virtualcluster yaml")
	}

	// delete the virtualcluster object
	err = mgr.GetClient().Delete(context.TODO(), vc)
	if err != nil {
		return err
	}

	return nil
}
// Delete deletes the Virtualcluster vcName
Delete deletes the Virtualcluster vcName
// Delete deletes the Virtualcluster vcName
func Delete(yaml string) error {
	kbCfg, err := config.GetConfig()
	if err != nil {
		return err
	}
	mgr, err := manager.New(kbCfg,
		manager.Options{MetricsBindAddress: ":8081"})
	if err != nil {
		return err
	}
	err = tenancyv1alpha1.AddToScheme(mgr.GetScheme())
	if err != nil {
		return err
	}
	ro, err := vcctlutil.YamlToObj(mgr.GetScheme(), yaml)
	if err != nil {
		return err
	}
	vc, ok := ro.(*tenancyv1alpha1.Virtualcluster)
	if !ok {
		return errors.New("please specify a virtualcluster yaml")
	}
	err = mgr.GetClient().Delete(context.TODO(), vc)
	if err != nil {
		return err
	}
	return nil
}
func Delete ( yaml string ) error { kbCfg , err := config . GetConfig ( ) if err != nil { return err } mgr , err := manager . New ( kbCfg , manager . Options { MetricsBindAddress : " " } ) if err != nil { return err } err = tenancyv1alpha1 . AddToScheme ( mgr . GetScheme ( ) ) if err != nil { return err } ro , err := vcctlutil . YamlToObj ( mgr . GetScheme ( ) , yaml ) if err != nil { return err } vc , ok := ro . ( * tenancyv1alpha1 . Virtualcluster ) if ! ok { return errors . New ( " " ) } err = mgr . GetClient ( ) . Delete ( context . TODO ( ) , vc ) if err != nil { return err } return nil }
Delete deletes the Virtualcluster vcName
Delete deletes the Virtualcluster vcName
// delete the virtualcluster object