Skip to content

Commit 6fa7841

Browse files
committed
feat: the container's --private flag will inherited when using update
1 parent 3fd4425 commit 6fa7841

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cmd/update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func updateContainer() {
3939
ContainerType: oldContainer.ContainerType,
4040
HostPort: oldContainer.HostPort,
4141
Version: inputVersion,
42+
Private: oldContainer.Private,
4243
}
4344

4445
// 检查指定版本

docker/get_infos.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ func GetSSMContainers() (fec []Container, bec []Container) {
3535
Version: imageNameParts[1],
3636
}
3737

38+
// 继承原来的 private
39+
if len(c.Ports) > 0 && c.Ports[0].IP == "127.0.0.1" {
40+
ssmContainer.Private = true
41+
}
42+
3843
switch imageNameParts[0] {
3944
case vars.DockerNameFE:
4045
ssmContainer.ContainerType = vars.ContainerTypeFE

0 commit comments

Comments
 (0)