mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
notify: Webhook endpoints can fail, but we must start the server. (#4060)
Ignore any network errors when registering a webhook notifier during Minio startup sequence. This way server can be started even if the webhook endpoint is not available and unreachable.
This commit is contained in:
18
cmd/utils.go
18
cmd/utils.go
@@ -110,24 +110,6 @@ const (
|
||||
httpsScheme = "https"
|
||||
)
|
||||
|
||||
var portMap = map[string]string{
|
||||
httpScheme: "80",
|
||||
httpsScheme: "443",
|
||||
}
|
||||
|
||||
// Given a string of the form "host", "host:port", or "[ipv6::address]:port",
|
||||
// return true if the string includes a port.
|
||||
func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") }
|
||||
|
||||
// canonicalAddr returns url.Host but always with a ":port" suffix
|
||||
func canonicalAddr(u *url.URL) string {
|
||||
addr := u.Host
|
||||
if !hasPort(addr) {
|
||||
return addr + ":" + portMap[u.Scheme]
|
||||
}
|
||||
return addr
|
||||
}
|
||||
|
||||
// checkDuplicates - function to validate if there are duplicates in a slice of endPoints.
|
||||
func checkDuplicateEndpoints(endpoints []*url.URL) error {
|
||||
var strs []string
|
||||
|
||||
Reference in New Issue
Block a user