Skip to content

Commit

Permalink
Add option to define (and customize) console catalog categories
Browse files Browse the repository at this point in the history
  • Loading branch information
jerolimov committed Dec 3, 2020
1 parent 2754061 commit a9b27b0
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 1 deletion.
62 changes: 62 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,68 @@ 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: category 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.
type: string
minLength: 32
pattern: ^[A-Za-z0-9-_]+$
label:
description: label defines a category display label.
type: string
minLength: 64
subcategories:
description: subcategories defines a list of child categories.
type: array
items:
description: category 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.
type: string
minLength: 32
pattern: ^[A-Za-z0-9-_]+$
label:
description: label defines a category display
label.
type: string
minLength: 64
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
44 changes: 44 additions & 0 deletions operator/v1/types_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,50 @@ 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"`
}

// developerCatalog allow the 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"`
}

// category for the developer console catalog.
type DeveloperConsoleCatalogCategoryMeta struct {
// 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"`
// 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"`
}

// category 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 a9b27b0

Please sign in to comment.