<p>I have an operator whose code is not accessible
By default, the operator requires the rights to list all secrets with no &quot;resource Names&quot; restriction
I can't grant such rights. Is there anyway to keep the rights to list all secrets and prohibit list multiple secrets by name</p>
<p>I tried to give rights to the list with resourceNames, but the operator does not accept this behavior and writes an error on startup</p>
<p>failed to list <em>v1.Secret: secrets is forbidden: User &quot;system:serviceaccount:operator-</em>*****&quot; cannot list resource &quot;secrets&quot; in API group &quot;&quot; in the namespace &quot;namespace-name&quot;</p>

Sergey Belov
<pre><code>failed to list v1.Secret: secrets is forbidden: User &quot;system:serviceaccount:operator-*****&quot; cannot list resource &quot;secrets&quot; in API group &quot;&quot; in the namespace &quot;namespace-name&quot;
</code></pre>
<p>The above error states that the operator with a service account does not have permission to list the secrets, to resolve your issue create role binding  for service account as it not given access by default after creation, for adding a viewer (read only) role to service account run the following command:</p>
<p>For example, grant read-only permission within &quot;my-namespace&quot; to the &quot;my-sa&quot; service account:</p>
<pre><code>kubectl create rolebinding my-sa-view \

 --clusterrole=view \

 --serviceaccount=my-namespace:my-sa \

 --namespace=my-namespace
</code></pre>
<p>Found a similar <a href="https://stackoverflow.com/questions/71513836">stack question</a> for more information.</p>
