@@ -727,10 +727,6 @@ func TestReconcilePGBackRestRBAC(t *testing.T) {
727
727
}
728
728
729
729
func TestReconcileRepoHostRBAC (t * testing.T ) {
730
- // Garbage collector cleans up test resources before the test completes
731
- if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
732
- t .Skip ("USE_EXISTING_CLUSTER: Test fails due to garbage collection" )
733
- }
734
730
735
731
ctx := context .Background ()
736
732
_ , tClient := setupKubernetes (t )
@@ -745,6 +741,15 @@ func TestReconcileRepoHostRBAC(t *testing.T) {
745
741
746
742
// create a PostgresCluster to test with
747
743
postgresCluster := fakePostgresCluster (clusterName , ns .GetName (), clusterUID , true )
744
+ // create an example AWS ARN annotation
745
+ annotations := map [string ]string {
746
+ "eks.amazonaws.com/role-arn" : "arn:aws:iam::123456768901:role/allow_bucket_access" ,
747
+ }
748
+ // set the annotation on the cluster
749
+ postgresCluster .Spec .Metadata = & v1beta1.Metadata {
750
+ Annotations : annotations ,
751
+ }
752
+
748
753
postgresCluster .Status .PGBackRest = & v1beta1.PGBackRestStatus {
749
754
Repos : []v1beta1.RepoStatus {{Name : "repo1" , StanzaCreated : false }},
750
755
}
@@ -760,6 +765,7 @@ func TestReconcileRepoHostRBAC(t *testing.T) {
760
765
Namespace : postgresCluster .GetNamespace (),
761
766
}, sa )
762
767
assert .NilError (t , err )
768
+ assert .DeepEqual (t , sa .Annotations , annotations )
763
769
}
764
770
765
771
func TestReconcileStanzaCreate (t * testing.T ) {
0 commit comments