-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing resources to manage in DSC controller (#669)
* rbac: add permissions for imagestreams, daemonsets, apiservices Prepare for watching v1 resources (issue #637) To enable watching for DaemonSet and APIService (REST api resources daemonsets and apiservices) reading/watching permissions required for the operator's role. Otherwise it gets errors like: ``` User "system:serviceaccount:openshift-operators:opendatahub-operator-controller-manager" cannot list resource "daemonsets" in API group "apps" at the cluster scope E1018 20:00:55.374514 1 reflector.go:140] go/pkg/mod/k8s.io/client-go@v0.26.0/tools/cache/reflector.go:169: Failed to watch *v1.DaemonSet: failed to list *v1.DaemonSet: daemonsets.apps is forbidden: User "system:serviceaccount:openshift-operators:opendatahub-operator-controller-manager" cannot list resource "daemonsets" in API group "apps" at the cluster scope ``` For ImageStream `get` permissing is needed for cli.Get() in deploy's manageResources()[1], otherwise it does not set ownersReference (missing the branch apierrs.IsNotFound(err) since err is related to permissions). Autogenerated files: - config/rbac/role.yaml (make manifests) - bundle/manifests/opendatahub-operator.clusterserviceversion.yaml (make bundle) [1] https://github.com/opendatahub-io/opendatahub-operator/blob/13a7e822c0c75f361c319f8256a2d199d031d97c/pkg/deploy/deploy.go#L199 Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com> * DSC controller: manage missing resources previously defined v1 Add the following resources to manage: - PersistentVolumeClaim - Service - DaemonSet - StatefulSet - DeploymentConfig - ImageStream - BuildConfig - CustomResourceDefinition - APIService - Ingress - MutatingWebhookConfiguration - ValidatingWebhookConfiguration - ServiceAccount It requires to add them to the scheme in main.go. Also `go mod tidy` is run to update modules information to make it buildable (keep bisectable). Autogenerated files: - go.mod - go.sum Closes: #637 Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com> --------- Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
- Loading branch information
Showing
7 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.