Skip to content

Conversation

@enxebre
Copy link
Member

@enxebre enxebre commented Feb 14, 2019

Move rbac up to CVO. Drop admin perms

@enxebre
Copy link
Member Author

enxebre commented Feb 14, 2019

cc @bison

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 14, 2019
name: cluster-api-manager-role
subjects:
- kind: ServiceAccount
name: default
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we create a dedicated service account? It's not much more trouble, and it means random pods started in the namespace don't get elevated permissions.

kind: ClusterRole
metadata:
creationTimestamp: null
name: cluster-api-manager-role
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nit, but I don't think these names should end in -role etc. You already know that by the type, and it looks weird in the console. I would just call this machine-api or something.

- kind: ServiceAccount
name: default
namespace: openshift-machine-api
name: cluster-api-manager-rolebinding
Copy link
Contributor

Choose a reason for hiding this comment

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

Same nit on the name including the type here.

@enxebre enxebre force-pushed the rbac branch 2 times, most recently from 301b5c6 to 3c97b2c Compare February 14, 2019 15:53
@enxebre enxebre added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 14, 2019
@enxebre enxebre force-pushed the rbac branch 2 times, most recently from d917e5c to c5dcc98 Compare February 15, 2019 13:45
@enxebre
Copy link
Member Author

enxebre commented Feb 15, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 15, 2019

Before this merges, we need to make sure we add a validation for draining in this repo and we add the required permissions e.g manipulating daemonSets openshift/cluster-api-provider-aws#158 otherwise this would break draining cc @ingvagabund

@enxebre
Copy link
Member Author

enxebre commented Feb 15, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 18, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 18, 2019

Looking at the logs now perms list seems ok. I'll update for:

  • Using specific sa
  • Including draining permissions

@ingvagabund
Copy link
Member

let's wait until I introduce new test for the draining

@enxebre
Copy link
Member Author

enxebre commented Feb 18, 2019

/test e2e-aws-operator

3 similar comments
@enxebre
Copy link
Member Author

enxebre commented Feb 18, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws

1 similar comment
@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 19, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 20, 2019

/retest

@enxebre enxebre removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 20, 2019
@enxebre
Copy link
Member Author

enxebre commented Feb 20, 2019

/test e2e-aws

@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/test e2e-aws-operator

@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/retest

5 similar comments
@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 21, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 22, 2019

/retest

@enxebre
Copy link
Member Author

enxebre commented Feb 22, 2019

@ingvagabund @bison @frobware let's get this in. I'll add a specific SA in a follow up

@frobware
Copy link
Contributor

The draining test seems orthogonal to the purpose of the PR (given the description). Can we move the test to a separate PR?

@enxebre
Copy link
Member Author

enxebre commented Feb 22, 2019

@frobware The perms has been made granular including the new draining featured added in aws actuator. This needs to be merged in one go, otherwise there is room for breaking draining. That's why they have a different commit

@frobware
Copy link
Contributor

@frobware The perms has been made granular including the new draining featured added in aws actuator. This needs to be merged in one go, otherwise there is room for breaking draining. That's why they have a different commit

OK, thanks for the explanation.

@ingvagabund
Copy link
Member

/approve

Agree with Andrew that the node draining test should go into separate PR and merged first before this PR is. Though, given the current state of the CI I agree with Alberto it's better to keep it as it is.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund

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

The pull request process is described here

Details 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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2019
var machineDeletedEvent *corev1.Event
for _, eventItem := range eventList.Items {
if eventItem.Reason == "Deleted" && eventItem.Message == fmt.Sprintf("Node %q drained", nodeName) {
nodeDrainedEvent = &eventItem
Copy link
Contributor

Choose a reason for hiding this comment

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

We're taking the address of the local loop variable here - is this intentional?

Copy link
Member

Choose a reason for hiding this comment

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

It is not, it should be changed actually. Though, ExpectNodeToBeDrainedBeforeDeletingMachine was superseded by ExpectNodeToBeDrainedBeforeMachineIsDeleted so it can be deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Seems ok since this is not storing appended values or similar
This is just bringing @ingvagabund draining tests from aws. To validate the new rbac does not break current coverage

Right after this we can merge #219
and openshift/cluster-api-actuator-pkg#28
And start rewriting the e2e suite there addressing this specific concern and others

@frobware
Copy link
Contributor

Agree with Andrew that the node draining test should go into separate PR and merged first before this PR is. Though, given the current state of the CI I agree with Alberto it's better to keep it as it is.

I think the key point is if you ever had to revert this PR would you also want to revert the test. If the answer is "no" then they should be separate commits.

}
for _, nodeItem := range nodeList.Items {
if nodeItem.Name == nodeName {
node = &nodeItem
Copy link
Contributor

Choose a reason for hiding this comment

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

This takes the address of a local variable which seems Ok-ish here given we break. But it may be clearer and more future proof to use &nodeList.Items[i].

@frobware
Copy link
Contributor

As long as we follow up and address the issues RSN...

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2019
@paulfantom
Copy link
Contributor

/retest

1 similar comment
@enxebre
Copy link
Member Author

enxebre commented Feb 22, 2019

/retest

@openshift-merge-robot openshift-merge-robot merged commit 2ddecde into openshift:master Feb 22, 2019
ingvagabund pushed a commit to ingvagabund/machine-api-operator that referenced this pull request Jul 11, 2019
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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants