Skip to content

Commit b4225aa

Browse files
author
lamai93
committed
Support older versions of arangodb.
1 parent afb2bc2 commit b4225aa

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

pkg/deployment/resources/pod_creator.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,28 @@ func (r *Resources) createReadinessProbe(spec api.DeploymentSpec, group api.Serv
369369
}
370370
}
371371
probeCfg := &k8sutil.HTTPProbeConfig{
372-
LocalPath: "/_admin/server/availability",
372+
LocalPath: "/_api/version",
373373
Secure: spec.IsSecure(),
374374
Authorization: authorization,
375375
InitialDelaySeconds: 2,
376376
PeriodSeconds: 2,
377377
}
378+
switch spec.GetMode() {
379+
case api.DeploymentModeActiveFailover:
380+
probeCfg.LocalPath = "/_admin/echo"
381+
}
382+
383+
status, _ := r.context.GetStatus()
384+
currentImage := status.CurrentImage
385+
if currentImage == nil {
386+
return nil, fmt.Errorf("CurrentImage is nil when creating a pod")
387+
}
388+
389+
// /_admin/server/availability is the way to go, it is available since 3.3.9
390+
if currentImage.ArangoDBVersion.CompareTo("3.3.9") >= 0 {
391+
probeCfg.LocalPath = "/_admin/server/availability"
392+
}
393+
378394
return probeCfg, nil
379395
}
380396

0 commit comments

Comments
 (0)