Skip to content

Commit

Permalink
Merge pull request #76 from vshn/Opensearch_connection_string
Browse files Browse the repository at this point in the history
Add 2 new fields in connection secret
  • Loading branch information
wejdross authored Dec 23, 2022
2 parents 5c73631 + 7afc662 commit df97af8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions operator/opensearchcontroller/observe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit df97af8

Please sign in to comment.