-
Notifications
You must be signed in to change notification settings - Fork 615
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
Allow specialized views of already registered models #1658
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yaacov If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@vojtechszocs @mareklibra @rawagner please review |
c647da1
to
3fc83ed
Compare
a590802
to
06b4417
Compare
@@ -12,7 +12,7 @@ import { FLAGS } from '../../const'; | |||
const unknownKinds = new Set(); | |||
|
|||
export const resourcePathFromModel = (model, name, namespace) => { | |||
const {path, namespaced, crd} = model; | |||
const {plural, namespaced, crd} = model; |
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.
@spadgett Hi, this function is building url for the console ( vs. building for the k8s API ) , shouldn't is use plural
instead of path
, what am I missing ?
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.
Models representing custom resources (having crd: true
) will have their resourcePath
based on referenceForModel
function ([group]~[version]~[kind]
), which serves as the key for all CRD-based models.
Models representing core k8s objects (without crd: true
) will have their resourcePath
based on model's path
attribute only.
Model's plural
attribute seems to be used for organizing models within Redux and k8s queries, see e.g. connectToPlural
in public/kinds.ts
.
@vojtechszocs please have a look |
I've talked with @yaacov, the issue here is that we're trying to redefine an existing base k8s model (with the same Redefining existing models, whether base or plugin-contributed, shouldn't be allowed. What we really want to do is have a nav link that points to a custom page that lists VM templates specifically. Using #1668 to add new route & page component seems like a better approach to me. cc @spadgett |
+1 /hold |
@spadgett @vojtechszocs @mareklibra willl use #1668 to add new route & page component for the vm template page. |
Allow specialized views of already registered models.
Currently we do not allow for a template to register a new view of a model already existing.
Sometimes it is useful to have a specialized view of an already registered model, for example, kubevirt use a view called "Virtual machine templates" to view openshift templates with specialized features.
Currently the new view is rejected because it is falsely flagged as duplication of the regular template view.
This PR allow for a plugin author to flag a plugin model as a
specialized
view, to bypass the check for duplication views.Screenshot: