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

CSV Injection support targeting specific operators #97

Open
kooreshakhbari opened this issue May 27, 2021 · 0 comments
Open

CSV Injection support targeting specific operators #97

kooreshakhbari opened this issue May 27, 2021 · 0 comments
Assignees

Comments

@kooreshakhbari
Copy link

kooreshakhbari commented May 27, 2021

From what I understand currently if we want to use CSV Injection in the NamespaceScope CR we set csvInjector: enable: true and then it looks for all the operators which have the annotation nss.operator.ibm.com/managed-operators and it basically goes and patches the CSVs with the specified config map from the CR and the restartLabel.

It would be great if in the NSS CR you could tell it to target a specific operator rather than patching all operators which have the annotation nss.operator.ibm.com/managed-operators .

For example lets say I have two operators running in namespace X, and I want to use the NSS operator with CSV injection to make operator 1 extend its namespace scope to namespace Y only and I want operator 2 to extend its namespace scope to namespace Z only.

This could be achieved if in the NSS CR we had a field that would ask us to which specific package manifest or CSV we want to inject the config map and restart label.

apiVersion: operator.ibm.com/v1
kind: NamespaceScope
metadata:
  name: common-service
spec:
  namespaceMembers:
  - namespaceX
  - namespaceY
  configmapName: cp4d-scope
  restartLabels:
    operator: cp4d
csvInjector:
  enable: true
  managed-operators: "operator1, operator2"
apiVersion: operator.ibm.com/v1
kind: NamespaceScope
metadata:
  name: common-service1
spec:
  namespaceMembers:
  - namespaceZ
  configmapName: cp4d-scope1
  restartLabels:
    operator: cp4d1
csvInjector:
  enable: true
  managed-operators: "operator3"

Then the behaviour in the CSV for operator1 and operator2 would be that their WATCH_NAMESPACE would be reading from a config map called cp4d-scope and the namespaces in that config map are namespaceX, namespaceY and the restart label for them would be operator: cp4d

Then from the second CR the behaviour for operator3 would be that its WATCH_NAMESPACE would be reading from config map called cp4d-scope1 and its namespace is namespaceZ and its restart label is operator: cp4d1


There could also be another implementation where a new annotation such as managed-namespacescopeCR: namespace-scope1 is added to a CSV and in the NSS CR there would be a new field such as targetSpecificOperators: true that would force that specifc CR to only patch CSV that have the annotation managed-namespacescopeCR: {NSSCR-NAME} and if the is targetSpecificOperators: false then that CR would update all CSVs that only have the annotation nss.operator.ibm.com/managed-operators:

@horis233 horis233 self-assigned this May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants