- self.log.debug('Uninstalling tiller from cluster {}'.format(cluster_uuid))
- command = '{} --kubeconfig={} --home={} reset'\
- .format(self._helm_command, config_filename, helm_dir)
- self.log.debug('resetting: {}'.format(command))
- output, rc = await self._local_async_exec(command=command, raise_exception_on_error=True)
+ self.log.debug(
+ "Uninstalling tiller from cluster {}".format(cluster_id)
+ )
+ command = "{} --kubeconfig={} --home={} reset".format(
+ self._helm_command, config_filename, helm_dir
+ )
+ self.log.debug("resetting: {}".format(command))
+ output, _rc = await self._local_async_exec(
+ command=command, raise_exception_on_error=True
+ )
+ # Delete clusterrolebinding and serviceaccount.
+ # Ignore if errors for backward compatibility
+ command = ("{} --kubeconfig={} delete clusterrolebinding.rbac.authorization.k8s."
+ "io/osm-tiller-cluster-rule").format(self.kubectl_command,
+ config_filename)
+ output, _rc = await self._local_async_exec(command=command,
+ raise_exception_on_error=False)
+ command = "{} --kubeconfig={} --namespace kube-system delete serviceaccount/{}".\
+ format(self.kubectl_command, config_filename, self.service_account)
+ output, _rc = await self._local_async_exec(command=command,
+ raise_exception_on_error=False)
+