-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add metrics role and extend view role #519
Conversation
Skipping CI for Draft Pull Request. |
Minishift / Testing latest changes (pull_request) check should be passed after applying these changes: https://github.com/eclipse/che-operator/pull/519/files#diff-dd2b7f73672812f28eaeefd88568f005bc349b4647e015a36b2789ad29b5221fL89 |
I'm out of my element here, so will defer to a subject matter expert's judgement 😃 |
@svor
|
pkg/controller/che/che_controller.go
Outdated
}, | ||
}, | ||
} | ||
role, err := deploy.SyncRoleToCluster(deployContext, "exec", execPolicyRule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls. create a new function in role.go
SyncExecRoleToCluster(..)
and move
execPolicyRule := []rbac.PolicyRule{
{
APIGroups: []string{
"",
},
Resources: []string{
"pods/exec",
},
Verbs: []string{
"*",
},
},
}
role, err := deploy.SyncRoleToCluster(deployContext, "exec", execPolicyRule)
Pls. do accordingly for other changes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. @tolusha could you pls take another look
Also still have some problems with Check nightly "opm" bundle action. From the logs i see a message:
Nightly bundle file deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml should be updated in your pr
but che-operator/olm/update-nightly-bundle.sh script doesn't provide any updates.
pkg/deploy/tls.go
Outdated
}, | ||
}, | ||
} | ||
role, err := SyncRoleToCluster(deployContext, CheTLSJobRoleName, policyRule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls. create a corresponding function in role.go
pkg/deploy/role.go
Outdated
}, | ||
}, | ||
} | ||
return SyncRoleToCluster(deployContext, "che-tls-job-role", tlsPolicyRule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for PR check passed
Hello, @svor take a look, please, one more thing: update roles. For example user could have installed Che, and operator installs role with new 'verb'. In the our current code, this role won't be updated: https://github.com/eclipse/che-operator/blob/4c194ddeb57e0717b8de7083efdf40cd43634a93/pkg/deploy/role.go#L42 and https://github.com/eclipse/che-operator/blob/4c194ddeb57e0717b8de7083efdf40cd43634a93/pkg/deploy/role.go#L48 . So you need apply differ to compare roles, and if role was changed(for newer Che we want more permissions), then we should update role. We have a good examples in the code how to do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls fix @AndrienkoAleksandr 's remarks
@AndrienkoAleksandr Thank you for detailed explanation, your remark makes sense 100%! I'll update this PR |
Signed-off-by: svor <vsvydenk@redhat.com>
Signed-off-by: svor <vsvydenk@redhat.com>
View Role was updated successfully in my local k8s environment. Logs from che-operator pod:
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AndrienkoAleksandr, svor, 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 |
Signed-off-by: svor vsvydenk@redhat.com
What does this PR do?
What issues does this PR fix or reference?
eclipse-che/che#17205