From c7985ed318f2d9f6e4d9e6883a5cd08870b85c5d Mon Sep 17 00:00:00 2001 From: Akilan Selvacoumar Date: Fri, 13 Aug 2021 22:52:01 +0400 Subject: [PATCH] fixed when container removed to be removed from the tracked list --- client/GroupTrackContainer.go | 6 +++ .../trackcontainers/grouptrackcontainers.json | 40 +------------------ 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/client/GroupTrackContainer.go b/client/GroupTrackContainer.go index 1de60ac..9cbfb71 100644 --- a/client/GroupTrackContainer.go +++ b/client/GroupTrackContainer.go @@ -152,6 +152,12 @@ func RemoveContainerGroups(ContainerID string) error { if err != nil { return err } + // Write groups information on the grouptrackcontainer.json file + err = groups.WriteGroup() + if err != nil { + return err + } + return nil } diff --git a/client/trackcontainers/grouptrackcontainers.json b/client/trackcontainers/grouptrackcontainers.json index 3274ffe..542ed4f 100644 --- a/client/trackcontainers/grouptrackcontainers.json +++ b/client/trackcontainers/grouptrackcontainers.json @@ -2,45 +2,7 @@ "Groups": [ { "ID": "grp8c59a8bd-56c2-4234-b7b7-3ef4727da927", - "TrackContainer": [ - { - "ID": "9c407a796018eba3db51eda61d6e6f75adea2da66bca2e7a2b1c1cdb08f282aa", - "Container": { - "SSHUsername": "master", - "SSHPassword": "password", - "ID": "9c407a796018eba3db51eda61d6e6f75adea2da66bca2e7a2b1c1cdb08f282aa", - "TagName": "p2p-ubuntu", - "ImagePath": "/home/akilan/Documents/p2p-rendering-computation/server/docker/containers/docker-ubuntu-sshd/", - "Ports": { - "Port": [ - { - "PortName": "SSH", - "InternalPort": 22, - "Type": "tcp", - "ExternalPort": 43835, - "Description": "SSH Port" - }, - { - "PortName": "NoVNC", - "InternalPort": 5901, - "Type": "tcp", - "ExternalPort": 34383, - "Description": "NoVNC port" - }, - { - "PortName": "NoVNC", - "InternalPort": 6081, - "Type": "tcp", - "ExternalPort": 34501, - "Description": "NoVNC port" - } - ] - }, - "GPU": "false" - }, - "IpAddress": "0.0.0.0" - } - ] + "TrackContainer": [] } ] } \ No newline at end of file