@@ -22,7 +22,7 @@ func (m *mockController) Status(ctx context.Context) (models.RemoteSessionState,
2222func (m * mockController ) Start (ctx context.Context ) error { return nil }
2323func (m * mockController ) Stop (ctx context.Context ) error { return nil }
2424
25- func getFreePortOrDie () int {
25+ func getFreePortOrDie () int32 {
2626 var a * net.TCPAddr
2727 var err error
2828 if a , err = net .ResolveTCPAddr ("tcp" , "localhost:0" ); err == nil {
@@ -34,7 +34,7 @@ func getFreePortOrDie() int {
3434 panic (err )
3535 }
3636 }()
37- return l .Addr ().(* net.TCPAddr ).Port
37+ return int32 ( l .Addr ().(* net.TCPAddr ).Port )
3838 }
3939 panic (err )
4040 }
@@ -51,13 +51,13 @@ func TestReadyEndpoint(t *testing.T) {
5151
5252 tests := []struct {
5353 name string
54- makeCfg func (port int ) config.RemoteSessionControllerConfig
55- setupBackend func (port int ) (cleanup func ())
54+ makeCfg func (port int32 ) config.RemoteSessionControllerConfig
55+ setupBackend func (port int32 ) (cleanup func ())
5656 wantStatus int
5757 }{
5858 {
5959 name : "none probe returns 200" ,
60- makeCfg : func (int ) config.RemoteSessionControllerConfig {
60+ makeCfg : func (int32 ) config.RemoteSessionControllerConfig {
6161 c := baseCfg
6262 c .ReadinessProbeType = string (amaltheadevv1alpha1 .None )
6363 return c
@@ -66,13 +66,13 @@ func TestReadyEndpoint(t *testing.T) {
6666 },
6767 {
6868 name : "interactive tcp open port returns 200" ,
69- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
69+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
7070 c := baseCfg
7171 c .ReadinessProbeType = string (amaltheadevv1alpha1 .TCP )
7272 c .SessionPort = port
7373 return c
7474 },
75- setupBackend : func (port int ) func () {
75+ setupBackend : func (port int32 ) func () {
7676 ln , err := net .Listen ("tcp" , fmt .Sprintf ("127.0.0.1:%d" , port ))
7777 if err != nil {
7878 panic (err )
@@ -83,7 +83,7 @@ func TestReadyEndpoint(t *testing.T) {
8383 },
8484 {
8585 name : "interactive tcp closed port returns 503" ,
86- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
86+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
8787 c := baseCfg
8888 c .ReadinessProbeType = string (amaltheadevv1alpha1 .TCP )
8989 c .SessionPort = port
@@ -93,14 +93,14 @@ func TestReadyEndpoint(t *testing.T) {
9393 },
9494 {
9595 name : "interactive http serving 200 returns 200" ,
96- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
96+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
9797 c := baseCfg
9898 c .ReadinessProbeType = string (amaltheadevv1alpha1 .HTTP )
9999 c .SessionPort = port
100100 c .SessionURLPath = "/lab"
101101 return c
102102 },
103- setupBackend : func (port int ) func () {
103+ setupBackend : func (port int32 ) func () {
104104 ln , err := net .Listen ("tcp" , fmt .Sprintf ("127.0.0.1:%d" , port ))
105105 if err != nil {
106106 panic (err )
@@ -121,14 +121,14 @@ func TestReadyEndpoint(t *testing.T) {
121121 },
122122 {
123123 name : "interactive http redirect 302 returns 200" ,
124- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
124+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
125125 c := baseCfg
126126 c .ReadinessProbeType = string (amaltheadevv1alpha1 .HTTP )
127127 c .SessionPort = port
128128 c .SessionURLPath = "/"
129129 return c
130130 },
131- setupBackend : func (port int ) func () {
131+ setupBackend : func (port int32 ) func () {
132132 ln , err := net .Listen ("tcp" , fmt .Sprintf ("127.0.0.1:%d" , port ))
133133 if err != nil {
134134 panic (err )
@@ -145,14 +145,14 @@ func TestReadyEndpoint(t *testing.T) {
145145 },
146146 {
147147 name : "interactive http serving 500 returns 503" ,
148- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
148+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
149149 c := baseCfg
150150 c .ReadinessProbeType = string (amaltheadevv1alpha1 .HTTP )
151151 c .SessionPort = port
152152 c .SessionURLPath = "/"
153153 return c
154154 },
155- setupBackend : func (port int ) func () {
155+ setupBackend : func (port int32 ) func () {
156156 ln , err := net .Listen ("tcp" , fmt .Sprintf ("127.0.0.1:%d" , port ))
157157 if err != nil {
158158 panic (err )
@@ -169,7 +169,7 @@ func TestReadyEndpoint(t *testing.T) {
169169 },
170170 {
171171 name : "interactive http connection refused returns 503" ,
172- makeCfg : func (port int ) config.RemoteSessionControllerConfig {
172+ makeCfg : func (port int32 ) config.RemoteSessionControllerConfig {
173173 c := baseCfg
174174 c .ReadinessProbeType = string (amaltheadevv1alpha1 .HTTP )
175175 c .SessionPort = port
0 commit comments