Skip to content

Commit

Permalink
fix: update envs
Browse files Browse the repository at this point in the history
  • Loading branch information
artaasadi committed Dec 18, 2024
1 parent 834179c commit 7e21fa2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions services/tasks/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ import (
"strconv"
)

var (
ESAddress = os.Getenv("ELASTICSEARCH_ADDRESS")
ESUsername = os.Getenv("ELASTICSEARCH_USERNAME")
ESPassword = os.Getenv("ELASTICSEARCH_PASSWORD")
ESIsOnAks = os.Getenv("ELASTICSEARCH_ISONAKS")
)

func CreateWorker(ctx context.Context, cfg config.Config, kubeClient client.Client, taskConfig *Task, namespace string) error {
soNatsUrl, _ := os.LookupEnv("SCALED_OBJECT_NATS_URL")

Expand Down Expand Up @@ -155,31 +162,31 @@ func defaultEnvs(cfg config.Config, taskConfig *Task) []corev1.EnvVar {
},
{
Name: consts.ElasticSearchAddressEnv,
Value: cfg.ElasticSearch.Address,
Value: ESAddress,
},
{
Name: consts.ElasticSearchUsernameEnv,
Value: cfg.ElasticSearch.Username,
Value: ESUsername,
},
{
Name: consts.ElasticSearchPasswordEnv,
Value: cfg.ElasticSearch.Password,
Value: ESPassword,
},
{
Name: consts.ElasticSearchIsOnAksNameEnv,
Value: strconv.FormatBool(cfg.ElasticSearch.IsOnAks),
Value: ESIsOnAks,
},
{
Name: consts.ElasticSearchIsOpenSearch,
Value: strconv.FormatBool(cfg.ElasticSearch.IsOpenSearch),
},
{
Name: consts.ElasticSearchAwsRegionEnv,
Value: cfg.ElasticSearch.AwsRegion,
Value: "",
},
{
Name: consts.ElasticSearchAssumeRoleArnEnv,
Value: cfg.ElasticSearch.AssumeRoleArn,
Value: "",
},
}
}

0 comments on commit 7e21fa2

Please sign in to comment.