Skip to content

Commit ec4167b

Browse files
committed
Remove Host option
1 parent 02baa43 commit ec4167b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

cmd/options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ func GetOptions() *Options {
102102
ToolsCodeServer: &ToolsCodeServerOptions{
103103
Image: "ghcr.io/kaelemc/clab-code-server:latest",
104104
Name: "clab-code-server",
105-
Host: "localhost",
106105
LogLevel: "debug",
107106
OutputFormat: "table",
108107
},
@@ -428,7 +427,6 @@ type ToolsCodeServerOptions struct {
428427
Image string
429428
Name string
430429
Port uint
431-
Host string
432430
LogLevel string
433431
OutputFormat string
434432
LabsDirectory string

cmd/tools_code_server.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (*codeServerNode) GetEndpoints() []clablinks.Endpoint {
170170
}
171171

172172
// createLabels creates container labels.
173-
func createCodeServerLabels(containerName, owner string, port uint, labsDir, host string) map[string]string {
173+
func createCodeServerLabels(containerName, owner string, port uint, labsDir string) map[string]string {
174174
labels := map[string]string{
175175
clablabels.NodeName: containerName,
176176
clablabels.NodeKind: "linux",
@@ -239,7 +239,7 @@ func codeServerStart(cobraCmd *cobra.Command, o *Options) error { //nolint: funl
239239

240240
owner := getOwnerName(o)
241241
labels := createCodeServerLabels(o.ToolsCodeServer.Name, owner, o.ToolsCodeServer.Port,
242-
o.ToolsCodeServer.LabsDirectory, o.ToolsCodeServer.Host)
242+
o.ToolsCodeServer.LabsDirectory)
243243

244244
// Create and start code server container
245245
log.Info("Creating code server container", "name", o.ToolsCodeServer.Name)
@@ -271,16 +271,15 @@ func codeServerStart(cobraCmd *cobra.Command, o *Options) error { //nolint: funl
271271
if err == nil && len(containers) > 0 && len(containers[0].Ports) > 0 {
272272
for _, portMapping := range containers[0].Ports {
273273
if portMapping.ContainerPort == 8080 {
274-
log.Infof("code-server available at: http://%s:%d",
275-
o.ToolsCodeServer.Host, portMapping.HostPort)
274+
log.Infof("code-server available at: http://0.0.0.0:%d", portMapping.HostPort)
276275
break
277276
}
278277
}
279278
} else {
280279
log.Infof("code-server container started. Check 'docker ps' for the assigned port.")
281280
}
282281
} else {
283-
log.Infof("code-server available at: http://%s:%d", o.ToolsCodeServer.Host, o.ToolsCodeServer.Port)
282+
log.Infof("code-server available at: http://0.0.0.0:%d", o.ToolsCodeServer.Port)
284283
}
285284

286285
return nil

0 commit comments

Comments
 (0)