Skip to content
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

fix: pod resources not visible even if user have access on those pods. #3071

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

gireesh-naidu
Copy link
Member

@gireesh-naidu gireesh-naidu commented Mar 2, 2023

Description

Not able to see the pod resources even if the user has permission for those pods.
Fixes #3072

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@gireesh-naidu gireesh-naidu merged commit 1235a2f into main Mar 2, 2023
@gireesh-naidu gireesh-naidu deleted the resource_test branch March 2, 2023 14:30
resp, namespaced, err := impl.k8sClientService.GetResourceList(ctx, restConfig, k8sRequest)
if err != nil {
impl.logger.Errorw("error in getting resource list", "err", err, "request", request)
return resourceList, err
}
checkForResourceCallback := func(namespace, group, kind, resourceName string) bool {
resourceIdentifier := k8sRequest.ResourceIdentifier
resourceIdentifier := resourceIdentifierCloned
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can start with empty installation

resp, namespaced, err := impl.k8sClientService.GetResourceList(ctx, restConfig, k8sRequest)
if err != nil {
impl.logger.Errorw("error in getting resource list", "err", err, "request", request)
return resourceList, err
}
checkForResourceCallback := func(namespace, group, kind, resourceName string) bool {
resourceIdentifier := k8sRequest.ResourceIdentifier
resourceIdentifier := resourceIdentifierCloned
resourceIdentifier.Name = resourceName
resourceIdentifier.Namespace = namespace
if group != "" && kind != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: user not able to access pod resources even the user has view access on those pods.
3 participants