-
Notifications
You must be signed in to change notification settings - Fork 529
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
ODC-5020: Add option to define (and customize) console catalog categories #763
ODC-5020: Add option to define (and customize) console catalog categories #763
Conversation
71e56df
to
34c88e2
Compare
34c88e2
to
1e2e196
Compare
a833bb2
to
5392dff
Compare
213cc1b
to
09d77e2
Compare
09d77e2
to
775f684
Compare
775f684
to
83da4d6
Compare
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.
Thanks for the PR ! 👍
Adding review for this CRD.
a963841
to
0ca542a
Compare
0ca542a
to
6cafa97
Compare
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.
Couple of wording suggestions.
4e1306e
to
3a98fd1
Compare
@jhadvig I have accepted all suggestions and rebased this PR. |
operator/v1/types_console.go
Outdated
Tags []string `json:"tags,omitempty"` | ||
} | ||
|
||
// DeveloperConsoleCatalogCategory defines a top level category incl. label, filter tags |
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 comment here should match the API property instead of the name of the struct since this will be used for the CRD property description. I'd avoid the incl. abbreviation here since this is publicly facing doc.
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.
@jhadvig Changed type messages to:
for DeveloperConsoleCatalogCustomization:
// developerCatalog allow the cluster admin to configure developer catalog.
for DeveloperConsoleCatalogCategoryMeta and DeveloperConsoleCatalogCategory:
// category for the developer console catalog.
operator/v1/types_console.go
Outdated
ID string `json:"id"` | ||
// label defines a category display label. | ||
Label string `json:"label"` | ||
// tags in a list of strings that will match the category. |
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.
It would be good to put more detail about how this is matched against different kinds of resources.
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.
tags in a list of strings that will match the category. A selected category
show all items which has at least one overlapping tag between category and item.
OK? As you said, the exact details depends on the kind of resources
3a98fd1
to
198988b
Compare
Updated |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
type DeveloperConsoleCatalogCategoryMeta struct { | ||
// ID is an identifier used in the URL to enable deep linking in console. | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MinLength=1 |
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.
Should we also add max length validation ?
// +kubebuilder:validation:MinLength=32
or a regexp that would only allow certain chars?
// +kubebuilder:validation:Pattern=`...`
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 same for Label
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.
Sounds good, esp. for ID because we use this in URLs. Defined them now as:
// ID is an identifier used in the URL to enable deep linking in console.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MinLength=32
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9-_]+$`
// +required
ID string `json:"id"`
// label defines a category display label.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MinLength=64
// +required
Label string `json:"label"`
a9b27b0
to
c3e53ac
Compare
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MinLength=1 | ||
// +kubebuilder:validation:MinLength=32 | ||
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9-_]+$` |
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.
You should describe the restriction on the ID in the API doc so people know.
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.
Added them, but the pattern is also part of the CRD yaml and could not find any other doc where we add this to the description. Let me know if I should keep this or revert this.
operator/v1/types_console.go
Outdated
// ID is an identifier used in the URL to enable deep linking in console. | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MinLength=1 | ||
// +kubebuilder:validation:MinLength=32 |
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.
MinLength 32? :) I assume you mean Max.
You should describe any restrictions in the API doc.
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.
Yeah, good catch, thanks. Fixed.
operator/v1/types_console.go
Outdated
// label defines a category display label. | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:MinLength=1 | ||
// +kubebuilder:validation:MinLength=64 |
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.
MaxLength?
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.
Yep, thanks. Fixed.
c3e53ac
to
5893d0a
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerolimov, spadgett 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 |
/retitle ODC-5020: Add option to define (and customize) console catalog categories |
Issue: https://issues.redhat.com/browse/ODC-5020
Extends the existing
Console
CRD with new type definitions to allow the admin to override the predefined catalog categories. See enhancement proposal PR openshift/enhancements#508