From 1fad355526790f57c9b58bd775a5cf4072055a7e Mon Sep 17 00:00:00 2001 From: medcl Date: Thu, 2 Aug 2018 11:42:58 +0800 Subject: [PATCH] dirty fix for es v6, Closes #15 --- main.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index afa134b..99e05ae 100644 --- a/main.go +++ b/main.go @@ -72,7 +72,14 @@ func main() { if errs != nil { return } - if strings.HasPrefix(srcESVersion.Version.Number, "5.") { + if strings.HasPrefix(srcESVersion.Version.Number, "6.") { + log.Debug("source es is V6,", srcESVersion.Version.Number) + api := new(ESAPIV5) + api.Host = c.SourceEs + api.Auth = migrator.SourceAuth + api.HttpProxy=migrator.Config.SourceProxy + migrator.SourceESAPI = api + } else if strings.HasPrefix(srcESVersion.Version.Number, "5.") { log.Debug("source es is V5,", srcESVersion.Version.Number) api := new(ESAPIV5) api.Host = c.SourceEs @@ -188,7 +195,14 @@ func main() { return } - if strings.HasPrefix(descESVersion.Version.Number, "5.") { + if strings.HasPrefix(descESVersion.Version.Number, "6.") { + log.Debug("target es is V6,", descESVersion.Version.Number) + api := new(ESAPIV5) + api.Host = c.TargetEs + api.Auth = migrator.TargetAuth + api.HttpProxy=migrator.Config.TargetProxy + migrator.TargetESAPI = api + }else if strings.HasPrefix(descESVersion.Version.Number, "5.") { log.Debug("target es is V5,", descESVersion.Version.Number) api := new(ESAPIV5) api.Host = c.TargetEs