[mpi-operator] Fix mpijob crd schema + cluster role name #573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove irrelevant fields.]
[mychartname]
)Description:
In #559 I added the schema cause otherwise it wouldn't let install the CRD on k8s>=1.19. the schema I used there was just taken from the validation block which I thought back then to be aligned.
Apparently, this schema is missing A LOT of stuff, and what practically happening is that when you create a custom object pretty much all of it is getting pruned .
The actual schema includes a Pod template, and currently there is no way to use already defined structure ( kubernetes/kubernetes#62872 and kubernetes/kubernetes#82292), I'm not willing to duplicate the whole pod template schema since it's huge, so I simply added
x-kubernetes-preserve-unknown-fields: true
which just turn off field pruning (I assume at some point k8s won't let us do that, but also at that point they will hopefully resolve those issues so we will be able to re-use stuff)Also, fixed the cluster role name to use the correct value (before it was assigned to a value different than the role binding, so was practically not getting the binding to the cluster role)