-
Notifications
You must be signed in to change notification settings - Fork 18
Description
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: