Skip to content

Commit

Permalink
Diff plugin assume lakefs on localhost when no interface is specified (
Browse files Browse the repository at this point in the history
…#6018)

When lakeFS is configured to listen on `:port` assume plugin endpoing
should point to `locahost:port`.
  • Loading branch information
nopcoder committed Jun 4, 2023
1 parent e4ff978 commit d313b61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/api/controller.go
Expand Up @@ -4423,6 +4423,12 @@ func (c *Controller) OtfDiff(w http.ResponseWriter, r *http.Request, repository,
return
}

listenAddress := c.Config.ListenAddress
if strings.HasPrefix(listenAddress, ":") {
// workaround in case we listen on all interfaces without specifying ip
listenAddress = fmt.Sprintf("localhost%s", listenAddress)
}

tdp := tablediff.Params{
// TODO(jonathan): add base RefPath
TablePaths: tablediff.TablePaths{
Expand All @@ -4438,7 +4444,7 @@ func (c *Controller) OtfDiff(w http.ResponseWriter, r *http.Request, repository,
S3Creds: tablediff.S3Creds{
Key: config.SecureString(baseCredential.AccessKeyID),
Secret: config.SecureString(baseCredential.SecretAccessKey),
Endpoint: fmt.Sprintf("http://%s", c.Config.ListenAddress),
Endpoint: "http://" + listenAddress,
},
Repo: repository,
}
Expand Down

0 comments on commit d313b61

Please sign in to comment.