Skip to content

Commit

Permalink
check if opensearch plugin exists before removing
Browse files Browse the repository at this point in the history
Signed-off-by: Yulong Ruan <[email protected]>
  • Loading branch information
ruanyl committed Dec 25, 2024
1 parent 704bc9d commit 09b7496
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion charts/opensearch-dashboards/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ spec:
#!/usr/bin/bash
set -e
{{- range $plugin := .Values.plugins.removeList }}
./bin/opensearch-dashboards-plugin remove {{ $plugin }}
if ./bin/opensearch-dashboards-plugin list | grep -q {{ $plugin }}; then
./bin/opensearch-dashboards-plugin remove {{ $plugin }}
fi
{{- end }}
{{- range $plugin := .Values.plugins.installList }}
./bin/opensearch-dashboards-plugin install {{ $plugin }}
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ plugins:
installList: []
# - example-fake-plugin-downloadable-url
removeList: []
# - securityDashboards
# - examplePluginName

# ServiceMonitor Configuration for Prometheus
# Enabling this option will create a ServiceMonitor resource that allows Prometheus to scrape metrics from the OpenSearch service.
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ plugins:
installList: []
# - example-fake-plugin
removeList: []
# - opensearch-ml
# - example-fake-plugin

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

0 comments on commit 09b7496

Please sign in to comment.