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

chore: permissions refactoring #1202

Merged
merged 5 commits into from
Dec 7, 2021
Merged

chore: permissions refactoring #1202

merged 5 commits into from
Dec 7, 2021

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Nov 29, 2021

@@ -99,6 +99,10 @@ func NewReconciler(
reconcileManager.RegisterReconciler(openshiftoauth.NewOpenShiftOAuth(openShiftOAuthUser))
reconcileManager.RegisterReconciler(tls.NewCertificatesReconciler())
reconcileManager.RegisterReconciler(tls.NewTlsSecretReconciler())
reconcileManager.RegisterReconciler(devworkspace.NewDevWorkspaceReconciler())
reconcileManager.RegisterReconciler(rbac.NewRbacReconciler())
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't GatewayPermissionsReconciler and WorkspacePermissionsReconciler using RBAC? We should be more clear in names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rbac: role-based access control. So it make sense for me to put in that package.

pkg/deploy/dev-workspace/dev_workspace_utils.go Outdated Show resolved Hide resolved
}

subscription := &operatorsv1alpha1.Subscription{}
if err := deployContext.ClusterAPI.NonCachingClient.Get(
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this invocation using NonCachingClient is done on each reconcile which is expensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've just moved the file. It how it was working before.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I think we should reconsider usage of nonCachingClient in the main controller, but this is out of scope of this refactoring.

pkg/deploy/rbac/gateway_permissions.go Outdated Show resolved Hide resolved
func (c *RbacReconciler) Reconcile(ctx *deploy.DeployContext) (reconcile.Result, bool, error) {
// Create service account "che" for che-server component.
// "che" is the one which token is used to create workspace objects.
// Notice: Also we have on more "che-workspace" SA used by plugins like exec, terminal, metrics with limited privileges.
Copy link
Contributor

Choose a reason for hiding this comment

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

on more -> one more

pkg/deploy/rbac/rbac.go Show resolved Hide resolved
@tolusha
Copy link
Contributor Author

tolusha commented Dec 6, 2021

/retest

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@tolusha
Copy link
Contributor Author

tolusha commented Dec 7, 2021

/retest

Signed-off-by: Mykola Morhun <mmorhun@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

@tolusha: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v7-multi-host-next-deployment bab618f link true /test v7-multi-host-next-deployment
ci/prow/v7-devworkspace-happy-path bab618f link true /test v7-devworkspace-happy-path
ci/prow/v8-che-behind-proxy ba1d106 link true /test v8-che-behind-proxy
ci/prow/v9-stable-to-nightly ba1d106 link true /test v9-stable-to-nightly
ci/prow/v9-devworkspace-happy-path ba1d106 link true /test v9-devworkspace-happy-path

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

if err != nil {
return false, err
return reconcile.Result{Requeue: true}, false, err
}
}
}

// check if DW exists on the cluster
devWorkspaceWebHookExistedBeforeSync, err := deploy.Get(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, here is we ignore error.

@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: AndrienkoAleksandr, mmorhun, tolusha

The full list of commands accepted by this bot can be found 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

@tolusha tolusha merged commit 58bba54 into main Dec 7, 2021
@tolusha tolusha deleted the refactor branch December 7, 2021 14:56
@che-bot che-bot added this to the 7.41 milestone Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants