Fix problem with creating new VM.

This commit is contained in:
Michael Lipp 2023-08-12 15:28:26 +02:00
parent 3e2a5af6fd
commit b0396ed8c1

View file

@ -110,7 +110,9 @@ import org.jdrupes.vmoperator.manager.VmDefChanged.Type;
var podApi = new DynamicKubernetesApi("", "v1", "pods", client);
var pods = podApi
.list(newCm.getMetadata().getNamespace(), listOpts).getObject();
if (pods == null) {
// If the VM is being created, the pod may not exist yet.
if (pods == null || pods.getItems().size() == 0) {
return;
}
var pod = pods.getItems().get(0);