Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add plugins.removeList to allow remove plugins #526

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions charts/opensearch-dashboards/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [2.26.0]
### Added
- Added plugins.removeList to allow remove plugins
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [2.25.0]
### Added
- Updated OpenSearch Dashboards appVersion to 2.18.0
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.25.0
version: 2.26.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
5 changes: 5 additions & 0 deletions charts/opensearch-dashboards/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ spec:
- |
#!/usr/bin/bash
set -e
{{- range $plugin := .Values.plugins.removeList }}
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 }}
{{- 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: []
# - 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
9 changes: 9 additions & 0 deletions charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [2.29.0]
### Added
- Added plugins.removeList to allow remove plugins
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [2.28.0]
### Added
### Changed
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.28.0
version: 2.29.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a different behavior b/w os and osd plugin removal?
Is it necessary to do a check before OS removal but not OSD?

Copy link
Member Author

@ruanyl ruanyl Dec 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, we should check if the plugin installed before remove it for both OS and OSD, now the PR is updated.

./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: []
# - example-fake-plugin

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