Skip to content

Commit

Permalink
fix: add opensearch relationship generation (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Aug 30, 2023
1 parent 3df7f44 commit 33577d4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ project_files:
- platformsh/generate_db_relationship.sh
- platformsh/generate_elasticsearch_relationship.sh
- platformsh/generate_memcached_relationship.sh
- platformsh/generate_opensearch_relationship.sh
- platformsh/generate_redis_relationship.sh
- platformsh/generate_redis-persistent_relationship.sh
- platformsh/generate_route.sh
Expand Down Expand Up @@ -185,7 +186,7 @@ post_install_actions:
{{ $supported_db_types := list "postgres" "mysql" "mariadb" }}
{{/* For supported services, key is the service name and value is the corresponding add-on to install if applicable (nil if not needed) */}}
{{ $supported_services := dict "redis" "ddev/ddev-redis" "redis-persistent" "ddev/ddev-redis" "memcached" "ddev/ddev-memcached" "elasticsearch" "ddev/ddev-elasticsearch" }}
{{ $supported_services := dict "redis" "ddev/ddev-redis" "redis-persistent" "ddev/ddev-redis" "memcached" "ddev/ddev-memcached" "elasticsearch" "ddev/ddev-elasticsearch" "opensearch" "ddev/ddev-elasticsearch" }}
{{ if $supported_db_types | has $service_def.type }}
{{/* Databases */}}
Expand Down
30 changes: 30 additions & 0 deletions platformsh/generate_opensearch_relationship.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

#ddev-generated

export relationshipname=$1

read -r -d '' search_stanza <<SEARCH_EOF
"${relationshipname}": [
{
"username": null,
"scheme": "http",
"service": "search",
"fragment": null,
"ip": "255.255.255.255",
"hostname": "elasticsearch",
"public": false,
"cluster": "ddev-dummy-cluster",
"host": "elasticsearch",
"rel": "elasticsearch",
"query": {},
"path": null,
"password": null,
"type": "elasticsearch:7.5",
"port": 9200,
"host_mapped": false
}
]
SEARCH_EOF

printf "$search_stanza"

0 comments on commit 33577d4

Please sign in to comment.