Skip to content

Commit d7d2c2f

Browse files
committed
fix(tests): Round 35 - Fix string pointer types
ServerName string to *string conversion: - Added stringPtr helper function to create string pointers - Changed ServerName: "..." to ServerName: stringPtr("...") - Fixed remaining InsecureSkipVerify: true to boolPtr(true) - SafeTLSConfig.ServerName expects *string not string - Fixes type mismatch at line 151 Errors fixed in Round 35: 1 Total errors fixed across ALL 35 rounds: 145
1 parent bd0ed36 commit d7d2c2f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

adapters/vnf-operator/tests/monitoring/servicemonitor_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ func boolPtr(b bool) *bool {
2020
return &b
2121
}
2222

23+
// Helper function to create string pointer
24+
func stringPtr(s string) *string {
25+
return &s
26+
}
27+
2328
// MockServiceMonitorClient mocks the ServiceMonitor client interface
2429
type MockServiceMonitorClient struct {
2530
mock.Mock
@@ -148,7 +153,7 @@ func TestServiceMonitorCreation(t *testing.T) {
148153
TLSConfig: &monitoringv1.TLSConfig{
149154
SafeTLSConfig: monitoringv1.SafeTLSConfig{
150155
InsecureSkipVerify: boolPtr(false),
151-
ServerName: "vnf-operator.o-ran-mano.svc.cluster.local",
156+
ServerName: stringPtr("vnf-operator.o-ran-mano.svc.cluster.local"),
152157
},
153158
CertFile: "/etc/ssl/certs/client.crt",
154159
KeyFile: "/etc/ssl/private/client.key",
@@ -432,8 +437,8 @@ func TestTLSConfiguration(t *testing.T) {
432437
name: "TLS with insecure skip verify",
433438
tlsConfig: &monitoringv1.TLSConfig{
434439
SafeTLSConfig: monitoringv1.SafeTLSConfig{
435-
InsecureSkipVerify: true,
436-
ServerName: "vnf-operator.o-ran-mano.svc.cluster.local",
440+
InsecureSkipVerify: boolPtr(true),
441+
ServerName: stringPtr("vnf-operator.o-ran-mano.svc.cluster.local"),
437442
},
438443
},
439444
expectedError: false,

0 commit comments

Comments
 (0)