Search in sources :

Example 1 with KubernetesClusterUpgradeWorker

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

the class KubernetesClusterManagerImpl method upgradeKubernetesCluster.

@Override
public boolean upgradeKubernetesCluster(UpgradeKubernetesClusterCmd cmd) throws CloudRuntimeException {
    if (!KubernetesServiceEnabled.value()) {
        logAndThrow(Level.ERROR, "Kubernetes Service plugin is disabled");
    }
    validateKubernetesClusterUpgradeParameters(cmd);
    KubernetesClusterVO kubernetesCluster = kubernetesClusterDao.findById(cmd.getId());
    Account owner = accountService.getActiveAccountById(kubernetesCluster.getAccountId());
    String[] keys = getServiceUserKeys(owner);
    KubernetesClusterUpgradeWorker upgradeWorker = new KubernetesClusterUpgradeWorker(kubernetesClusterDao.findById(cmd.getId()), kubernetesSupportedVersionDao.findById(cmd.getKubernetesVersionId()), this, keys);
    upgradeWorker = ComponentContext.inject(upgradeWorker);
    return upgradeWorker.upgradeCluster();
}
Also used : UserAccount(com.cloud.user.UserAccount) Account(com.cloud.user.Account) KubernetesClusterUpgradeWorker(com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterUpgradeWorker)

Aggregations

KubernetesClusterUpgradeWorker (com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterUpgradeWorker)1 Account (com.cloud.user.Account)1 UserAccount (com.cloud.user.UserAccount)1