diff --git a/apis/vshn/v1/dbaas_vshn_Forgejo.go b/apis/vshn/v1/dbaas_vshn_Forgejo.go index cc23cc334..1c9cc111d 100644 --- a/apis/vshn/v1/dbaas_vshn_Forgejo.go +++ b/apis/vshn/v1/dbaas_vshn_Forgejo.go @@ -88,8 +88,9 @@ type VSHNForgejoServiceSpec struct { // This also enables strict hostname checking for this FQDN. FQDN []string `json:"fqdn,omitempty"` - // Forgejosettings contains additional Forgejo settings. - Forgejosettings string `json:"forgejosettings,omitempty"` + // AdminEmail contains the email address of the admin user. + // If it's not set, admin user is going to be: gitea@local.domain + AdminEmail string `json:"adminEmail,omitempty"` // +kubebuilder:validation:Enum="besteffort";"guaranteed" // +kubebuilder:default="besteffort" diff --git a/crds/vshn.appcat.vshn.io_vshnforgejoes.yaml b/crds/vshn.appcat.vshn.io_vshnforgejoes.yaml index 387a5e353..b690b7ace 100644 --- a/crds/vshn.appcat.vshn.io_vshnforgejoes.yaml +++ b/crds/vshn.appcat.vshn.io_vshnforgejoes.yaml @@ -4834,8 +4834,10 @@ spec: service: description: Service contains Forgejo DBaaS specific properties properties: - forgejosettings: - description: Forgejosettings contains additional Forgejo settings. + adminEmail: + description: |- + AdminEmail contains the email address of the admin user. + If it's not set, admin user is going to be: gitea@local.domain type: string fqdn: description: |- diff --git a/crds/vshn.appcat.vshn.io_xvshnforgejoes.yaml b/crds/vshn.appcat.vshn.io_xvshnforgejoes.yaml index 85c2fce51..204831873 100644 --- a/crds/vshn.appcat.vshn.io_xvshnforgejoes.yaml +++ b/crds/vshn.appcat.vshn.io_xvshnforgejoes.yaml @@ -5558,8 +5558,10 @@ spec: service: description: Service contains Forgejo DBaaS specific properties properties: - forgejosettings: - description: Forgejosettings contains additional Forgejo settings. + adminEmail: + description: |- + AdminEmail contains the email address of the admin user. + If it's not set, admin user is going to be: gitea@local.domain type: string fqdn: description: |- diff --git a/pkg/comp-functions/functions/vshnforgejo/deploy.go b/pkg/comp-functions/functions/vshnforgejo/deploy.go index 7d86491bb..8c5c0f03d 100644 --- a/pkg/comp-functions/functions/vshnforgejo/deploy.go +++ b/pkg/comp-functions/functions/vshnforgejo/deploy.go @@ -213,6 +213,10 @@ func addForgejo(ctx context.Context, svc *runtime.ServiceRuntime, comp *vshnv1.V values["podSecurityContext"] = securityContext["podSecurityContext"] } + if comp.Spec.Parameters.Service.AdminEmail != "" { + values["gitea"].(map[string]any)["config"].(map[string]any)["admin"].(map[string]any)["ADMIN_EMAIL"] = comp.Spec.Parameters.Service.AdminEmail + } + release, err := common.NewRelease(ctx, svc, comp, values) if err != nil { return err