🐛 Fix matchConditions to be compatible with GenerateName#382
🐛 Fix matchConditions to be compatible with GenerateName#382tmshort merged 1 commit intooperator-framework:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #382 +/- ##
=======================================
Coverage 33.95% 33.95%
=======================================
Files 16 16
Lines 698 698
=======================================
Hits 237 237
Misses 435 435
Partials 26 26 ☔ View full report in Codecov by Sentry. |
|
Is there a way to put some comments around that to make the precedence clear? I initially miscounted the perens and thought that you hadn't contained the existing conditions when adding the new stuff. |
Signed-off-by: Todd Short <todd.short@me.com>
0695a15 to
49e6d43
Compare
|
e2e failure looks legit |
|
It seems to be a timing issue, it passed on a re-run. |
| value: | ||
| - name: MissingOrIncorrectMetadataNameLabel | ||
| expression: "!has(object.metadata.labels) || !('olm.operatorframework.io/metadata.name' in object.metadata.labels) || object.metadata.labels['olm.operatorframework.io/metadata.name'] != object.metadata.name" | ||
| expression: "'name' in object.metadata && (!has(object.metadata.labels) || !('olm.operatorframework.io/metadata.name' in object.metadata.labels) || object.metadata.labels['olm.operatorframework.io/metadata.name'] != object.metadata.name)" |
There was a problem hiding this comment.
Would reinvocationPolicy in the webhook config help?
I assume if the webhook is reinvoked, metadata.name would be available the second time because the name generator is another admission plugin.
There was a problem hiding this comment.
Yes, when k8s creates the name, it goes back through the webhook
This makes sure we have a
namefor the resource... the only way this could happen is ifgenerateNameis in use. In that case, k8s will update the resource with aname, and we'll catch it in the webhook after that happens.