Skip to content

Commit

Permalink
Merge pull request #763 from jerolimov/odc-5020
Browse files Browse the repository at this point in the history
Add option to define (and customize) console catalog categories
  • Loading branch information
openshift-merge-robot committed Dec 3, 2020
2 parents c65ccc2 + 5893d0a commit 3fdbb93
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 1 deletion.
72 changes: 72 additions & 0 deletions operator/v1/0000_70_console-operator.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,78 @@ spec:
in page titles, logo alt text, and the about dialog instead
of the normal OpenShift product name.
type: string
developerCatalog:
description: developerCatalog allows to configure the shown developer
catalog categories.
type: object
properties:
categories:
description: categories which are shown in the developer catalog.
type: array
items:
description: DeveloperConsoleCatalogCategory for the developer
console catalog.
type: object
required:
- id
- label
properties:
id:
description: ID is an identifier used in the URL to
enable deep linking in console. ID is required and
must have 1-32 URL safe (A-Z, a-z, 0-9, - and _) characters.
type: string
maxLength: 32
minLength: 1
pattern: ^[A-Za-z0-9-_]+$
label:
description: label defines a category display label.
It is required and must have 1-64 characters.
type: string
maxLength: 64
minLength: 1
subcategories:
description: subcategories defines a list of child categories.
type: array
items:
description: DeveloperConsoleCatalogCategoryMeta are
the key identifiers of a developer catalog category.
type: object
required:
- id
- label
properties:
id:
description: ID is an identifier used in the URL
to enable deep linking in console. ID is required
and must have 1-32 URL safe (A-Z, a-z, 0-9,
- and _) characters.
type: string
maxLength: 32
minLength: 1
pattern: ^[A-Za-z0-9-_]+$
label:
description: label defines a category display
label. It is required and must have 1-64 characters.
type: string
maxLength: 64
minLength: 1
tags:
description: tags is 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.
type: array
items:
type: string
tags:
description: tags is 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.
type: array
items:
type: string
documentationBaseURL:
description: documentationBaseURL links to external documentation
are shown in various sections of the web console. Providing
Expand Down
45 changes: 45 additions & 0 deletions operator/v1/types_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,51 @@ type ConsoleCustomization struct {
// SVG format preferred
// +optional
CustomLogoFile configv1.ConfigMapFileReference `json:"customLogoFile,omitempty"`
// developerCatalog allows to configure the shown developer catalog categories.
// +kubebuilder:validation:Optional
// +optional
DeveloperCatalog DeveloperConsoleCatalogCustomization `json:"developerCatalog,omitempty"`
}

// DeveloperConsoleCatalogCustomization allow cluster admin to configure developer catalog.
type DeveloperConsoleCatalogCustomization struct {
// categories which are shown in the developer catalog.
// +kubebuilder:validation:Optional
// +optional
Categories []DeveloperConsoleCatalogCategory `json:"categories,omitempty"`
}

// DeveloperConsoleCatalogCategoryMeta are the key identifiers of a developer catalog category.
type DeveloperConsoleCatalogCategoryMeta struct {
// ID is an identifier used in the URL to enable deep linking in console.
// ID is required and must have 1-32 URL safe (A-Z, a-z, 0-9, - and _) characters.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=32
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9-_]+$`
// +required
ID string `json:"id"`
// label defines a category display label. It is required and must have 1-64 characters.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=64
// +required
Label string `json:"label"`
// tags is 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.
// +kubebuilder:validation:Optional
// +optional
Tags []string `json:"tags,omitempty"`
}

// DeveloperConsoleCatalogCategory for the developer console catalog.
type DeveloperConsoleCatalogCategory struct {
// defines top level category ID, label and filter tags.
DeveloperConsoleCatalogCategoryMeta `json:",inline"`
// subcategories defines a list of child categories.
// +kubebuilder:validation:Optional
// +optional
Subcategories []DeveloperConsoleCatalogCategoryMeta `json:"subcategories,omitempty"`
}

// Brand is a specific supported brand within the console.
Expand Down
71 changes: 70 additions & 1 deletion operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fdbb93

Please sign in to comment.