diff --git a/deployments/deployment.yml b/deployments/deployment.yml index 39d666a35a604a03a10ae98a594b13b2e40d5460..65a3b9aadd02d88278462daaa58e6b76c0675a2d 100644 --- a/deployments/deployment.yml +++ b/deployments/deployment.yml @@ -42,5 +42,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name + - name: ARANGO_HOST + value: http://arangodb:8529 imagePullSecrets: - name: docker-regcred \ No newline at end of file diff --git a/integration-testing/pod.yml b/integration-testing/pod.yml index e861b7e5a7fc3bc40c281218643de4b73edc88f5..99d85e18bbcb3bbb92237512c05543f446328e6e 100644 --- a/integration-testing/pod.yml +++ b/integration-testing/pod.yml @@ -22,5 +22,7 @@ spec: value: redis:6379 - name: LOG_MESSAGES value: "true" + - name: ARANGO_HOST + value: http://arangodb.default.svc.cluster.local:852 imagePullSecrets: - name: docker-regcred diff --git a/internal/usecases/request/request.go b/internal/usecases/request/request.go index 429e5eb8c1bd8340b3eedc5af9d2c610fff069f5..42f961f8aa89c2727e9f28b4d543f0fbcd43a176 100644 --- a/internal/usecases/request/request.go +++ b/internal/usecases/request/request.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "fmt" "log" + "os" "encoding/json" "io/ioutil" @@ -26,9 +27,11 @@ Return: a map with two entries: "nodes" with a list of vertices/nodes and "edges that will be returned to the frontend */ func (s *Service) SendAQLQuery(AQLQuery string) (*map[string][]Document, error) { + // Get ArangoDB url from environment variable + arangoURL := os.Getenv("ARANGO_HOST") var queryResult = make(map[string][]Document) conn, err := http.NewConnection(http.ConnectionConfig{ - Endpoints: []string{"http://arangodb:8529"}, + Endpoints: []string{arangoURL}, TLSConfig: &tls.Config{InsecureSkipVerify: true}, }) if err != nil {