From 7afc662d901881e30b3acf88d03c642612c2b235 Mon Sep 17 00:00:00 2001 From: wejdross Date: Thu, 22 Dec 2022 11:45:21 +0100 Subject: [PATCH] Add 2 new fields in connection secret --- operator/opensearchcontroller/observe.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/operator/opensearchcontroller/observe.go b/operator/opensearchcontroller/observe.go index e744d4f6..529e05fc 100644 --- a/operator/opensearchcontroller/observe.go +++ b/operator/opensearchcontroller/observe.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" exoscaleapi "github.com/exoscale/egoscale/v2/api" @@ -73,9 +74,13 @@ func (p *pipeline) Observe(ctx context.Context, mg resource.Managed) (managed.Ex } func connectionDetails(in oapi.DbaasServiceOpensearch) (managed.ConnectionDetails, error) { + uriParams := *in.UriParams + return map[string][]byte{ "OPENSEARCH_USER": []byte(*in.ConnectionInfo.Username), "OPENSEARCH_PASSWORD": []byte(*in.ConnectionInfo.Password), + "OPENSEARCH_HOST": []byte(uriParams["host"].(string)), + "OPENSEARCH_PORT": []byte(uriParams["port"].(string)), "OPENSEARCH_URI": []byte(*in.Uri), "OPENSEARCH_DASHBOARD_URI": []byte(*in.ConnectionInfo.DashboardUri), }, nil