From 5d09125fa081533e9d3788efb6193ce0c5951891 Mon Sep 17 00:00:00 2001 From: Jakub Hadvig Date: Fri, 13 Sep 2019 13:47:39 +0200 Subject: [PATCH] Add project dashboard link to console api --- console/v1/types_console_link.go | 14 ++++++++++ console/v1/zz_generated.deepcopy.go | 26 +++++++++++++++++++ .../v1/zz_generated.swagger_doc_generated.go | 16 +++++++++--- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/console/v1/types_console_link.go b/console/v1/types_console_link.go index 40f9262f393..9b7c4ba3059 100644 --- a/console/v1/types_console_link.go +++ b/console/v1/types_console_link.go @@ -24,6 +24,12 @@ type ConsoleLinkSpec struct { // // +optional ApplicationMenu *ApplicationMenuSpec `json:"applicationMenu,omitempty"` + // namespaceDashboard holds information about namespaces in which the dashboard link should + // appear, and it is applicable only when location is set to NamespaceDashboard. + // If not specified, the link will appear in all namespaces. + // + // +optional + NamespaceDashboard *NamespaceDashboardSpec `json:"namespaceDashboard,omitempty"` } // ApplicationMenuSpec is the specification of the desired section and icon used for the link in the application menu. @@ -36,6 +42,12 @@ type ApplicationMenuSpec struct { ImageURL string `json:"imageURL,omitempty"` } +// NamespaceDashboardSpec is a specification of namespaces in which the dashboard link should appear. +type NamespaceDashboardSpec struct { + // namespaces is an array of namespace names in which the dashboard link should appear. + Namespaces []string `json:"namespaces"` +} + // ConsoleLinkLocationSelector is a set of possible menu targets to which a link may be appended. type ConsoleLinkLocation string @@ -46,6 +58,8 @@ const ( UserMenu ConsoleLinkLocation = "UserMenu" // ApplicationMenu indicates that the link should appear inside the application menu of the console. ApplicationMenu ConsoleLinkLocation = "ApplicationMenu" + // NamespaceDashboard indicates that the link should appear in the namespaced dashboard of the console. + NamespaceDashboard ConsoleLinkLocation = "NamespaceDashboard" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/console/v1/zz_generated.deepcopy.go b/console/v1/zz_generated.deepcopy.go index 8c1b2694a66..4ca87ea36f9 100644 --- a/console/v1/zz_generated.deepcopy.go +++ b/console/v1/zz_generated.deepcopy.go @@ -250,6 +250,11 @@ func (in *ConsoleLinkSpec) DeepCopyInto(out *ConsoleLinkSpec) { *out = new(ApplicationMenuSpec) **out = **in } + if in.NamespaceDashboard != nil { + in, out := &in.NamespaceDashboard, &out.NamespaceDashboard + *out = new(NamespaceDashboardSpec) + (*in).DeepCopyInto(*out) + } return } @@ -359,3 +364,24 @@ func (in *Link) DeepCopy() *Link { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceDashboardSpec) DeepCopyInto(out *NamespaceDashboardSpec) { + *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceDashboardSpec. +func (in *NamespaceDashboardSpec) DeepCopy() *NamespaceDashboardSpec { + if in == nil { + return nil + } + out := new(NamespaceDashboardSpec) + in.DeepCopyInto(out) + return out +} diff --git a/console/v1/zz_generated.swagger_doc_generated.go b/console/v1/zz_generated.swagger_doc_generated.go index 4dbec77d047..5d9729ed0c0 100644 --- a/console/v1/zz_generated.swagger_doc_generated.go +++ b/console/v1/zz_generated.swagger_doc_generated.go @@ -105,15 +105,25 @@ func (ConsoleLinkList) SwaggerDoc() map[string]string { } var map_ConsoleLinkSpec = map[string]string{ - "": "ConsoleLinkSpec is the desired console link configuration.", - "location": "location determines which location in the console the link will be appended to.", - "applicationMenu": "applicationMenu holds information about section and icon used for the link in the application menu, and it is applicable only when location is set to ApplicationMenu.", + "": "ConsoleLinkSpec is the desired console link configuration.", + "location": "location determines which location in the console the link will be appended to.", + "applicationMenu": "applicationMenu holds information about section and icon used for the link in the application menu, and it is applicable only when location is set to ApplicationMenu.", + "namespaceDashboard": "namespaceDashboard holds information about namespaces in which the dashboard link should appear, and it is applicable only when location is set to NamespaceDashboard. If not specified, the link will appear in all namespaces.", } func (ConsoleLinkSpec) SwaggerDoc() map[string]string { return map_ConsoleLinkSpec } +var map_NamespaceDashboardSpec = map[string]string{ + "": "NamespaceDashboardSpec is a specification of namespaces in which the dashboard link should appear.", + "namespaces": "namespaces is an array of namespace names in which the dashboard link should appear.", +} + +func (NamespaceDashboardSpec) SwaggerDoc() map[string]string { + return map_NamespaceDashboardSpec +} + var map_ConsoleNotification = map[string]string{ "": "ConsoleNotification is the extension for configuring openshift web console notifications.", "metadata": "Standard object's metadata.",