Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions internal/controller/postgrescluster/pgbackrest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,6 @@ func TestReconcilePGBackRestRBAC(t *testing.T) {
}

func TestReconcileRepoHostRBAC(t *testing.T) {
// Garbage collector cleans up test resources before the test completes
if strings.EqualFold(os.Getenv("USE_EXISTING_CLUSTER"), "true") {
t.Skip("USE_EXISTING_CLUSTER: Test fails due to garbage collection")
}

ctx := context.Background()
_, tClient := setupKubernetes(t)
Expand All @@ -745,6 +741,15 @@ func TestReconcileRepoHostRBAC(t *testing.T) {

// create a PostgresCluster to test with
postgresCluster := fakePostgresCluster(clusterName, ns.GetName(), clusterUID, true)
// create an example AWS ARN annotation
annotations := map[string]string{
"eks.amazonaws.com/role-arn": "arn:aws:iam::123456768901:role/allow_bucket_access",
}
// set the annotation on the cluster
postgresCluster.Spec.Metadata = &v1beta1.Metadata{
Annotations: annotations,
}

postgresCluster.Status.PGBackRest = &v1beta1.PGBackRestStatus{
Repos: []v1beta1.RepoStatus{{Name: "repo1", StanzaCreated: false}},
}
Expand All @@ -760,6 +765,7 @@ func TestReconcileRepoHostRBAC(t *testing.T) {
Namespace: postgresCluster.GetNamespace(),
}, sa)
assert.NilError(t, err)
assert.DeepEqual(t, sa.Annotations, annotations)
}

func TestReconcileStanzaCreate(t *testing.T) {
Expand Down