diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index a7cab07e..1fac58dc 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -27,6 +27,7 @@ - centos/8-stream-build-succeeds - centos/9-stream-build-succeeds - fedora/build-succeeds + - opensuse/build-succeeds - ubuntu/bionic-build-succeeds - ubuntu/focal-build-succeeds diff --git a/diskimage_builder/elements/opensuse/README.rst b/diskimage_builder/elements/opensuse/README.rst index 656ac958..d4c75ade 100644 --- a/diskimage_builder/elements/opensuse/README.rst +++ b/diskimage_builder/elements/opensuse/README.rst @@ -14,12 +14,12 @@ Environment Variables DIB_RELEASE :Required: No - :Default: 15.1 + :Default: 15.3 :Description: Set the desired openSUSE release. DIB_CLOUD_IMAGES :Required: No - :Default: https://download.opensuse.org/repositories/Cloud:/Images:/(openSUSE|Leap)_${DIB_RELEASE} + :Default: https://download.opensuse.org/repositories/Cloud:/Images:/Leap_${DIB_RELEASE} :Description: Set the desired URL to fetch the images from. Notes: diff --git a/diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash b/diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash index cf41925b..ed8327d2 100644 --- a/diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash +++ b/diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash @@ -1,13 +1,10 @@ export DISTRO_NAME=opensuse -export DIB_RELEASE=${DIB_RELEASE:-15.1} +export DIB_RELEASE=${DIB_RELEASE:-15.3} export EFI_BOOT_DIR="EFI/opensuse" export DIB_OPENSUSE_PATTERNS=patterns-openSUSE-base export DIB_INIT_SYSTEM=systemd case ${DIB_RELEASE} in - # Old Leap releases - 42*) export OPENSUSE_REPO_DIR=openSUSE_Leap_${DIB_RELEASE} ;; - # New Leap releases - 15*) export OPENSUSE_REPO_DIR=openSUSE_Leap_${DIB_RELEASE} ;; + 15.3) export OPENSUSE_REPO_DIR=openSUSE_Leap_${DIB_RELEASE} ;; *) echo "Unsupported openSUSE release: ${DIB_RELEASE}"; exit 1 ;; esac diff --git a/diskimage_builder/elements/opensuse/root.d/10-opensuse-cloud-image b/diskimage_builder/elements/opensuse/root.d/10-opensuse-cloud-image index 93f3a8dd..0c567bb2 100755 --- a/diskimage_builder/elements/opensuse/root.d/10-opensuse-cloud-image +++ b/diskimage_builder/elements/opensuse/root.d/10-opensuse-cloud-image @@ -19,26 +19,14 @@ if ! [ 'x86_64' = "$ARCH" ] ; then fi # Set some image defaults -case ${DIB_RELEASE} in - # Old Leap releases - 42*) - OPENSUSE_IMAGE_BASEDIR=Leap - OPENSUSE_IMAGE_FILE=openSUSE-Leap-${DIB_RELEASE}-OpenStack - OPENSUSE_IMAGE_EXT=tbz - ;; - # New Leap releases - 15*) - OPENSUSE_IMAGE_BASEDIR=Leap - OPENSUSE_IMAGE_FILE=openSUSE-Leap-${DIB_RELEASE}-OpenStack - OPENSUSE_IMAGE_EXT=tar.xz - ;; - # We handle unknown cases in environment.d/10-opensuse-distro-name.bash -esac +OPENSUSE_IMAGE_BASEDIR=Leap +OPENSUSE_IMAGE_FILE=openSUSE-Leap-${DIB_RELEASE} +OPENSUSE_IMAGE_EXT=qcow2 # NOTE(toabctl): if something changes here on the buildservice side, please -# first ask in #opensuse-cloud on Libera Chat before you change the format -# here! +# first ask in #opensuse-buildservice on Libera Chat before you change the +# format here! DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://download.opensuse.org/repositories/Cloud:/Images:/${OPENSUSE_IMAGE_BASEDIR}_${DIB_RELEASE}/images/} -BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-${OPENSUSE_IMAGE_FILE}-rootfs.${ARCH}.${OPENSUSE_IMAGE_EXT}} +BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-${OPENSUSE_IMAGE_FILE}.${ARCH}-NoCloud.${OPENSUSE_IMAGE_EXT}} SHA256SUMS_FILE=${SHA256SUMS_FILE:-${BASE_IMAGE_FILE}.sha256} CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE @@ -49,17 +37,16 @@ CACHED_SHA256SUMS_FILE=$DIB_IMAGE_CACHE/SHA256SUMS.$BASE_IMAGE_FILE # over HTTP if [ -n "$DIB_OFFLINE" -a -f "$CACHED_FILE" ] ; then echo "Not checking freshness of cached $CACHED_FILE." + # Extract the base image (use --numeric-owner to avoid UID/GID mismatch + # between image tarball and host OS) + sudo tar -C $TARGET_ROOT --numeric-owner -xf $CACHED_FILE else echo "Fetching Base Image" $TMP_HOOKS_PATH/bin/cache-url $DIB_CLOUD_IMAGES/$SHA256SUMS_FILE $CACHED_SHA256SUMS_FILE - $TMP_HOOKS_PATH/bin/cache-url $DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE $CACHED_FILE + $TMP_HOOKS_PATH/bin/extract-image $BASE_IMAGE_FILE $BASE_IMAGE_FILE.tgz $DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE $CACHED_FILE pushd $DIB_IMAGE_CACHE # Calculate sha256sum of downloaded image and check against content from sha256 file SHA256SUM=$(sha256sum ${BASE_IMAGE_FILE} | cut -d " " -f1) grep -q $SHA256SUM SHA256SUMS.$BASE_IMAGE_FILE popd fi - -# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between -# image tarball and host OS) -sudo tar -C $TARGET_ROOT --numeric-owner -xf $CACHED_FILE diff --git a/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/README.rst b/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/README.rst index a05d8497..c89b1cf2 100644 --- a/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/README.rst +++ b/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/README.rst @@ -1 +1 @@ -Verify we can build an openSUSE Leap 15.1 image. +Verify we can build an openSUSE Leap 15.3 image. diff --git a/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash b/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash index 25355f0b..4af58d2b 100644 --- a/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash +++ b/diskimage_builder/elements/opensuse/test-elements/opensuse15-build-succeeds/environment.d/10-set-distro.bash @@ -1 +1 @@ -export DIB_RELEASE=15.1 +export DIB_RELEASE=15.3 diff --git a/diskimage_builder/elements/redhat-common/bin/extract-image b/diskimage_builder/elements/sysprep/bin/extract-image similarity index 100% rename from diskimage_builder/elements/redhat-common/bin/extract-image rename to diskimage_builder/elements/sysprep/bin/extract-image diff --git a/doc/source/user_guide/supported_distros.rst b/doc/source/user_guide/supported_distros.rst index 9acd04ee..5345e68d 100644 --- a/doc/source/user_guide/supported_distros.rst +++ b/doc/source/user_guide/supported_distros.rst @@ -20,4 +20,4 @@ Distributions which are supported as a target for an image: - 16.04 ("xenial"), 18.04 ("bionic") - Gentoo - openEuler 20.03-LTS-SP1+ -- openSUSE Leap 42.3, 15.0, 15.1 and Tumbleweed (opensuse-minimal only) +- openSUSE Leap 15.3 and Tumbleweed (opensuse-minimal only) diff --git a/releasenotes/notes/fix-and-update-opensuse-15.3-c7fee120b51e3621.yaml b/releasenotes/notes/fix-and-update-opensuse-15.3-c7fee120b51e3621.yaml new file mode 100644 index 00000000..5d826e07 --- /dev/null +++ b/releasenotes/notes/fix-and-update-opensuse-15.3-c7fee120b51e3621.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + Bumped the default openSUSE Leap release to 15.3 for the opensuse element. +deprecations: + - | + Dropped support for building openSUSE Leap 42.1, 42.2, 42.3, 15.0, 15.1, + and 15.2, since all of them have already reached end-of-life. diff --git a/tests/run_functests.sh b/tests/run_functests.sh index 15dd4672..bcd17956 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -37,6 +37,8 @@ DEFAULT_SKIP_TESTS=( # These download base images which has shown to be very unreliable # in the gate. Keep them in a -nv job until we can figure out # better caching for the images + opensuse/build-succeeds + opensuse/opensuse15-build-succeeds centos7/build-succeeds debian/build-succeeds fedora/build-succeeds