// Uninstall uses Kubernetes client to uninstall Tiller.
323258
func Uninstall(client kubernetes.Interface, opts *Options) error {
	if err := deleteService(client.CoreV1(), opts.Namespace); err != nil {
		return err
	}
	if err := deleteDeployment(client, opts.Namespace); err != nil {
		return err
	}
	return deleteSecret(client.CoreV1(), opts.Namespace)
}
1235592
func (d *Driver) Remove() error {
	cs := d.getClient()
	p := cs.VirtualMachine.NewDestroyVirtualMachineParams(d.Id)
	p.SetExpunge(d.Expunge)
	if err := d.deleteFirewallRules(); err != nil {
		return err
	}
	if err := d.disassociatePublicIP(); err != nil {
		return err
	}
	if err := d.deleteKeyPair(); err != nil {
		return err
	}
	log.Info("Removing CloudStack instance...")
	if _, err := cs.VirtualMachine.DestroyVirtualMachine(p); err != nil {
		return err
	}
	if d.NetworkType == "Basic" {
		if err := d.deleteSecurityGroup(); err != nil {
			return err
		}
	}
	if d.DeleteVolumes {
		if err := d.deleteVolumes(); err != nil {
			return err
		}
	}
	return nil
}
31798
func UninstallKeybaseServices(context Context, log Log) error {
	runMode := context.GetRunMode()
	err0 := fallbackKillProcess(context, log, defaultServiceLabel(runMode, false), context.GetServiceInfoPath(), "")
	err1 := launchd.Uninstall(defaultServiceLabel(runMode, false), defaultLaunchdWait, log)
	err2 := launchd.Uninstall(defaultServiceLabel(runMode, true), defaultLaunchdWait, log)
	return libkb.CombineErrors(err0, err1, err2)
}
1340868
func (darwin *darwinRecord) isInstalled() bool {

	if _, err := os.Stat(darwin.servicePath()); err == nil {
		return true
	}

	return false
}
519825
func (w *Watcher) remove(d *structs.Deployment) {
	w.l.Lock()
	defer w.l.Unlock()

	// Not enabled so no-op
	if !w.enabled {
		return
	}

	if watcher, ok := w.watchers[d.ID]; ok {
		watcher.StopWatch()
		delete(w.watchers, d.ID)
	}
}
622719
func UninstallKBFS(context Context, mountDir string, forceUnmount bool, log Log) error {
	err := UninstallKBFSServices(context, log)
	if err != nil {
		log.Warning("Couldn't stop KBFS: %+v", err)
		// Continue despite the error, since the uninstall doesn't
		// seem to be resilient against the "fallback" PID getting out
		// of sync with the true KBFS PID.  TODO: fix the fallback PID
		// logic?
	}

	return unmount(mountDir, forceUnmount, log)
}
1091486
func (sm *ServiceMap) unmerge(other ServiceMap, UDPStaleClusterIP sets.String) {
	for svcPortName := range other {
		info, exists := (*sm)[svcPortName]
		if exists {
			klog.V(1).Infof("Removing service port %q", svcPortName)
			if info.GetProtocol() == v1.ProtocolUDP {
				UDPStaleClusterIP.Insert(info.ClusterIPString())
			}
			delete(*sm, svcPortName)
		} else {
			klog.Errorf("Service port %q doesn't exists", svcPortName)
		}
	}
}
1155376
func uninstallFile(a Agent) string {
	return filepath.Join(a.CurrentConfig().DataDir(), UninstallFile)
}
158676
func (c *ServiceClient) RemoveTask(task *TaskServices) {
	ops := operations{}

	for _, service := range task.Services {
		id := makeTaskServiceID(task.AllocID, task.Name, service, task.Canary)
		ops.deregServices = append(ops.deregServices, id)

		for _, check := range service.Checks {
			cid := makeCheckID(id, check)
			ops.deregChecks = append(ops.deregChecks, cid)

			if check.TriggersRestarts() {
				c.checkWatcher.Unwatch(cid)
			}
		}
	}

	// Remove the task from the alloc's registrations
	c.removeTaskRegistration(task.AllocID, task.Name)

	// Now add them to the deregistration fields; main Run loop will update
	c.commit(&ops)
}
945459
func (a *Agent) unloadProxies() error {
	for id := range a.State.Proxies() {
		if err := a.removeProxyLocked(id, false); err != nil {
			return fmt.Errorf("Failed deregistering proxy '%s': %s", id, err)
		}
	}
	return nil
}
1202765
func Uninstall(label string, wait time.Duration, log Log) error {
	service := NewService(label)
	service.SetLogger(log)
	return service.Uninstall(wait)
}
1217989
func (p *Proxy) Unsubscribe(tags []string) {
	lumber.Trace("Proxy unsubscribing from '%s'...", tags)

	if len(tags) == 0 {
		return
	}

	// remove tags from subscription
	p.Lock()
	p.subscriptions.Remove(tags)
	p.Unlock()
}
184915
func unmount(target string) error {
	if mounted, err := mounted(target); err != nil || !mounted {
		return err
	}
	return forceUnmount(target)
}
236736
func Upgrade(client kubernetes.Interface, opts *Options) error {
	obj, err := client.ExtensionsV1beta1().Deployments(opts.Namespace).Get(deploymentName, metav1.GetOptions{})
	if err != nil {
		return err
	}
	tillerImage := obj.Spec.Template.Spec.Containers[0].Image
	if semverCompare(tillerImage) == -1 && !opts.ForceUpgrade {
		return errors.New("current Tiller version is newer, use --force-upgrade to downgrade")
	}
	obj.Spec.Template.Spec.Containers[0].Image = opts.SelectImage()
	obj.Spec.Template.Spec.Containers[0].ImagePullPolicy = opts.pullPolicy()
	obj.Spec.Template.Spec.ServiceAccountName = opts.ServiceAccount
	if _, err := client.ExtensionsV1beta1().Deployments(opts.Namespace).Update(obj); err != nil {
		return err
	}
	// If the service does not exist that would mean we are upgrading from a Tiller version
	// that didn't deploy the service, so install it.
	_, err = client.CoreV1().Services(opts.Namespace).Get(serviceName, metav1.GetOptions{})
	if apierrors.IsNotFound(err) {
		return createService(client.CoreV1(), opts.Namespace)
	}
	return err
}
922464
func UninstallClusterManagerRBAC(clientset kubernetes.Interface) error {
	return UninstallRBAC(clientset, "kube-system", ArgoCDManagerClusterRoleBinding, ArgoCDManagerClusterRole, ArgoCDManagerServiceAccount)
}
313869
func (c *Cluster) Unregister(address string) error {
	err := c.runHookForAddr(HookEventBeforeNodeUnregister, address)
	if err != nil {
		return err
	}
	return c.storage().RemoveNode(address)
}
339821
func (c *Client) DynoRestartAll(appIdentity, message string) error {
	rh := RequestHeaders{CommitMessage: message}
	return c.DeleteWithHeaders("/apps/"+appIdentity+"/dynos", rh.Headers())
}