From 2deaa51b46115d20e4c6ac8cf11f46ffeed9e28e Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Mon, 14 Oct 2024 15:43:35 +0200 Subject: [PATCH] Add search index to Frontend spec --- api/v1alpha1/frontend_types.go | 11 +++++++ api/v1alpha1/zz_generated.deepcopy.go | 31 +++++++++++++++++++ .../crd/bases/cloud.redhat.com_frontends.yaml | 27 ++++++++++++++++ deploy.yml | 27 ++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/api/v1alpha1/frontend_types.go b/api/v1alpha1/frontend_types.go index f9bd8ac2..539abcdc 100644 --- a/api/v1alpha1/frontend_types.go +++ b/api/v1alpha1/frontend_types.go @@ -39,6 +39,15 @@ type ServiceMonitorConfig struct { Disabled bool `json:"disabled,omitempty"` } +type SearchEntry struct { + ID string `json:"id" yaml:"id"` + Href string `json:"href" yaml:"href"` + Title string `json:"title" yaml:"title"` + Description string `json:"description" yaml:"description"` + AltTitle []string `json:"alt_title" yaml:"alt_title"` + IsExternal bool `json:"isExternal" yaml:"isExternal"` +} + // FrontendSpec defines the desired state of Frontend type FrontendSpec struct { Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"` @@ -57,6 +66,8 @@ type FrontendSpec struct { AkamaiCacheBustDisable bool `json:"akamaiCacheBustDisable,omitempty" yaml:"akamaiCacheBustDisable,omitempty"` // Files to cache bust AkamaiCacheBustPaths []string `json:"akamaiCacheBustPaths,omitempty" yaml:"akamaiCacheBustPaths,omitempty"` + // The search index partials for the resource + SearchEntries []*SearchEntry `json:"searchEntries,omitempty" yaml:"searchEntries,omitempty"` } var ReconciliationSuccessful = "ReconciliationSuccessful" diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 12f4ba7c..c8a4cf11 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -513,6 +513,17 @@ func (in *FrontendSpec) DeepCopyInto(out *FrontendSpec) { *out = make([]string, len(*in)) copy(*out, *in) } + if in.SearchEntries != nil { + in, out := &in.SearchEntries, &out.SearchEntries + *out = make([]*SearchEntry, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(SearchEntry) + (*in).DeepCopyInto(*out) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FrontendSpec. @@ -642,6 +653,26 @@ func (in *Route) DeepCopy() *Route { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SearchEntry) DeepCopyInto(out *SearchEntry) { + *out = *in + if in.AltTitle != nil { + in, out := &in.AltTitle, &out.AltTitle + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SearchEntry. +func (in *SearchEntry) DeepCopy() *SearchEntry { + if in == nil { + return nil + } + out := new(SearchEntry) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ServiceMonitorConfig) DeepCopyInto(out *ServiceMonitorConfig) { *out = *in diff --git a/config/crd/bases/cloud.redhat.com_frontends.yaml b/config/crd/bases/cloud.redhat.com_frontends.yaml index 560c6afc..bbdc2854 100644 --- a/config/crd/bases/cloud.redhat.com_frontends.yaml +++ b/config/crd/bases/cloud.redhat.com_frontends.yaml @@ -247,6 +247,33 @@ spec: - title type: object type: array + searchEntries: + description: The search index partials for the resource + items: + properties: + alt_title: + items: + type: string + type: array + description: + type: string + href: + type: string + id: + type: string + isExternal: + type: boolean + title: + type: string + required: + - alt_title + - description + - href + - id + - isExternal + - title + type: object + type: array service: type: string serviceMonitor: diff --git a/deploy.yml b/deploy.yml index 268a8993..acdc403d 100644 --- a/deploy.yml +++ b/deploy.yml @@ -694,6 +694,33 @@ objects: - title type: object type: array + searchEntries: + description: The search index partials for the resource + items: + properties: + alt_title: + items: + type: string + type: array + description: + type: string + href: + type: string + id: + type: string + isExternal: + type: boolean + title: + type: string + required: + - alt_title + - description + - href + - id + - isExternal + - title + type: object + type: array service: type: string serviceMonitor: