Skip to content

Commit

Permalink
add plugins.removeList to allow remove plugins
Browse files Browse the repository at this point in the history
resolved opensearch-project#383

Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Dec 23, 2024
1 parent 61d7961 commit 704bc9d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/opensearch-dashboards/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ spec:
- |
#!/usr/bin/bash
set -e
{{- range $plugin := .Values.plugins.removeList }}
./bin/opensearch-dashboards-plugin remove {{ $plugin }}
{{- end }}
{{- range $plugin := .Values.plugins.installList }}
./bin/opensearch-dashboards-plugin install {{ $plugin }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ plugins:
enabled: false
installList: []
# - example-fake-plugin-downloadable-url
removeList: []
# - securityDashboards

# ServiceMonitor Configuration for Prometheus
# Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service.
Expand Down
6 changes: 6 additions & 0 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ spec:
#!/usr/bin/env bash
set -euo pipefail
{{- range $plugin := .Values.plugins.removeList }}
if ./bin/opensearch-plugin list | grep -q {{ $plugin }}; then
./bin/opensearch-plugin remove {{ $plugin }}
fi
{{- end }}
{{- range $plugin := .Values.plugins.installList }}
./bin/opensearch-plugin install -b {{ $plugin }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ plugins:
enabled: false
installList: []
# - example-fake-plugin
removeList: []
# - opensearch-ml

# -- Array of extra K8s manifests to deploy
extraObjects: []
Expand Down

0 comments on commit 704bc9d

Please sign in to comment.