-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat : Valid (SingleNamespaced) Operator Installation in tenant namespace #2589
base: main
Are you sure you want to change the base?
Conversation
98cb58b
to
56d4773
Compare
from change #2589: |
1f928d0
to
e3fd824
Compare
from change #2589: |
33278d6
to
26570f7
Compare
from change #2589: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial set of comments
fad4dfa
to
822dfe9
Compare
2ba0ff8
to
475f7b6
Compare
100a06b
to
4a90823
Compare
f1e2476
to
0e6d3e1
Compare
validOwnerFound := false | ||
for _, owner := range topOwners { | ||
if owner.Kind == v1alpha1.ClusterServiceVersionKind && owner.Namespace == namespace { | ||
foundCsvs[owner.Name] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need more checks here. other valid top owner could be the operands created based on the crds installed by this operator. Actually these operands can only be installed in the single operator namespace. For instance, for prometheus, pods belonging to the prometheus object top owner should be valid. We could list all the crds installs by this operator by reading the crd label: "operatorframework.io/installed-alongside-..." or similar then use the crd name to identify valid top owners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edcdavid that's only valid for operators installed with the ownNamespace mode. For singleNamespace operators, the controller is running in namespace A and watches for CRs in namespace B, so, in theory, operand pods should only be found in namespace B.
The problem is the requirement only referes to SingleNamespaced and AllNamespaced operators... so what about ownNamespaced and multiNamespaced ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, you are right about single namespace vs own namespace, in single namespace only mode, the operand should be in only in namespace B, sorry for the confusion. So in this case, we still need a way to ignore the csv that will be created in namespace B otherwise it will be picked up as an operator namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is the requirement only referes to SingleNamespaced and AllNamespaced operators... so what about ownNamespaced and multiNamespaced ones?
In my opinion, the multi namespace is similar to the single namespace and it would make sense to support it here.
from change #2589: |
a019beb
to
23f4b89
Compare
from change #2589: |
from change #2589: |
from change #2589: |
from change #2589: |
Leaving this comment just to summarize what we've been talking in the internal meeting:
In ns1, due to operatogroup's.targetNamespaces = ns2, only singleNamespaced operators are allowed, therefore there should be only controller pods of Op1 and Op2. Any workload pod, operand pod or csv from singleNamespace operators installed in a different ns (e.g. csvOp3) should make the tc to fail. |
What messages do we expect for non-compliant namespaces / operators? |
Not a strong opinion on this, but I think we should use the ReportObject's "AddField" method to include every resource found that makes that namespace not compatible with the operator under test. E.g.:
|
Refers the issue