@@ -112,7 +112,7 @@ func TestCreateConnection(t *testing.T) {
112
112
clientConn , _ := createTestWebSocketConnection ()
113
113
114
114
// Add RequestID to the createConnection call
115
- conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "" , clientConn )
115
+ conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "" , clientConn , nil )
116
116
assert .NotNil (t , conn )
117
117
assert .Equal (t , "test-cluster" , conn .ClusterID )
118
118
assert .Equal (t , "test-user" , conn .UserID )
@@ -153,7 +153,7 @@ func TestDialWebSocket(t *testing.T) {
153
153
defer server .Close ()
154
154
155
155
wsURL := "ws" + strings .TrimPrefix (server .URL , "http" )
156
- conn , err := m .dialWebSocket (wsURL , & tls.Config {InsecureSkipVerify : true }, server .URL ) //nolint:gosec
156
+ conn , err := m .dialWebSocket (wsURL , & tls.Config {InsecureSkipVerify : true }, server .URL , nil ) //nolint:gosec
157
157
158
158
assert .NoError (t , err )
159
159
assert .NotNil (t , conn )
@@ -170,12 +170,12 @@ func TestDialWebSocket_Errors(t *testing.T) {
170
170
// Test invalid URL
171
171
tlsConfig := & tls.Config {InsecureSkipVerify : true } //nolint:gosec
172
172
173
- ws , err := m .dialWebSocket ("invalid-url" , tlsConfig , "" )
173
+ ws , err := m .dialWebSocket ("invalid-url" , tlsConfig , "" , nil )
174
174
assert .Error (t , err )
175
175
assert .Nil (t , ws )
176
176
177
177
// Test unreachable URL
178
- ws , err = m .dialWebSocket ("ws://localhost:12345" , tlsConfig , "" )
178
+ ws , err = m .dialWebSocket ("ws://localhost:12345" , tlsConfig , "" , nil )
179
179
assert .Error (t , err )
180
180
assert .Nil (t , ws )
181
181
}
@@ -535,7 +535,7 @@ func TestEstablishClusterConnection(t *testing.T) {
535
535
defer clientServer .Close ()
536
536
537
537
// Test successful connection establishment
538
- conn , err := m .establishClusterConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn )
538
+ conn , err := m .establishClusterConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn , nil )
539
539
assert .NoError (t , err )
540
540
assert .NotNil (t , conn )
541
541
assert .Equal (t , "test-cluster" , conn .ClusterID )
@@ -544,7 +544,7 @@ func TestEstablishClusterConnection(t *testing.T) {
544
544
assert .Equal (t , "watch=true" , conn .Query )
545
545
546
546
// Test with invalid cluster
547
- conn , err = m .establishClusterConnection ("non-existent" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn )
547
+ conn , err = m .establishClusterConnection ("non-existent" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn , nil )
548
548
assert .Error (t , err )
549
549
assert .Nil (t , conn )
550
550
}
@@ -572,7 +572,7 @@ func TestReconnect(t *testing.T) {
572
572
defer clientServer .Close ()
573
573
574
574
// Create initial connection
575
- conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/services" , "watch=true" , clientConn )
575
+ conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/services" , "watch=true" , clientConn , nil )
576
576
wsConn , wsServer := createTestWebSocketConnection ()
577
577
578
578
defer wsServer .Close ()
@@ -598,7 +598,7 @@ func TestReconnect(t *testing.T) {
598
598
assert .Contains (t , err .Error (), "getting context: key not found" )
599
599
600
600
// Test reconnection with closed connection
601
- conn = m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn )
601
+ conn = m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "watch=true" , clientConn , nil )
602
602
wsConn2 , wsServer2 := createTestWebSocketConnection ()
603
603
604
604
defer wsServer2 .Close ()
@@ -829,7 +829,7 @@ func TestMonitorConnection_ReconnectFailure(t *testing.T) {
829
829
clientConn , clientServer := createTestWebSocketConnection ()
830
830
defer clientServer .Close ()
831
831
832
- conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "" , clientConn )
832
+ conn := m .createConnection ("test-cluster" , "test-user" , "/api/v1/pods" , "" , clientConn , nil )
833
833
wsConn , wsServer := createTestWebSocketConn ()
834
834
835
835
defer wsServer .Close ()
@@ -1097,7 +1097,7 @@ func TestMonitorConnection_Reconnect(t *testing.T) {
1097
1097
wsURL := "ws" + strings .TrimPrefix (server .URL , "http" )
1098
1098
tlsConfig := & tls.Config {InsecureSkipVerify : true } //nolint:gosec
1099
1099
1100
- ws , err := m .dialWebSocket (wsURL , tlsConfig , "" )
1100
+ ws , err := m .dialWebSocket (wsURL , tlsConfig , "" , nil )
1101
1101
require .NoError (t , err )
1102
1102
1103
1103
conn .WSConn = ws
0 commit comments