Search in sources :

Example 1 with KubernetesClusterDestroyWorker

use of com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterDestroyWorker in project cloudstack by apache.

the class KubernetesClusterManagerImpl method deleteKubernetesCluster.

@Override
public boolean deleteKubernetesCluster(Long kubernetesClusterId) throws CloudRuntimeException {
    if (!KubernetesServiceEnabled.value()) {
        logAndThrow(Level.ERROR, "Kubernetes Service plugin is disabled");
    }
    KubernetesClusterVO cluster = kubernetesClusterDao.findById(kubernetesClusterId);
    if (cluster == null) {
        throw new InvalidParameterValueException("Invalid cluster id specified");
    }
    accountManager.checkAccess(CallContext.current().getCallingAccount(), SecurityChecker.AccessType.OperateEntry, false, cluster);
    KubernetesClusterDestroyWorker destroyWorker = new KubernetesClusterDestroyWorker(cluster, this);
    destroyWorker = ComponentContext.inject(destroyWorker);
    return destroyWorker.destroy();
}
Also used : InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) KubernetesClusterDestroyWorker(com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterDestroyWorker)

Aggregations

InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 KubernetesClusterDestroyWorker (com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterDestroyWorker)1