Skip to content

Commit

Permalink
fix: setup correct fake gcp credentials as json
Browse files Browse the repository at this point in the history
Signed-off-by: Roko Romic <rokoromic@gmail.com>
  • Loading branch information
rromic committed Mar 25, 2023
1 parent 997ba4c commit 6e95e52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/config/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var testConfig = &config.Config{
Channels: []config.Kinesis{{}},
},
GCS: config.GCS{
Credentials: "Credentials",
Credentials: `{"token": "token", "type": "authorized_user"}`,
Bucket: "test",
SkipExisting: true,
MinimumPriority: "debug",
Expand All @@ -135,7 +135,7 @@ func Test_ResolveTargets(t *testing.T) {
resolver := config.NewResolver(testConfig, &rest.Config{})

if count := len(resolver.TargetClients()); count != 19 {
t.Errorf("Expected 17 Clients, got %d", count)
t.Errorf("Expected 19 Clients, got %d", count)
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/config/target_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func newFakeClient() v1.SecretInterface {
"secretAccessKey": []byte("secretAccessKey"),
"kmsKeyId": []byte("kmsKeyId"),
"token": []byte("token"),
"credentials": []byte("credentials"),
"credentials": []byte(`{"token": "token", "type": "authorized_user"}`),
},
}).CoreV1().Secrets("default")
}
Expand Down Expand Up @@ -197,7 +197,7 @@ func Test_ResolveTargetWithoutHost(t *testing.T) {
})
t.Run("Kinesis.StreamName", func(t *testing.T) {
if len(factory.KinesisClients(config.Kinesis{Endpoint: "https://yds.serverless.yandexcloud.net", AccessKeyID: "access", SecretAccessKey: "secret", Region: "ru-central1"})) != 0 {
t.Error("Expected Client to be nil if no bucket is configured")
t.Error("Expected Client to be nil if no stream name is configured")
}
})
t.Run("GCS.Bucket", func(t *testing.T) {
Expand Down

0 comments on commit 6e95e52

Please sign in to comment.