New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1758628: Console workload show restricted acccess if knative serverless TP1 operator is installed and logged in as non admin #2905
Conversation
d1b2b41
to
35b4d5c
Compare
/kind bug |
35b4d5c
to
49fb562
Compare
return { | ||
revisions, | ||
}; | ||
const revsionsRes = revisions.length > 0 ? { revisions } : revisions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused. It looks like getRevisions
always returns K8sResourceKind[]
. So we're returning a KnativeItem
is the array is not empty, but an empty array otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spadgett In case of empty array updated to return undefined
as currently, it was confusing. In Overview, we are consuming this via extension utils and first check is if CRDs are present then check is based on key as in knative specific resources "configurations" and in current code issue was even if knative resources were not present but utils returned
{ configurations: [] }
https://github.com/openshift/console/blob/master/frontend/public/components/overview/index.tsx#L832
in case of normal deployments and as in sidebar it identifies configurations and knative operator is installed so treated it as knative resource.
with added check in case of no configurations found will return undefined
, so will not add any knative specific resources in overviewitems.
1f72af6
to
c4886d2
Compare
Tested and it works fine. |
/approve |
/test e2e-aws-console |
/test e2e-aws |
@@ -111,6 +111,7 @@ export const knativeServingResourcesRevision = (namespace: string): FirehoseReso | |||
kind: referenceForModel(RevisionModel), | |||
namespace, | |||
prop: 'revisions', | |||
optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you no longer see the problem switching projects? #2862 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it happens only in topology if we switch namespace and it's not associated with this change optional:true
. I mean even in current master it will be observed in case non-admin user tries to view projects not created by them and on the first load will see "Restricted access" and on change of namespace will show loading if knative serverless is installed and as we are showing knative specific resources in sidebar as well so in workloads user will be shown with "restricted access". As you suggested optional: true
is working as expected here i.e user will be shown workloads and deployments in topology.
/test e2e-aws |
/retest Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
c4886d2
to
aa91122
Compare
/test e2e-aws |
/test e2e-aws |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, gijohn, invincibleJai The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/bugzilla refresh |
@invincibleJai: All pull requests linked via external trackers have merged. Bugzilla bug 1758628 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick release-4.2 |
@invincibleJai: new pull request created: #2942 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Tracks: https://jira.coreos.com/browse/ODC-1979