From 74706b88d4331677128b33c2396dabd1b68ff9cb Mon Sep 17 00:00:00 2001 From: Yulong Ruan Date: Fri, 3 Jan 2025 05:35:09 +0800 Subject: [PATCH] add plugins.removeList to allow remove plugins (#526) * add plugins.removeList to allow remove plugins resolved #383 Signed-off-by: Yulong Ruan * check if opensearch plugin exists before removing Signed-off-by: Yulong Ruan * bump version and add changelog Signed-off-by: Yulong Ruan * update changelog Signed-off-by: Yulong Ruan * Update version Signed-off-by: Peter Zhu * Update charts version Signed-off-by: Peter Zhu --------- Signed-off-by: Yulong Ruan Signed-off-by: Peter Zhu Co-authored-by: Peter Zhu --- charts/opensearch-dashboards/CHANGELOG.md | 12 +++++++++++- charts/opensearch-dashboards/Chart.yaml | 2 +- .../templates/deployment.yaml | 5 +++++ charts/opensearch-dashboards/values.yaml | 2 ++ charts/opensearch/CHANGELOG.md | 14 ++++++++++++-- charts/opensearch/Chart.yaml | 2 +- charts/opensearch/templates/statefulset.yaml | 6 ++++++ charts/opensearch/values.yaml | 2 ++ 8 files changed, 40 insertions(+), 5 deletions(-) diff --git a/charts/opensearch-dashboards/CHANGELOG.md b/charts/opensearch-dashboards/CHANGELOG.md index 24698f59..3da69ee6 100644 --- a/charts/opensearch-dashboards/CHANGELOG.md +++ b/charts/opensearch-dashboards/CHANGELOG.md @@ -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 @@ -430,7 +439,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security -[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.25.0...HEAD +[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.26.0...HEAD +[2.26.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.25.0...opensearch-dashboards-2.26.0 [2.25.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.24.1...opensearch-dashboards-2.25.0 [2.24.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.24.0...opensearch-dashboards-2.24.1 [2.24.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-2.23.0...opensearch-dashboards-2.24.0 diff --git a/charts/opensearch-dashboards/Chart.yaml b/charts/opensearch-dashboards/Chart.yaml index 0e85909d..680a250d 100644 --- a/charts/opensearch-dashboards/Chart.yaml +++ b/charts/opensearch-dashboards/Chart.yaml @@ -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 diff --git a/charts/opensearch-dashboards/templates/deployment.yaml b/charts/opensearch-dashboards/templates/deployment.yaml index 256cf054..4ca92af3 100644 --- a/charts/opensearch-dashboards/templates/deployment.yaml +++ b/charts/opensearch-dashboards/templates/deployment.yaml @@ -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 }} diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index d461a6e2..922c1c54 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -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. diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index 1f0fcc96..89c63825 100644 --- a/charts/opensearch/CHANGELOG.md +++ b/charts/opensearch/CHANGELOG.md @@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security --- +## [2.30.0] +### Added +- Added plugins.removeList to allow remove plugins +### Changed +### Deprecated +### Removed +### Fixed +### Security +--- ## [2.29.0] ### Added - Ability to set a basic auth configuration to the `serviceMonitor` @@ -548,9 +557,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security -[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.29.0...HEAD +[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.30.0...HEAD +[2.29.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.29.0...opensearch-2.30.0 [2.29.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.28.0...opensearch-2.29.0 -[2.28.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.27.0...opensearch-2.28.0 +[2.28.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.27.1...opensearch-2.28.0 [2.27.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.27.0...opensearch-2.27.1 [2.27.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.26.1...opensearch-2.27.0 [2.26.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-2.26.0...opensearch-2.26.1 diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index 9115d5fb..809a7cff 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/Chart.yaml @@ -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.29.0 +version: 2.30.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 diff --git a/charts/opensearch/templates/statefulset.yaml b/charts/opensearch/templates/statefulset.yaml index 3ce437fc..d87e4724 100644 --- a/charts/opensearch/templates/statefulset.yaml +++ b/charts/opensearch/templates/statefulset.yaml @@ -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 }} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 7dd00542..76373736 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -491,6 +491,8 @@ plugins: enabled: false installList: [] # - example-fake-plugin + removeList: [] + # - example-fake-plugin # -- Array of extra K8s manifests to deploy extraObjects: []