@@ -348,7 +348,7 @@ func (r *Resources) createLivenessProbe(spec api.DeploymentSpec, group api.Serve
348348 if err != nil {
349349 return nil , maskAny (err )
350350 }
351- authorization , err = jwt .CreateArangodJwtAuthorizationHeader (secretData , "kube-arangodb" )
351+ authorization , err = jwt .CreateArangodJwtAuthorizationHeaderAllowedPaths (secretData , "kube-arangodb" , [] string { "/_api/version" } )
352352 if err != nil {
353353 return nil , maskAny (err )
354354 }
@@ -382,7 +382,7 @@ func (r *Resources) createLivenessProbe(spec api.DeploymentSpec, group api.Serve
382382 if err != nil {
383383 return nil , maskAny (err )
384384 }
385- authorization , err = jwt .CreateArangodJwtAuthorizationHeader (secretData , "kube-arangodb" )
385+ authorization , err = jwt .CreateArangodJwtAuthorizationHeaderAllowedPaths (secretData , "kube-arangodb" , [] string { "/_api/version" } )
386386 if err != nil {
387387 return nil , maskAny (err )
388388 }
@@ -416,33 +416,35 @@ func (r *Resources) createReadinessProbe(spec api.DeploymentSpec, group api.Serv
416416 return nil , nil
417417 }
418418
419+ localPath := "/_api/version"
420+ switch spec .GetMode () {
421+ case api .DeploymentModeActiveFailover :
422+ localPath = "/_admin/echo"
423+ }
424+
425+ // /_admin/server/availability is the way to go, it is available since 3.3.9
426+ if version .CompareTo ("3.3.9" ) >= 0 {
427+ localPath = "/_admin/server/availability"
428+ }
429+
419430 authorization := ""
420431 if spec .IsAuthenticated () {
421432 secretData , err := r .getJWTSecret (spec )
422433 if err != nil {
423434 return nil , maskAny (err )
424435 }
425- authorization , err = jwt .CreateArangodJwtAuthorizationHeader (secretData , "kube-arangodb" )
436+ authorization , err = jwt .CreateArangodJwtAuthorizationHeaderAllowedPaths (secretData , "kube-arangodb" , [] string { localPath } )
426437 if err != nil {
427438 return nil , maskAny (err )
428439 }
429440 }
430441 probeCfg := & k8sutil.HTTPProbeConfig {
431- LocalPath : "/_api/version" ,
442+ LocalPath : localPath ,
432443 Secure : spec .IsSecure (),
433444 Authorization : authorization ,
434445 InitialDelaySeconds : 2 ,
435446 PeriodSeconds : 2 ,
436447 }
437- switch spec .GetMode () {
438- case api .DeploymentModeActiveFailover :
439- probeCfg .LocalPath = "/_admin/echo"
440- }
441-
442- // /_admin/server/availability is the way to go, it is available since 3.3.9
443- if version .CompareTo ("3.3.9" ) >= 0 {
444- probeCfg .LocalPath = "/_admin/server/availability"
445- }
446448
447449 return probeCfg , nil
448450}
0 commit comments