@@ -82,6 +82,10 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn
8282defer metrics .SetDuration (inspectServicesDurationGauges .WithLabelValues (deploymentName ), start )
8383counterMetric := inspectedServicesCounters .WithLabelValues (deploymentName )
8484
85+ if spec .IsGatewayEnabled () {
86+ role = api .ServerGroupGateways .AsRole ()
87+ }
88+
8589// Fetch existing services
8690svcs := cachedStatus .ServicesModInterface ().V1 ()
8791amInspector := cachedStatus .ArangoMember ().V1 ()
@@ -130,7 +134,7 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn
130134
131135// Group Services
132136for _ , group := range api .AllServerGroups {
133- if ! group .Enabled (spec .GetMode ()) {
137+ if ! group .Enabled (spec .GetMode ()) && ! group . IsGateway () {
134138continue
135139}
136140
@@ -189,11 +193,6 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn
189193counterMetric .Inc ()
190194headlessPorts , headlessSelector := k8sutil .HeadlessServiceDetails (deploymentName )
191195
192- // todo
193- /* if spec.IsGatewayEnabled() {
194- // set headlessSelector to point to gateway
195- }*/
196-
197196if s , exists := cachedStatus .Service ().V1 ().GetSimple (k8sutil .CreateHeadlessServiceName (deploymentName )); ! exists {
198197ctxChild , cancel := globals .GetGlobalTimeouts ().Kubernetes ().WithTimeout (ctx )
199198defer cancel ()
@@ -261,7 +260,6 @@ func (r *Resources) EnsureServices(ctx context.Context, cachedStatus inspectorIn
261260return errors .WithStack (err )
262261}
263262
264- //todo
265263if r .context .IsSyncEnabled () {
266264// External (and internal) Sync master service
267265counterMetric .Inc ()
0 commit comments