Fix problem with creating new VM.
This commit is contained in:
parent
3e2a5af6fd
commit
b0396ed8c1
1 changed files with 3 additions and 1 deletions
|
|
@ -110,7 +110,9 @@ import org.jdrupes.vmoperator.manager.VmDefChanged.Type;
|
||||||
var podApi = new DynamicKubernetesApi("", "v1", "pods", client);
|
var podApi = new DynamicKubernetesApi("", "v1", "pods", client);
|
||||||
var pods = podApi
|
var pods = podApi
|
||||||
.list(newCm.getMetadata().getNamespace(), listOpts).getObject();
|
.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;
|
return;
|
||||||
}
|
}
|
||||||
var pod = pods.getItems().get(0);
|
var pod = pods.getItems().get(0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue