diff --git a/opensearch-operator/pkg/builders/cluster.go b/opensearch-operator/pkg/builders/cluster.go index 0c5c2f76..1fe9c615 100644 --- a/opensearch-operator/pkg/builders/cluster.go +++ b/opensearch-operator/pkg/builders/cluster.go @@ -420,11 +420,13 @@ func NewSTSForNodePool( #!/usr/bin/env bash set -euo pipefail - /usr/share/opensearch/bin/opensearch-keystore create + if [ ! -f /usr/share/opensearch/config/opensearch.keystore ]; then + /usr/share/opensearch/bin/opensearch-keystore create + fi for i in /tmp/keystoreSecrets/*/*; do key=$(basename $i) echo "Adding file $i to keystore key $key" - /usr/share/opensearch/bin/opensearch-keystore add-file "$key" "$i" + /usr/share/opensearch/bin/opensearch-keystore add-file "$key" "$i" --force done # Add the bootstrap password since otherwise the opensearch entrypoint tries to do this on startup @@ -935,11 +937,13 @@ func NewBootstrapPod( #!/usr/bin/env bash set -euo pipefail - /usr/share/opensearch/bin/opensearch-keystore create + if [ ! -f /usr/share/opensearch/config/opensearch.keystore ]; then + /usr/share/opensearch/bin/opensearch-keystore create + fi for i in /tmp/keystoreSecrets/*/*; do key=$(basename $i) echo "Adding file $i to keystore key $key" - /usr/share/opensearch/bin/opensearch-keystore add-file "$key" "$i" + /usr/share/opensearch/bin/opensearch-keystore add-file "$key" "$i" --force done # Add the bootstrap password since otherwise the opensearch entrypoint tries to do this on startup