mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
fix es version logic
This commit is contained in:
@@ -113,7 +113,7 @@ update_docker_containers() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# all the containers using ELASTICSEARCHDEFAULTS.elasticsearch.version
|
# all the containers using ELASTICSEARCHDEFAULTS.elasticsearch.version
|
||||||
local CONTAINERS_USING_ES_VERSION=("so-elastic-fleet-package-registry","so-elastic-agent","so-kibana","so-logstash","so-elasticsearch")
|
local CONTAINERS_USING_ES_VERSION=("so-elastic-fleet-package-registry" "so-elastic-agent" "so-kibana" "so-logstash" "so-elasticsearch")
|
||||||
|
|
||||||
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
rm -rf $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
mkdir -p $SIGNPATH >> "$LOG_FILE" 2>&1
|
||||||
@@ -143,15 +143,15 @@ update_docker_containers() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# use version defined in elasticsearch defaults.yaml if an es container
|
# use version defined in elasticsearch defaults.yaml if an es container
|
||||||
if [[ ${CONTAINERS_USING_ES_VERSION[*]} =~ (^|[[:space:]])"$i"($|[[:space:]]) ]]; then
|
if [[ " ${CONTAINERS_USING_ES_VERSION[*]} " =~ [[:space:]]${i}[[:space:]] ]]; then
|
||||||
local UPDATE_DIR='/tmp/sogh/securityonion'
|
local UPDATE_DIR='/tmp/sogh/securityonion'
|
||||||
local v1=0
|
local v1=0
|
||||||
local v2=0
|
local v2=0
|
||||||
if [[ -f "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" ]]; then
|
if [[ -f "$UPDATE_DIR/salt/elasticsearch/defaults.yaml" ]]; then
|
||||||
v1=$(egrep " +version: " "$UPDATE_DIR/salt/elasticsearch.defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
v1=$(egrep " +version: " "$UPDATE_DIR/salt/elasticsearch/defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
||||||
fi
|
fi
|
||||||
if [[ -f "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml" ]]; then
|
if [[ -f "$DEFAULT_SALT_DIR/salt/elasticsearch/defaults.yaml" ]]; then
|
||||||
v2=$(egrep " +version: " "$DEFAULT_SALT_DIR/salt/elasticsearch.defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
v2=$(egrep " +version: " "$DEFAULT_SALT_DIR/salt/elasticsearch/defaults.yaml" | awk -F: '{print $2}' | tr -d '[:space:]')
|
||||||
fi
|
fi
|
||||||
local highest_es_version=$(compare_es_versions "$v1" "$v2")
|
local highest_es_version=$(compare_es_versions "$v1" "$v2")
|
||||||
local image=$i:$highest_es_version$IMAGE_TAG_SUFFIX
|
local image=$i:$highest_es_version$IMAGE_TAG_SUFFIX
|
||||||
|
|||||||
Reference in New Issue
Block a user