Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix containerId undefined #125

Merged
merged 1 commit into from Jan 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/data-provider.js
Expand Up @@ -87,7 +87,7 @@ let physicalStructProvider = ([initialNodes, initialContainers]) => {
"<br/> tag : " + (tagName ? tagName : "latest") +
"<br/>" + (cloned.Spec.ContainerSpec.Args ? " cmd : " + cloned.Spec.ContainerSpec.Args + "<br/>" : "") +
" updated : " + dateStamp +
"<br/>" + cloned.Status.ContainerStatus.ContainerID +
"<br/>" + (cloned.Status.ContainerStatus? cloned.Status.ContainerStatus.ContainerID : "null") +
"<br/> state : " + startState +
"</div>";

Expand Down Expand Up @@ -207,7 +207,8 @@ let physicalStructProvider = ([initialNodes, initialContainers]) => {
for (let container of containers) {
let contNodeId = container.NodeID;
let service = _.find(services, function(o) { return o.ID == container.ServiceID; });
container.ServiceName = service.Spec.Name;

container.ServiceName = service? service.Spec.Name : "null";
for (var i = 0, iLen = nodes.length; i < iLen; i++) {
if (nodes[i].ID == contNodeId) {
addContainer(container);
Expand Down Expand Up @@ -287,4 +288,4 @@ class DataProvider extends EventEmitter {
}
}

export default SINGLETON = new DataProvider();
export default SINGLETON = new DataProvider();