diff --git a/components/operator/internal/modules/webhooks/handler.go b/components/operator/internal/modules/webhooks/handler.go index 78afe91b91..a8e4461f4a 100644 --- a/components/operator/internal/modules/webhooks/handler.go +++ b/components/operator/internal/modules/webhooks/handler.go @@ -20,6 +20,54 @@ func (w module) Postgres(ctx modules.ReconciliationConfig) stackv1beta3.Postgres func (w module) Versions() map[string]modules.Version { return map[string]modules.Version{ "v0.0.0": { + Services: func(ctx modules.ReconciliationConfig) modules.Services { + return modules.Services{ + { + HasVersionEndpoint: true, + ExposeHTTP: modules.DefaultExposeHTTP, + InjectPostgresVariables: true, + ListenEnvVar: "LISTEN", + Annotations: ctx.Configuration.Spec.Services.Webhooks.Annotations.Service, + Container: func(resolveContext modules.ContainerResolutionConfiguration) modules.Container { + return modules.Container{ + Image: modules.GetImage("webhooks", resolveContext.Versions.Spec.Webhooks), + Env: w.webhooksEnvVars(resolveContext), + Resources: modules.GetResourcesWithDefault( + resolveContext.Configuration.Spec.Services.Webhooks.ResourceProperties, + modules.ResourceSizeSmall(), + ), + Debug: ctx.Configuration.Spec.Services.Webhooks.Debug, + } + }, + }, + { + Name: "worker", + InjectPostgresVariables: true, + ListenEnvVar: "LISTEN", + Liveness: modules.LivenessDisable, + Annotations: ctx.Configuration.Spec.Services.Webhooks.Annotations.Service, + Container: func(resolveContext modules.ContainerResolutionConfiguration) modules.Container { + return modules.Container{ + Image: modules.GetImage("webhooks", resolveContext.Versions.Spec.Webhooks), + Env: w.webhooksEnvVars(resolveContext).Append( + modules.Env("KAFKA_TOPICS", strings.Join([]string{ + resolveContext.Stack.GetServiceName("ledger"), + resolveContext.Stack.GetServiceName("payments"), + }, " ")), + ), + Args: []string{"worker"}, + Resources: modules.GetResourcesWithDefault( + resolveContext.Configuration.Spec.Services.Webhooks.ResourceProperties, + modules.ResourceSizeSmall(), + ), + Debug: ctx.Configuration.Spec.Services.Webhooks.Debug, + } + }, + }, + } + }, + }, + "v2.0.0-alpha": { DatabaseMigration: &modules.DatabaseMigration{ Shutdown: true, Command: []string{"migrate"},