Skip to content

Commit bd83261

Browse files
authored
Merge pull request #11205 from vincepri/smooth-forbidden
🌱 test/framework: GetCAPIResources should warn on rbac issues
2 parents 135826f + 8604dec commit bd83261

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/framework/alltypes_helpers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func GetCAPIResources(ctx context.Context, input GetCAPIResourcesInput) []*unstr
6969
if apierrors.IsNotFound(err) {
7070
continue
7171
}
72+
if apierrors.IsForbidden(err) {
73+
fmt.Printf("Warning: failed to list %s resources due to a rbac issue: %v", typeList.GroupVersionKind(), err)
74+
continue
75+
}
7276
Fail(fmt.Sprintf("failed to list %q resources: %v", typeList.GroupVersionKind(), err))
7377
}
7478
for i := range typeList.Items {

0 commit comments

Comments
 (0)