Skip to content

Commit

Permalink
dirty fix for es v6, Closes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
medcl committed Aug 2, 2018
1 parent 7698d36 commit 1fad355
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1fad355

Please sign in to comment.