Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit adec462

Browse files
committed
Fix tests
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
1 parent 0c2cb4f commit adec462

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

cmd/kubeapps-apis/core/plugins/v1alpha1/plugins_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,18 +360,18 @@ func TestCreateConfigGetterWithParams(t *testing.T) {
360360
{
361361
name: "it doesn't create the config and throws a grpc error when passing an invalid authorization metadata",
362362
headers: http.Header{"Authorization": []string{"Bla"}},
363-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: malformed authorization metadata")),
363+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: malformed authorization metadata")),
364364
},
365365
{
366366
name: "it doesn't create the config and throws a grpc error for the default cluster when no authorization metadata is passed",
367367
expectedAPIHost: DefaultK8sAPI,
368-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: missing authorization metadata")),
368+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: missing authorization metadata")),
369369
},
370370
{
371371
name: "it doesn't create the config and throws a grpc error for the other cluster",
372372
cluster: OtherClusterName,
373373
expectedAPIHost: OtherK8sAPI,
374-
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid authorization metadata: missing authorization metadata")),
374+
expectedErrMsg: connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("Invalid authorization metadata: missing authorization metadata")),
375375
},
376376
}
377377

cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/server_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6701,7 +6701,7 @@ func TestAddPackageRepository(t *testing.T) {
67016701
return request
67026702
},
67036703
expectedErrorCode: connect.CodeInvalidArgument,
6704-
expectedErrorString: "secret name is not provided",
6704+
expectedErrorString: "Secret name is not provided",
67056705
},
67066706
{
67076707
name: "validate auth (user managed, secret does not exist)",
@@ -6717,7 +6717,7 @@ func TestAddPackageRepository(t *testing.T) {
67176717
return request
67186718
},
67196719
expectedErrorCode: connect.CodeInvalidArgument,
6720-
expectedErrorString: "not found",
6720+
expectedErrorString: "Not found",
67216721
},
67226722
{
67236723
name: "validate auth (user managed, secret is incompatible)",
@@ -6739,7 +6739,7 @@ func TestAddPackageRepository(t *testing.T) {
67396739
return request
67406740
},
67416741
expectedErrorCode: connect.CodeInvalidArgument,
6742-
expectedErrorString: "secret does not match",
6742+
expectedErrorString: "Secret does not match",
67436743
},
67446744
{
67456745
name: "validate auth (plugin managed, invalid config, basic auth)",
@@ -6750,7 +6750,7 @@ func TestAddPackageRepository(t *testing.T) {
67506750
return request
67516751
},
67526752
expectedErrorCode: connect.CodeInvalidArgument,
6753-
expectedErrorString: "missing basic auth",
6753+
expectedErrorString: "Missing basic auth",
67546754
},
67556755
{
67566756
name: "validate auth (plugin managed, invalid config, docker)",
@@ -6764,7 +6764,7 @@ func TestAddPackageRepository(t *testing.T) {
67646764
return request
67656765
},
67666766
expectedErrorCode: connect.CodeInvalidArgument,
6767-
expectedErrorString: "missing Docker Config auth",
6767+
expectedErrorString: "Missing Docker Config auth",
67686768
},
67696769
{
67706770
name: "validate auth (plugin managed, invalid config, ssh auth)",
@@ -6782,7 +6782,7 @@ func TestAddPackageRepository(t *testing.T) {
67826782
return request
67836783
},
67846784
expectedErrorCode: connect.CodeInvalidArgument,
6785-
expectedErrorString: "unexpected REDACTED",
6785+
expectedErrorString: "Unexpected REDACTED",
67866786
},
67876787
{
67886788
name: "create with description",
@@ -7392,7 +7392,7 @@ func TestUpdatePackageRepository(t *testing.T) {
73927392
return request
73937393
},
73947394
expectedErrorCode: connect.CodeInvalidArgument,
7395-
expectedStatusString: "missing basic auth",
7395+
expectedStatusString: "Missing basic auth",
73967396
},
73977397
{
73987398
name: "validate auth (plugin managed, invalid config, docker)",

cmd/kubeapps-apis/plugins/pkg/connecterror/connecterror_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ func TestErrorByStatus(t *testing.T) {
2828
"my-resource",
2929
"",
3030
status.Errorf(codes.InvalidArgument, "boom!"),
31-
connect.NewError(connect.CodeInternal, fmt.Errorf("unable to get the my-resource 'all' due to 'rpc error: code = InvalidArgument desc = boom!'")),
31+
connect.NewError(connect.CodeInternal, fmt.Errorf("Unable to get the my-resource 'all' due to 'rpc error: code = InvalidArgument desc = boom!'")),
3232
},
3333
{
3434
"error msg for a single resources ",
3535
"get",
3636
"my-resource",
3737
"my-id",
3838
status.Errorf(codes.InvalidArgument, "boom!"),
39-
connect.NewError(connect.CodeInternal, fmt.Errorf("unable to get the my-resource 'my-id' due to 'rpc error: code = InvalidArgument desc = boom!'")),
39+
connect.NewError(connect.CodeInternal, fmt.Errorf("Unable to get the my-resource 'my-id' due to 'rpc error: code = InvalidArgument desc = boom!'")),
4040
},
4141
}
4242
for _, tt := range tests {

0 commit comments

Comments
 (0)