Skip to content

Commit

Permalink
fix part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoelMilchev committed Sep 26, 2022
1 parent be98d5a commit ae28641
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/content-rw-elasticsearch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func main() {
log := logger.NewUPPLogger(*appSystemCode, *logLevel)
log.Info("[Startup] Application is starting")
credValues := credentials.Value{}
if *esEndpoint != defaultESEndpoint {
if *esEndpoint != defaultESEndpoint && *esEndpoint != "http://es:9200" {
awsSession, sessionErr := session.NewSession()
if sessionErr != nil {
log.WithError(sessionErr).Fatal("Failed to initialize AWS session")
Expand All @@ -118,13 +118,20 @@ func main() {

app.Action = func() {
accessConfig := es.AccessConfig{}
if *esEndpoint != defaultESEndpoint {
if *esEndpoint != defaultESEndpoint && *esEndpoint != "http://es:9200" {
accessConfig = es.AccessConfig{
AccessKey: credValues.AccessKeyID,
SecretKey: credValues.SecretAccessKey,
SessionToken: credValues.SessionToken,
Endpoint: *esEndpoint,
}
} else {
log.Info("Setting default testing config")
accessConfig = es.AccessConfig{
AccessKey: "",
SecretKey: "",
Endpoint: *esEndpoint,
}
}

httpClient := pkghttp.NewHTTPClient()
Expand Down

0 comments on commit ae28641

Please sign in to comment.