Skip to content
Snippets Groups Projects
Commit f30dce94 authored by thijsheijden's avatar thijsheijden
Browse files

Added arango host as env var

parent 260a103f
No related branches found
No related tags found
No related merge requests found
...@@ -42,5 +42,7 @@ spec: ...@@ -42,5 +42,7 @@ spec:
valueFrom: valueFrom:
fieldRef: fieldRef:
fieldPath: metadata.name fieldPath: metadata.name
- name: ARANGO_HOST
value: http://arangodb:8529
imagePullSecrets: imagePullSecrets:
- name: docker-regcred - name: docker-regcred
\ No newline at end of file
...@@ -22,5 +22,7 @@ spec: ...@@ -22,5 +22,7 @@ spec:
value: redis:6379 value: redis:6379
- name: LOG_MESSAGES - name: LOG_MESSAGES
value: "true" value: "true"
- name: ARANGO_HOST
value: http://arangodb.default.svc.cluster.local:852
imagePullSecrets: imagePullSecrets:
- name: docker-regcred - name: docker-regcred
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"log" "log"
"os"
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
...@@ -26,9 +27,11 @@ Return: a map with two entries: "nodes" with a list of vertices/nodes and "edges ...@@ -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 that will be returned to the frontend
*/ */
func (s *Service) SendAQLQuery(AQLQuery string) (*map[string][]Document, error) { 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) var queryResult = make(map[string][]Document)
conn, err := http.NewConnection(http.ConnectionConfig{ conn, err := http.NewConnection(http.ConnectionConfig{
Endpoints: []string{"http://arangodb:8529"}, Endpoints: []string{arangoURL},
TLSConfig: &tls.Config{InsecureSkipVerify: true}, TLSConfig: &tls.Config{InsecureSkipVerify: true},
}) })
if err != nil { if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment