Skip to content

Commit

Permalink
Merge pull request #963 from netbox-community/develop
Browse files Browse the repository at this point in the history
Version 2.5.1
  • Loading branch information
tobiasge authored Mar 16, 2023
2 parents 93017f1 + c001b88 commit 97ee353
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.5.1
5 changes: 0 additions & 5 deletions build-functions/get-public-image-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ get_image_label() {
skopeo inspect "docker://$image" | jq -r ".Labels[\"$label\"]"
}

get_image_layers() {
local image=$1
skopeo inspect "docker://$image" | jq -r ".Layers"
}

get_image_last_layer() {
local image=$1
skopeo inspect "docker://$image" | jq -r ".Layers | last"
Expand Down
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ else
source ./build-functions/get-public-image-config.sh
echo "Checking labels for '${FINAL_DOCKER_TAG}'"
BASE_LAST_LAYER=$(get_image_last_layer "${DOCKER_FROM}")
mapfile -t IMAGES_LAYERS_OLD < <(get_image_layers "${FINAL_DOCKER_TAG}")
OLD_BASE_LAST_LAYER=$(get_image_label netbox.last-base-image-layer "${FINAL_DOCKER_TAG}")
NETBOX_GIT_REF_OLD=$(get_image_label netbox.git-ref "${FINAL_DOCKER_TAG}")
GIT_REF_OLD=$(get_image_label org.opencontainers.image.revision "${FINAL_DOCKER_TAG}")

if ! printf '%s\n' "${IMAGES_LAYERS_OLD[@]}" | grep -q -P "^${BASE_LAST_LAYER}\$"; then
if [ "${BASE_LAST_LAYER}" != "${OLD_BASE_LAST_LAYER}" ]; then
SHOULD_BUILD="true"
BUILD_REASON="${BUILD_REASON} ubuntu"
fi
Expand Down Expand Up @@ -388,6 +388,7 @@ fi
if [ -n "${BUILD_REASON}" ]; then
BUILD_REASON=$(sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' <<<"$BUILD_REASON")
DOCKER_BUILD_ARGS+=(--label "netbox.build-reason=${BUILD_REASON}")
DOCKER_BUILD_ARGS+=(--label "netbox.last-base-image-layer=${BASE_LAST_LAYER}")
fi

# --build-arg
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'
services:
netbox: &netbox
image: docker.io/netboxcommunity/netbox:${VERSION-v3.4-2.5.0}
image: docker.io/netboxcommunity/netbox:${VERSION-v3.4-2.5.1}
depends_on:
- postgres
- redis
Expand Down
9 changes: 6 additions & 3 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ fi

./manage.py shell --interface python <<END
from users.models import Token
old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567")
if old_default_token:
print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.")
try:
old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567")
if old_default_token:
print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.")
except Token.DoesNotExist:
pass
END

echo "✅ Initialisation is done."
Expand Down

0 comments on commit 97ee353

Please sign in to comment.