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 dashboard's token generation RBAC YAML #3370

Merged

Conversation

Garima-Negi
Copy link
Contributor

@Garima-Negi Garima-Negi commented Jun 16, 2022

What problem does this PR solve?

This PR introduces a change to the rbac.yaml file that is shown to user when generating a new token for using chaosmesh dashboard.

What's changed and how it works?

Existing yaml is incorrect for apiGroup chaos-mesh.org and does not add the required verbs/resources in rule section.
This results in errors on dashboard "cannot list resource PodChaos" etc.for all types of resources

After fix, the rule is created correctly: {APIGroups:["[chaos-mesh.org](http://chaos-mesh.org/)"], Resources:["*"], Verbs:["get" "list" "watch" "create" "delete" "patch" "update"]}

The fix is aligned with https://kubernetes.io/docs/reference/access-authn-authz/rbac/


rules:
- apiGroups: [""]
  #
  # at the HTTP level, the name of the resource for accessing Pod
  # objects is "pods"
  resources: ["pods"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["batch"]
  #
  # at the HTTP level, the name of the resource for accessing Job
  # objects is "jobs"
  resources: ["jobs"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

Related changes

not sure of remaining options in PR description

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.2
    • release-2.1

Checklist

CHANGELOG

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.

You can safely ignore this section if you don't think this PR needs a release note.

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 16, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot
Copy link
Member

Welcome @Garima-Negi!

It looks like this is your first PR to chaos-mesh/chaos-mesh 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to chaos-mesh/chaos-mesh. 😃

@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@9c3f63a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3370   +/-   ##
=========================================
  Coverage          ?   40.08%           
=========================================
  Files             ?      166           
  Lines             ?    14187           
  Branches          ?        0           
=========================================
  Hits              ?     5687           
  Misses            ?     8065           
  Partials          ?      435           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c3f63a...9450a5b. Read the comment docs.

@FingerLeader
Copy link
Member

Thanks for your contribution! Please update the CHANGELOG.md, rest LGTM

Comment on lines -59 to +61
- apiGroups:
- chaos-mesh.org
- apiGroups: ["chaos-mesh.org"]
Copy link
Member

Choose a reason for hiding this comment

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

I do not get the point.

apiGroups:
  - chaos-mesh.org
apiGroups: ["chaos-mesh.org"]

they introduce the same meaning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It didn't work for me with the existing yaml until I fixed it as linked here https://kubernetes.io/docs/reference/access-authn-authz/rbac/

Copy link
Member

Choose a reason for hiding this comment

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

A little weird but it could still work. I have no reason to block this PR.

Hi @Garima-Negi , could you append an entry into the CHANGELOG.md about this PR? ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@FingerLeader
Copy link
Member

@Garima-Negi please fix the DCO, you can click details for more information

@STRRL STRRL force-pushed the fix-dashboard-token-rbac-yaml branch 2 times, most recently from 7f1e543 to 3bb655f Compare September 13, 2022 07:01
Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM!

g1eny0ung and others added 2 commits September 13, 2022 15:05
* perf: make the Scope render conditionally

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* chore: update  changelog

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: Garima Negi <garima.negi@segment.com>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: Garima Negi <garima.negi@segment.com>
Signed-off-by: STRRL <im@strrl.dev>
Signed-off-by: STRRL <im@strrl.dev>
@STRRL STRRL force-pushed the fix-dashboard-token-rbac-yaml branch from 5880d57 to 0b2d275 Compare September 13, 2022 07:06
@ti-chi-bot ti-chi-bot added size/M and removed size/S labels Sep 13, 2022
@STRRL
Copy link
Member

STRRL commented Sep 13, 2022

/merge

@ti-chi-bot ti-chi-bot added size/S and removed size/M labels Sep 13, 2022
@STRRL
Copy link
Member

STRRL commented Sep 13, 2022

/merge cancel

This PR requires updates on CHANEGLOG.

Signed-off-by: STRRL <im@strrl.dev>
@STRRL
Copy link
Member

STRRL commented Sep 13, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 94aa633

@ti-chi-bot
Copy link
Member

@Garima-Negi: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit b936e80 into chaos-mesh:master Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants