Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit b6d0053

Browse files
author
Rob Rati
committed
Updates for latest api changes
1 parent 7caa605 commit b6d0053

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

pkg/controller/bucketaccess/bucket_access_controller_test.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
fakespec "github.com/kubernetes-sigs/container-object-storage-interface-spec/fake"
3030

3131
v1 "k8s.io/api/core/v1"
32+
3233
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3334
utilversion "k8s.io/apimachinery/pkg/util/version"
3435
"k8s.io/apimachinery/pkg/version"
@@ -142,8 +143,8 @@ func TestAdd(t *testing.T) {
142143
if in.BucketName != bucketName {
143144
t.Errorf("expected %s, got %s", bucketName, in.BucketName)
144145
}
145-
if in.Region != region {
146-
t.Errorf("expected %s, got %s", region, in.Region)
146+
if in.BucketContext["Region"] != region {
147+
t.Errorf("expected %s, got %s", region, in.BucketContext["Region"])
147148
}
148149
if in.Principal != principal {
149150
t.Errorf("expected %s, got %s", principal, in.Principal)
@@ -185,13 +186,13 @@ func TestAdd(t *testing.T) {
185186
t.Errorf("expected %s, got %s", principal, in.Principal)
186187
}
187188
if in.BucketContext["ServiceAccount"] != account {
188-
t.Errorf("expected %s, got %s", region, in.BucketContext["ServiceAccount"])
189+
t.Errorf("expected %s, got %s", account, in.BucketContext["ServiceAccount"])
189190
}
190191
if in.BucketContext["PrivateKeyName"] != keyName {
191-
t.Errorf("expected %s, got %s", region, in.BucketContext["PrivateKeyName"])
192+
t.Errorf("expected %s, got %s", keyName, in.BucketContext["PrivateKeyName"])
192193
}
193194
if in.BucketContext["ProjectID"] != projID {
194-
t.Errorf("expected %s, got %s", region, in.BucketContext["ProjectID"])
195+
t.Errorf("expected %s, got %s", projID, in.BucketContext["ProjectID"])
195196
}
196197
return &osspec.ProvisionerGrantBucketAccessResponse{
197198
Principal: principal,
@@ -219,7 +220,7 @@ func TestAdd(t *testing.T) {
219220
t.Errorf("expected %s, got %s", principal, in.Principal)
220221
}
221222
if in.BucketContext["StorageAccount"] != account {
222-
t.Errorf("expected %s, got %s", region, in.BucketContext["StorageAccount"])
223+
t.Errorf("expected %s, got %s", account, in.BucketContext["StorageAccount"])
223224
}
224225
return &osspec.ProvisionerGrantBucketAccessResponse{
225226
Principal: principal,
@@ -406,8 +407,8 @@ func TestDelete(t *testing.T) {
406407
if in.BucketName != bucketName {
407408
t.Errorf("expected %s, got %s", bucketName, in.BucketName)
408409
}
409-
if in.Region != region {
410-
t.Errorf("expected %s, got %s", region, in.Region)
410+
if in.BucketContext["Region"] != region {
411+
t.Errorf("expected %s, got %s", region, in.BucketContext["Region"])
411412
}
412413
if in.Principal != principal {
413414
t.Errorf("expected %s, got %s", principal, in.Principal)
@@ -444,13 +445,13 @@ func TestDelete(t *testing.T) {
444445
t.Errorf("expected %s, got %s", principal, in.Principal)
445446
}
446447
if in.BucketContext["ServiceAccount"] != account {
447-
t.Errorf("expected %s, got %s", region, in.BucketContext["ServiceAccount"])
448+
t.Errorf("expected %s, got %s", account, in.BucketContext["ServiceAccount"])
448449
}
449450
if in.BucketContext["PrivateKeyName"] != keyName {
450-
t.Errorf("expected %s, got %s", region, in.BucketContext["PrivateKeyName"])
451+
t.Errorf("expected %s, got %s", keyName, in.BucketContext["PrivateKeyName"])
451452
}
452453
if in.BucketContext["ProjectID"] != projID {
453-
t.Errorf("expected %s, got %s", region, in.BucketContext["ProjectID"])
454+
t.Errorf("expected %s, got %s", projID, in.BucketContext["ProjectID"])
454455
}
455456
return &osspec.ProvisionerRevokeBucketAccessResponse{}, nil
456457
},
@@ -473,7 +474,7 @@ func TestDelete(t *testing.T) {
473474
t.Errorf("expected %s, got %s", principal, in.Principal)
474475
}
475476
if in.BucketContext["StorageAccount"] != account {
476-
t.Errorf("expected %s, got %s", region, in.BucketContext["StorageAccount"])
477+
t.Errorf("expected %s, got %s", account, in.BucketContext["StorageAccount"])
477478
}
478479
return &osspec.ProvisionerRevokeBucketAccessResponse{}, nil
479480
},
@@ -495,8 +496,8 @@ func TestDelete(t *testing.T) {
495496
if in.BucketName != bucketName {
496497
t.Errorf("expected %s, got %s", bucketName, in.BucketName)
497498
}
498-
if in.Region != region {
499-
t.Errorf("expected %s, got %s", region, in.Region)
499+
if in.BucketContext["Region"] != region {
500+
t.Errorf("expected %s, got %s", region, in.BucketContext["Region"])
500501
}
501502
if in.Principal != principal {
502503
t.Errorf("expected %s, got %s", principal, in.Principal)

0 commit comments

Comments
 (0)