diff --git a/api/v1/env.go b/api/v1/env.go index 7d73c4d..eb512fc 100644 --- a/api/v1/env.go +++ b/api/v1/env.go @@ -241,7 +241,6 @@ func (s *Store) getStorage() []corev1.EnvVar { } func (s *Store) GetEnv() []corev1.EnvVar { - // TODO: Use map for overwriting when using ENVs from customer c := []corev1.EnvVar{ { @@ -302,6 +301,14 @@ func (s *Store) GetEnv() []corev1.EnvVar { Name: "SQL_SET_DEFAULT_SESSION_VARIABLES", Value: "0", }, + { + Name: "INSTALL_LOCALE", + Value: s.Spec.ShopConfiguration.Locale, + }, + { + Name: "INSTALL_CURRENCY", + Value: s.Spec.ShopConfiguration.Currency, + }, { Name: "APP_URL", Value: fmt.Sprintf("https://%s", s.Spec.Network.Host), diff --git a/api/v1/store.go b/api/v1/store.go index 4d021ae..5a48a70 100644 --- a/api/v1/store.go +++ b/api/v1/store.go @@ -39,6 +39,9 @@ type StoreSpec struct { HorizontalPodAutoscaler HPASpec `json:"horizontalPodAutoscaler,omitempty"` ServiceAccountName string `json:"serviceAccountName,omitempty"` + // +kubebuilder:default={Currency: "EURO", Locale: "en-GB"} + ShopConfiguration Configuration `json:"shopConfiguration,omitempty"` + // +kubebuilder:default=false DisableChecks bool `json:"disableChecks,omitempty"` DisableJobDeletion bool `json:"disableJobDeletion,omitempty"` @@ -73,6 +76,11 @@ func init() { SchemeBuilder.Register(&Store{}, &StoreList{}) } +type Configuration struct { + Currency string `json:"currency"` + Locale string `json:"locale"` +} + type Credentials struct { Username string `json:"username"` Password string `json:"password,omitempty"`