Skip to content

Avoid reordering Rules #253

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

Merged
merged 1 commit into from
Jul 16, 2019
Merged

Conversation

haiyanmeng
Copy link
Contributor

@haiyanmeng haiyanmeng commented Jul 11, 2019

Currently, the role.yaml generated by multiple runs of controller-gen
may have different Rule orders. This commit makes the Rule order in
role.yaml stable.

Fix: #251

@k8s-ci-robot k8s-ci-robot requested review from droot and pwittrock July 11, 2019 23:47
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 11, 2019
@haiyanmeng haiyanmeng force-pushed the order branch 2 times, most recently from fd48296 to 6560aef Compare July 15, 2019 18:15
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 15, 2019
@haiyanmeng haiyanmeng force-pushed the order branch 3 times, most recently from dbd8dd4 to 43d398f Compare July 15, 2019 18:43
Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

You need to implement your own sorter to sort Rules by Groups, Resources, Verbs, URLs.
Ref: https://golang.org/pkg/sort/

Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

A few nits. Other pieces look good.

@haiyanmeng haiyanmeng force-pushed the order branch 3 times, most recently from 06ff922 to a946a88 Compare July 16, 2019 00:00
@haiyanmeng
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@haiyanmeng: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@haiyanmeng haiyanmeng force-pushed the order branch 2 times, most recently from 0ba52e1 to 73a21ed Compare July 16, 2019 01:04
Currently, the `role.yaml` generated by multiple runs of controller-gen
may have different Rule orders. This commit makes the Rule order in
`role.yaml` stable.

Signed-off-by: Haiyan Meng <[email protected]>
Copy link
Member

@mengqiy mengqiy left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 16, 2019
@mengqiy mengqiy added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 16, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: haiyanmeng

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Role ordering is not stable
3 participants