Skip to content

Commit 170051b

Browse files
committed
fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 237ff4b commit 170051b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterDestroyWorker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import com.cloud.vm.ReservationContextImpl;
4949
import com.cloud.vm.UserVmVO;
5050
import com.cloud.vm.VMInstanceVO;
51+
import com.cloud.vm.VirtualMachine;
5152

5253
public class KubernetesClusterDestroyWorker extends KubernetesClusterResourceModifierActionWorker {
5354

@@ -200,9 +201,9 @@ public boolean destroy() throws CloudRuntimeException {
200201
if (network == null) {
201202
logAndThrow(Level.ERROR, String.format("Failed to find network for Kubernetes cluster ID: %s", kubernetesCluster.getUuid()));
202203
}
203-
List<VMInstanceVO> networkVMs = vmInstanceDao.listNonRemovedVmsByTypeAndNetwork(network.getId(), null);
204+
List<VMInstanceVO> networkVMs = vmInstanceDao.listNonRemovedVmsByTypeAndNetwork(network.getId(), VirtualMachine.Type.User);
204205
if (networkVMs.size() > clusterVMs.size()) {
205-
logAndThrow(Level.ERROR, String.format("Network ID: %s for Kubernetes cluster ID: %s has instances using it which are not part of the Kubernetes cluster", kubernetesCluster.getUuid()));
206+
logAndThrow(Level.ERROR, String.format("Network ID: %s for Kubernetes cluster ID: %s has instances using it which are not part of the Kubernetes cluster", network.getUuid(), kubernetesCluster.getUuid()));
206207
}
207208
for (VMInstanceVO vm : networkVMs) {
208209
boolean vmFoundInKubernetesCluster = false;

0 commit comments

Comments
 (0)