From 97b14c49c8aa5db68012f9e4904b45d6ae82adf9 Mon Sep 17 00:00:00 2001 From: Imtiaz Uddin <59226374+Imtiaz246@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:56:37 +0600 Subject: [PATCH] Add branding options in ace installer (#270) Signed-off-by: Imtiaz Uddin --- apis/installer/v1alpha1/ace_ace_types.go | 1 + apis/installer/v1alpha1/ace_options_types.go | 1 + apis/installer/v1alpha1/ace_shared_types.go | 9 +++++++++ .../installer/v1alpha1/zz_generated.deepcopy.go | 17 +++++++++++++++++ charts/ace/README.md | 3 +++ charts/ace/templates/platform/config.yaml | 5 +++++ charts/ace/values.openapiv3_schema.yaml | 10 ++++++++++ charts/ace/values.yaml | 5 +++++ schema/ace-options/values.openapiv3_schema.yaml | 10 ++++++++++ 9 files changed, 61 insertions(+) diff --git a/apis/installer/v1alpha1/ace_ace_types.go b/apis/installer/v1alpha1/ace_ace_types.go index a2afa61f4..358599015 100644 --- a/apis/installer/v1alpha1/ace_ace_types.go +++ b/apis/installer/v1alpha1/ace_ace_types.go @@ -79,6 +79,7 @@ type AceSpec struct { NodeSelector map[string]string `json:"nodeSelector"` Tolerations []core.Toleration `json:"tolerations"` Affinity *core.Affinity `json:"affinity"` + Branding AceBrandingSpec `json:"branding"` } type AceBilling struct { diff --git a/apis/installer/v1alpha1/ace_options_types.go b/apis/installer/v1alpha1/ace_options_types.go index 7348ca35a..681b31c5e 100644 --- a/apis/installer/v1alpha1/ace_options_types.go +++ b/apis/installer/v1alpha1/ace_options_types.go @@ -70,6 +70,7 @@ type AceOptionsSpec struct { DNSProxy AceOptionsComponentSpec `json:"dns-proxy"` SMTPRelay AceOptionsComponentSpec `json:"smtprelay"` Minio AceOptionsComponentSpec `json:"minio"` + Branding AceBrandingSpec `json:"branding"` } type RegistrySpec struct { diff --git a/apis/installer/v1alpha1/ace_shared_types.go b/apis/installer/v1alpha1/ace_shared_types.go index 085683f34..d302a2292 100644 --- a/apis/installer/v1alpha1/ace_shared_types.go +++ b/apis/installer/v1alpha1/ace_shared_types.go @@ -106,3 +106,12 @@ type AceSettingsSecretName struct { type PersistenceSpec struct { Size resource.Quantity `json:"size"` } + +type AceBrandingSpec struct { + //+optional + PrimaryColor string `json:"primaryColor"` + // +optional + Logo string `json:"logo"` + //+optional + Favicon string `json:"favicon"` +} diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index 7cd83af96..3326cb76f 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -220,6 +220,21 @@ func (in *AceBilling) DeepCopy() *AceBilling { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AceBrandingSpec) DeepCopyInto(out *AceBrandingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AceBrandingSpec. +func (in *AceBrandingSpec) DeepCopy() *AceBrandingSpec { + if in == nil { + return nil + } + out := new(AceBrandingSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AceClusterUi) DeepCopyInto(out *AceClusterUi) { *out = *in @@ -1015,6 +1030,7 @@ func (in *AceOptionsSpec) DeepCopyInto(out *AceOptionsSpec) { in.DNSProxy.DeepCopyInto(&out.DNSProxy) in.SMTPRelay.DeepCopyInto(&out.SMTPRelay) in.Minio.DeepCopyInto(&out.Minio) + out.Branding = in.Branding } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AceOptionsSpec. @@ -1285,6 +1301,7 @@ func (in *AceSpec) DeepCopyInto(out *AceSpec) { *out = new(v1.Affinity) (*in).DeepCopyInto(*out) } + out.Branding = in.Branding } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AceSpec. diff --git a/charts/ace/README.md b/charts/ace/README.md index 5165e5063..4a58a8879 100644 --- a/charts/ace/README.md +++ b/charts/ace/README.md @@ -197,6 +197,9 @@ The following table lists the configurable parameters of the `ace` chart and the | nodeSelector | | {} | | tolerations | | [] | | affinity | | {} | +| branding.logo | | "" | +| branding.favicon | | "" | +| branding.primaryColor | | "" | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/ace/templates/platform/config.yaml b/charts/ace/templates/platform/config.yaml index ebbfc2ba9..d286c6190 100644 --- a/charts/ace/templates/platform/config.yaml +++ b/charts/ace/templates/platform/config.yaml @@ -201,3 +201,8 @@ stringData: NAMESPACE = {{ .Release.Namespace }} LABELS = trickstercache.org/metadata.name={{ include "ace.fullname" . }} {{- end }} + + [branding] + LOGO = {{ .Values.branding.logo }} + FAVICON = {{ .Values.branding.favicon }} + PRIMARY_COLOR = {{ .Values.branding.primaryColor }} diff --git a/charts/ace/values.openapiv3_schema.yaml b/charts/ace/values.openapiv3_schema.yaml index f491b4980..15ab03fc5 100644 --- a/charts/ace/values.openapiv3_schema.yaml +++ b/charts/ace/values.openapiv3_schema.yaml @@ -1764,6 +1764,15 @@ properties: - settings - summary type: object + branding: + properties: + favicon: + type: string + logo: + type: string + primaryColor: + type: string + type: object cluster-ui: properties: affinity: @@ -17152,6 +17161,7 @@ required: - accounts-ui - affinity - billing +- branding - cluster-ui - deploy-ui - dns-proxy diff --git a/charts/ace/values.yaml b/charts/ace/values.yaml index fd59d794e..4c94625ed 100644 --- a/charts/ace/values.yaml +++ b/charts/ace/values.yaml @@ -427,3 +427,8 @@ nodeSelector: {} tolerations: [] affinity: {} + +branding: + logo: "" + favicon: "" + primaryColor: "" diff --git a/schema/ace-options/values.openapiv3_schema.yaml b/schema/ace-options/values.openapiv3_schema.yaml index 1f01cdc02..174655afa 100644 --- a/schema/ace-options/values.openapiv3_schema.yaml +++ b/schema/ace-options/values.openapiv3_schema.yaml @@ -73,6 +73,15 @@ properties: required: - enabled type: object + branding: + properties: + favicon: + type: string + logo: + type: string + primaryColor: + type: string + type: object cluster-ui: properties: enabled: @@ -1420,6 +1429,7 @@ properties: required: - accounts-ui - billing + - branding - cluster-ui - context - deploy-ui