mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-12-03 00:56:13 +01:00
revert so-image-pull and so-tcpreplay to 3/dev
Drop the embedded-registry shortcut from both scripts so they match 3/dev byte for byte, and delete the three so-image-common helpers that only those shortcuts used.
This commit is contained in:
3 files changed
+7
-44
No files matched your search
@@ -86,34 +86,6 @@ registry_host() {
|
||||
printf '%s' "$HOSTNAME"
|
||||
}
|
||||
|
||||
local_registry_image_present() {
|
||||
local image_name=$1
|
||||
local image_tag=$2
|
||||
local host
|
||||
host=$(registry_host)
|
||||
docker images --format '{{.Repository}}:{{.Tag}}' | grep -qx "${host}:5000/${IMAGEREPO}/${image_name}:${image_tag}"
|
||||
}
|
||||
|
||||
registry_has_image() {
|
||||
local image_name=$1
|
||||
local image_tag=$2
|
||||
local host
|
||||
host=$(registry_host)
|
||||
|
||||
curl -sk --fail --max-time 10 \
|
||||
-H "Accept: application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.index.v1+json" \
|
||||
-o /dev/null \
|
||||
"https://${host}:5000/v2/${IMAGEREPO}/${image_name}/manifests/${image_tag}"
|
||||
}
|
||||
|
||||
pull_from_embedded_registry() {
|
||||
local image_name=$1
|
||||
local image_tag=$2
|
||||
local host
|
||||
host=$(registry_host)
|
||||
docker pull "${host}:5000/${IMAGEREPO}/${image_name}:${image_tag}"
|
||||
}
|
||||
|
||||
manifest_blob_digests() {
|
||||
jq -r '(.config.digest // empty), (.layers[]? | .digest)' "$1"
|
||||
}
|
||||
|
||||
@@ -38,20 +38,13 @@ TRUSTED_CONTAINERS=("$@")
|
||||
set_version
|
||||
|
||||
for image in "${TRUSTED_CONTAINERS[@]}"; do
|
||||
if local_registry_image_present "$image" "$VERSION"; then
|
||||
echo "$image:$VERSION image exists."
|
||||
continue
|
||||
fi
|
||||
if registry_has_image "$image" "$VERSION"; then
|
||||
if ! docker images | grep "$image" | grep ":5000" | grep -q "$VERSION"; then
|
||||
if [[ $quiet == true ]]; then
|
||||
pull_from_embedded_registry "$image" "$VERSION" >/dev/null && continue
|
||||
update_docker_containers "$image" "" "" "/dev/null"
|
||||
else
|
||||
pull_from_embedded_registry "$image" "$VERSION" && continue
|
||||
update_docker_containers "$image" "" "" ""
|
||||
fi
|
||||
fi
|
||||
if [[ $quiet == true ]]; then
|
||||
update_docker_containers "$image" "" "" "/dev/null"
|
||||
else
|
||||
update_docker_containers "$image" "" "" ""
|
||||
echo "$image:$VERSION image exists."
|
||||
fi
|
||||
done
|
||||
@@ -39,15 +39,13 @@ if ! docker ps | grep -q so-tcpreplay; then
|
||||
|
||||
if is_manager_node; then
|
||||
set_version
|
||||
if local_registry_image_present so-tcpreplay "$VERSION" ; then
|
||||
echo "so-tcpreplay image exists."
|
||||
elif registry_has_image so-tcpreplay "$VERSION" && pull_from_embedded_registry so-tcpreplay "$VERSION" ; then
|
||||
echo "Loaded so-tcpreplay image from embedded registry"
|
||||
else
|
||||
if ! docker images | grep so-tcpreplay | grep ":5000" | grep -q $VERSION ; then
|
||||
echo "Pulling so-tcpreplay image"
|
||||
TRUSTED_CONTAINERS=("so-tcpreplay")
|
||||
mkdir -p /opt/so/log/tcpreplay
|
||||
update_docker_containers "tcpreplay" "" "" "/opt/so/log/tcpreplay/init.log"
|
||||
else
|
||||
echo "so-tcpreplay image exists."
|
||||
fi
|
||||
fi
|
||||
if is_sensor_node; then
|
||||
|
||||
Reference in new issue
Block a user