Skip to content

Commit 97ded84

Browse files
authored
Merge pull request #11553 from 2403905/issues/OCISDEV-219
fix: [OCISDEV-219] fixed the search readyz endpoint
2 parents 99fe69c + bae98b7 commit 97ded84

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

services/antivirus/pkg/server/debug/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"net/http"
7+
"net/url"
78

89
"github.com/dutchcoders/go-clamd"
910

@@ -28,7 +29,11 @@ func Server(opts ...Option) (*http.Server, error) {
2829
case "clamav":
2930
return clamd.NewClamd(cfg.Scanner.ClamAV.Socket).Ping()
3031
case "icap":
31-
return checks.NewTCPCheck(cfg.Scanner.ICAP.URL)(ctx)
32+
u, err := url.Parse(cfg.Scanner.ICAP.URL)
33+
if err != nil {
34+
return err
35+
}
36+
return checks.NewTCPCheck(u.Host)(ctx)
3237
}
3338
})
3439

services/graph/pkg/server/debug/server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package debug
22

33
import (
44
"net/http"
5+
"net/url"
56

67
"github.com/owncloud/ocis/v2/ocis-pkg/checks"
78
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -17,9 +18,14 @@ func Server(opts ...Option) (*http.Server, error) {
1718
WithLogger(options.Logger).
1819
WithCheck("web reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr))
1920

21+
u, err := url.Parse(options.Config.Identity.LDAP.URI)
22+
if err != nil {
23+
return nil, err
24+
}
25+
2026
readyHandlerConfiguration := healthHandlerConfiguration.
2127
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Endpoint)).
22-
WithCheck("ldap reachability", checks.NewTCPCheck(options.Config.Identity.LDAP.URI))
28+
WithCheck("ldap reachability", checks.NewTCPCheck(u.Host))
2329

2430
return debug.NewService(
2531
debug.Logger(options.Logger),

services/idp/pkg/server/debug/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package debug
22

33
import (
44
"net/http"
5+
"net/url"
56

67
"github.com/owncloud/ocis/v2/ocis-pkg/checks"
78
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -17,8 +18,12 @@ func Server(opts ...Option) (*http.Server, error) {
1718
WithLogger(options.Logger).
1819
WithCheck("http reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr))
1920

21+
u, err := url.Parse(options.Config.Ldap.URI)
22+
if err != nil {
23+
return nil, err
24+
}
2025
readyHandlerConfiguration := healthHandlerConfiguration.
21-
WithCheck("ldap reachability", checks.NewTCPCheck(options.Config.Ldap.URI))
26+
WithCheck("ldap reachability", checks.NewTCPCheck(u.Host))
2227

2328
return debug.NewService(
2429
debug.Logger(options.Logger),

services/search/pkg/server/debug/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package debug
33
import (
44
"context"
55
"net/http"
6+
"net/url"
67

78
"github.com/owncloud/ocis/v2/ocis-pkg/checks"
89
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
@@ -22,7 +23,11 @@ func Server(opts ...Option) (*http.Server, error) {
2223
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Endpoint)).
2324
WithCheck("tika-check", func(ctx context.Context) error {
2425
if options.Config.Extractor.Type == "tika" {
25-
return checks.NewTCPCheck(options.Config.Extractor.Tika.TikaURL)(ctx)
26+
u, err := url.Parse(options.Config.Extractor.Tika.TikaURL)
27+
if err != nil {
28+
return err
29+
}
30+
return checks.NewTCPCheck(u.Host)(ctx)
2631
}
2732
return nil
2833
})

0 commit comments

Comments
 (0)