diff --git a/app/azure/models/container_group.js b/app/azure/models/container_group.js index 1c14f2d0d..2dcda73af 100644 --- a/app/azure/models/container_group.js +++ b/app/azure/models/container_group.js @@ -20,18 +20,18 @@ export function ContainerGroupDefaultModel() { } export function ContainerGroupViewModel(data) { - const addressPorts = data.properties.ipAddress.ports; + const addressPorts = data.properties.ipAddress ? data.properties.ipAddress.ports : []; const container = data.properties.containers.length ? data.properties.containers[0] : {}; const containerPorts = container ? container.properties.ports : []; this.Id = data.id; this.Name = data.name; this.Location = data.location; - this.IPAddress = data.properties.ipAddress.ip; + this.IPAddress = data.properties.ipAddress ? data.properties.ipAddress.ip : ''; this.Ports = addressPorts.length ? addressPorts.map((binding, index) => ({ container: containerPorts[index].port, host: binding.port, protocol: binding.protocol })) : []; this.Image = container.properties.image || ''; this.OSType = data.properties.osType; - this.AllocatePublicIP = data.properties.ipAddress.type === 'Public'; + this.AllocatePublicIP = data.properties.ipAddress && data.properties.ipAddress.type === 'Public'; this.CPU = container.properties.resources.requests.cpu; this.Memory = container.properties.resources.requests.memoryInGB; diff --git a/app/azure/views/containerinstances/container-instance-details/containerInstanceDetails.html b/app/azure/views/containerinstances/container-instance-details/containerInstanceDetails.html index 1b564bd9b..37465bcae 100644 --- a/app/azure/views/containerinstances/container-instance-details/containerInstanceDetails.html +++ b/app/azure/views/containerinstances/container-instance-details/containerInstanceDetails.html @@ -63,7 +63,7 @@ -