@@ -38,9 +38,8 @@ type Node struct {
38
38
ID string `json:"id"`
39
39
Name string `json:"name"`
40
40
41
- privateIP string `json:"-"`
42
- sshEndpoint string `json:"-"`
43
- adminConsoleURL string `json:"-"`
41
+ privateIP string `json:"-"`
42
+ sshEndpoint string `json:"-"`
44
43
}
45
44
46
45
type Network struct {
@@ -166,15 +165,6 @@ func NewNode(in *ClusterInput, index int, networkID string) (*Node, error) {
166
165
return nil , fmt .Errorf ("copy playwright to node %s: %v" , node .Name , err )
167
166
}
168
167
169
- if index == 0 {
170
- in .T .Logf ("exposing port 30003 on node %s" , node .Name )
171
- hostname , err := exposePort (node , "30003" )
172
- if err != nil {
173
- return nil , fmt .Errorf ("expose port: %v" , err )
174
- }
175
- node .adminConsoleURL = fmt .Sprintf ("http://%s" , hostname )
176
- }
177
-
178
168
return & node , nil
179
169
}
180
170
@@ -483,33 +473,6 @@ func (c *Cluster) copyPlaywrightReport() {
483
473
}
484
474
}
485
475
486
- func exposePort (node Node , port string ) (string , error ) {
487
- output , err := exec .Command ("replicated" , "vm" , "port" , "expose" , node .ID , "--port" , port ).CombinedOutput ()
488
- if err != nil {
489
- return "" , fmt .Errorf ("expose port: %v: %s" , err , string (output ))
490
- }
491
-
492
- output , err = exec .Command ("replicated" , "vm" , "port" , "ls" , node .ID , "-ojson" ).Output () // stderr can break json parsing
493
- if err != nil {
494
- if exitErr , ok := err .(* exec.ExitError ); ok {
495
- return "" , fmt .Errorf ("get port info: %w: stderr: %s: stdout: %s" , err , string (exitErr .Stderr ), string (output ))
496
- }
497
- return "" , fmt .Errorf ("get port info: %w: stdout: %s" , err , string (output ))
498
- }
499
-
500
- var ports []struct {
501
- Hostname string `json:"hostname"`
502
- }
503
- if err := json .Unmarshal (output , & ports ); err != nil {
504
- return "" , fmt .Errorf ("unmarshal port info: %v" , err )
505
- }
506
-
507
- if len (ports ) == 0 {
508
- return "" , fmt .Errorf ("no ports found for node %s" , node .ID )
509
- }
510
- return ports [0 ].Hostname , nil
511
- }
512
-
513
476
func copyFileToNode (node Node , src , dst string ) error {
514
477
scpEndpoint := strings .Replace (node .sshEndpoint , "ssh://" , "scp://" , 1 )
515
478
0 commit comments