Uh oh!
There was an error while loading. Please reload this page.
🐛 Fix matchConditions to be compatible with GenerateName - #382
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. |
grokspawn
commented
Sep 6, 2024
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>
grokspawn
commented
Sep 6, 2024
e2e failure looks legit |
tmshort
commented
Sep 6, 2024
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.