streamnative / function-mesh

The serverless framework purpose-built for event streaming applications.
https://functionmesh.io/
Apache License 2.0
213 stars 29 forks source link

fix permission for cleanupSubscription on OLM installation #704

Closed freeznet closed 1 year ago

freeznet commented 1 year ago

Motivation

W1024 08:06:04.290819       1 reflector.go:424] pkg/mod/k8s.io/client-go@v0.25.0/tools/cache/reflector.go:169: failed to list *v1.Pod: pods is forbidden: User "system:serviceaccount:sn-system:function-mesh-controller-manager" cannot list resource "pods" in API group "" at the cluster scope

Failed to cleanupSubscription on OLM installation.

Modifications

Describe the modifications you've done.

Verifying this change

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

Documentation

Check the box below.

Need to update docs?

github-actions[bot] commented 1 year ago

@freeznet:Thanks for your contribution. For this PR, do we need to update docs? (The PR template contains info about doc, which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)

github-actions[bot] commented 1 year ago

@freeznet:Thanks for providing doc info!

freeznet commented 1 year ago

@jiangpengcheng please help to verify if https://github.com/streamnative/function-mesh/pull/704/commits/5f675736a3105e6792d4b2bdb9ce0dfc3594d099 is needed.

jiangpengcheng commented 1 year ago

@jiangpengcheng please help to verify if 5f67573 is needed.

It's better to have it

Then we need to add such logic to controllers/sink.go#ApplySinkCleanUpJob and cotrollers/source.go#ApplySourceCleanUpJob too