Skip to content

Commit

Permalink
fix: do not expose ports for custom image (#754)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>

Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy committed Aug 11, 2022
1 parent e77b7d6 commit ad4b9ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/lang/ir/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ func (g Graph) Labels() (map[string]string, error) {

func (g Graph) ExposedPorts() (map[string]struct{}, error) {
ports := make(map[string]struct{})

// do not expose ports for custom images
if g.Image != nil {
return ports, nil
}

ports[fmt.Sprintf("%d/tcp", config.SSHPortInContainer)] = struct{}{}
if g.JupyterConfig != nil {
ports[fmt.Sprintf("%d/tcp", config.JupyterPortInContainer)] = struct{}{}
Expand Down

0 comments on commit ad4b9ec

Please sign in to comment.