commit cccf0299991a3ddbbb7d1c437189e55f3a1fbc2e Author: Adrian Schröter Date: Wed Feb 21 14:04:56 2024 +0100 Sync from SUSE:ALP:Source:Standard:1.0 containerized-data-importer revision a34d7c534e712293f482f2dc2e531429 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..6618973 --- /dev/null +++ b/_constraints @@ -0,0 +1,8 @@ + + + + + 10 + + + diff --git a/_service b/_service new file mode 100644 index 0000000..2387938 --- /dev/null +++ b/_service @@ -0,0 +1,17 @@ + + + containerized-data-importer + v1.58.0 + git + disable + https://github.com/kubevirt/containerized-data-importer + @PARENT_TAG@ + [v]?([^\+]+)(.*) + \1 + + + *.tar + gz + + + diff --git a/cdi_containers_meta b/cdi_containers_meta new file mode 100644 index 0000000..5a92c45 --- /dev/null +++ b/cdi_containers_meta @@ -0,0 +1,24 @@ +#!/bin/bash -xe + +TAGPREFIX=_TAGPREFIX_ +LABELPREFIX=_LABELPREFIX_ +REGISTRY=_REGISTRY_ +PKG_VERSION=_PKG_VERSION_ +PKG_RELEASE=_PKG_RELEASE_ +DISTRO=_DISTRO_ + +# Set HOME=/root as a workaround for +# https://github.com/openSUSE/obs-build/issues/901 +_distro=$(HOME=/root rpm --eval '%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}') +[ "${DISTRO}" == "${_distro}" ] || exit 1 + +if [ -n "${pkg}" ]; then + if rpm -q ${pkg}; then + PKG_VERSION=$(rpm -q --queryformat=%{version} ${pkg}) + PKG_RELEASE=$(rpm -q --queryformat=%{release} ${pkg}) + else + _pkg=$(find ./repos -name "${pkg}*.rpm") + PKG_VERSION=$(rpm -qp --queryformat=%{version} ${_pkg}) + PKG_RELEASE=$(rpm -qp --queryformat=%{release} ${_pkg}) + fi +fi diff --git a/cdi_containers_meta.service b/cdi_containers_meta.service new file mode 100644 index 0000000..f4067fb --- /dev/null +++ b/cdi_containers_meta.service @@ -0,0 +1,5 @@ + + Containers meta information for CDI (build service) + Provides meta information that is used during the build of +the CDI container images. + diff --git a/containerized-data-importer-1.58.0.tar.gz b/containerized-data-importer-1.58.0.tar.gz new file mode 100644 index 0000000..da01dca --- /dev/null +++ b/containerized-data-importer-1.58.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10babf18f107a6cfcf58b0867a87ac39e8854387dc97dd26cd0c6bdedb7dcc9b +size 220298026 diff --git a/containerized-data-importer-rpmlintrc b/containerized-data-importer-rpmlintrc new file mode 100644 index 0000000..e4f76a9 --- /dev/null +++ b/containerized-data-importer-rpmlintrc @@ -0,0 +1 @@ +addFilter("statically-linked-binary") diff --git a/containerized-data-importer.changes b/containerized-data-importer.changes new file mode 100644 index 0000000..65b0f19 --- /dev/null +++ b/containerized-data-importer.changes @@ -0,0 +1,393 @@ +------------------------------------------------------------------- +Mon Feb 12 08:50:24 UTC 2024 - Vasily Ulyanov + +- Overwrite container image references in the manifests: use the images + based on SLE15 SP5 BCI + +------------------------------------------------------------------- +Wed Jan 3 09:54:01 UTC 2024 - Vasily Ulyanov + +- Set ExclusiveArch conditionally depending on the distro +- Remove SLE15 SP4 from the distro check (end of general support) + +------------------------------------------------------------------- +Tue Nov 21 17:52:42 UTC 2023 - Vasily Ulyanov + +- Update to version 1.58.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.58.0 + +------------------------------------------------------------------- +Mon Sep 18 12:36:39 UTC 2023 - Vasily Ulyanov + +- Enable the build for ALP and remove no longer supported SLE versions + from the distro check + +------------------------------------------------------------------- +Tue Aug 15 15:18:09 UTC 2023 - Vasily Ulyanov + +- Update to version 1.57.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.57.0 + +------------------------------------------------------------------- +Wed Jul 12 12:00:14 UTC 2023 - Vasily Ulyanov + +- Add registry path for SLE15 SP6 + +------------------------------------------------------------------- +Mon Mar 13 12:14:28 UTC 2023 - Vasily Ulyanov + +- Update to version 1.56.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.56.0 + +------------------------------------------------------------------- +Thu Dec 1 09:58:30 UTC 2022 - Vasily Ulyanov + +- Ensure RPMs and containers are built against the same distro +- Be more strict when discovering the registry path: error out if the + distro is unknown, instead of falling through to 'opensuse' by + default + +------------------------------------------------------------------- +Sat Oct 15 13:41:00 UTC 2022 - Vasily Ulyanov + +- Build tools/cdi-containerimage-server with CGO_ENABLED=0 + +------------------------------------------------------------------- +Mon Oct 10 07:07:51 UTC 2022 - Dirk Müller + +- Update SP5 kubevirt registry path (bsc#1204140) + +------------------------------------------------------------------- +Mon Sep 19 06:45:42 UTC 2022 - Vasily Ulyanov + +- Update to version 1.55.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.55.0 + +------------------------------------------------------------------- +Tue Aug 30 06:33:01 UTC 2022 - Vasily Ulyanov + +- Update to version 1.54.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.54.0 + +------------------------------------------------------------------- +Tue Jul 26 16:50:25 UTC 2022 - Vasily Ulyanov + +- Include additional tools used by cdi-importer: + cdi-containerimage-server + cdi-image-size-detection + cdi-source-update-poller + +------------------------------------------------------------------- +Fri Jul 15 09:41:36 UTC 2022 - Vasily Ulyanov + +- Update to version 1.51.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.51.0 + +------------------------------------------------------------------- +Tue Jun 21 06:02:00 UTC 2022 - Vasily Ulyanov + +- Update to version 1.50.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.50.0 + +------------------------------------------------------------------- +Tue May 31 19:21:24 UTC 2022 - Caleb Crane + +- Update to version 1.49.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.49.0 + +------------------------------------------------------------------- +Mon Apr 25 14:07:02 UTC 2022 - Caleb Crane + +- Update to version 1.48.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.48.0 + +------------------------------------------------------------------- +Mon Apr 11 07:32:04 UTC 2022 - Vasily Ulyanov + +- Update to version 1.47.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.47.0 + +------------------------------------------------------------------- +Fri Apr 1 07:15:41 UTC 2022 - Vasily Ulyanov + +- Update to version 1.46.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.46.0 + +------------------------------------------------------------------- +Thu Mar 10 08:14:18 UTC 2022 - Vasily Ulyanov + +- Update to version 1.45.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.45.0 + +------------------------------------------------------------------- +Fri Feb 4 11:48:29 UTC 2022 - Vasily Ulyanov + +- Pack only cdi-{cr,operator}.yaml into the manifests RPM + +------------------------------------------------------------------- +Tue Feb 1 06:04:40 UTC 2022 - Vasily Ulyanov + +- Update to version 1.44.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.44.0 + +------------------------------------------------------------------- +Thu Jan 13 11:11:41 UTC 2022 - Guillaume GARDET + +- Enable build on aarch64 + +------------------------------------------------------------------- +Mon Jan 10 11:16:13 UTC 2022 - Vasily Ulyanov + +- Update to version 1.43.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.43.0 + +------------------------------------------------------------------- +Sun Dec 19 09:19:34 UTC 2021 - Vasily Ulyanov + +- Update to version 1.42.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.42.0 + +------------------------------------------------------------------- +Fri Nov 26 05:51:17 UTC 2021 - Vasily Ulyanov + +- Detect SLE15 SP4 build environment + +------------------------------------------------------------------- +Fri Nov 12 05:54:26 UTC 2021 - Vasily Ulyanov + +- Update to version 1.41.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.41.0 + +------------------------------------------------------------------- +Mon Oct 11 15:06:10 UTC 2021 - Vasily Ulyanov + +- Update to version 1.40.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.40.0 + +------------------------------------------------------------------- +Tue Aug 10 04:15:24 UTC 2021 - Vasily Ulyanov + +- Update to version 1.37.1 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.37.1 + +------------------------------------------------------------------- +Mon Jul 12 14:42:38 UTC 2021 - Vasily Ulyanov + +- Update to version 1.36.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.36.0 + +------------------------------------------------------------------- +Wed Jun 30 05:36:37 UTC 2021 - Vasily Ulyanov + +- Generate meta info for containers during rpm build + +------------------------------------------------------------------- +Mon Jun 14 06:05:08 UTC 2021 - Vasily Ulyanov + +- Use registry.suse.com as the default fallback for sle +- Rename macro registry_path to kubevirt_registry_path +- Update to version 1.35.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.35.0 + +------------------------------------------------------------------- +Fri Jun 4 13:04:46 UTC 2021 - Fabian Vogt + +- Add REGISTRY variable + +------------------------------------------------------------------- +Thu May 20 08:24:44 UTC 2021 - Vasily Ulyanov + +- Update to version 1.34.0 + Release notes https://github.com/kubevirt/containerized-data-importer/releases/tag/v1.34.0 + +------------------------------------------------------------------- +Thu May 20 08:19:07 UTC 2021 - Vasily Ulyanov + +- Disable changelog generation via tar_scm service (too verbose) + +------------------------------------------------------------------- +Thu Apr 29 11:36:12 UTC 2021 - Vasily Ulyanov + +- Include release number into docker tag +- Add cdi_containers_meta build service + +------------------------------------------------------------------- +Thu Apr 29 05:23:06 UTC 2021 - Vasily Ulyanov + +- Set default reg_path='registry.opensuse.org/kubevirt' +- Add _constraints file with disk requirements +- Drop CDI_VERSION env var since its not used during the build + +------------------------------------------------------------------- +Wed Apr 21 15:31:22 UTC 2021 - Vasily Ulyanov + +- Preparation for submission to SLE15 SP2 + jsc#SLE-11089 jsc#ECO-3633 + +------------------------------------------------------------------- +Thu Apr 15 14:54:19 UTC 2021 - Vasily Ulyanov + +- Drop csv-generator + +------------------------------------------------------------------- +Wed Apr 7 08:04:36 UTC 2021 - Vasily Ulyanov + +- Update registry path + +------------------------------------------------------------------- +Fri Mar 5 06:35:39 UTC 2021 - Vasily Ulyanov + +- Fix import of vendor dependencies + * Arrange the directory layout in buildroot + * Drop manifest-build-fix.patch + * Switch to Go 1.14 (used for upstream builds) + +------------------------------------------------------------------- +Fri Feb 26 18:51:12 UTC 2021 - James Fehlig + +- Add a manifests package containing YAML manifests used to + install CDI + manifest-build-fix.patch + +------------------------------------------------------------------- +Wed Feb 24 23:21:52 UTC 2021 - jfehlig@suse.com + +- Update to version 1.30.0: + * Release to quay.io instead of docker (#1635) + * Preallocation test did not run all scenarios (#1625) + * Add diagnostic to flake test (#1626) + * VDDK: avoid crash when specified disk isn't in VM. (#1639) + * rename importController to uploadController in the upload-controller.go file (#1632) + * Simplify shouldReconcile function arguments. (#1602) + * Increase polling interval for upload annotation test (#1630) + * Remove note about VDDK 7 restriction. (#1631) + * Remove OLM integration code not removed in #982 (#1624) + * Fix typos in doc/datavolumes.md (#1621) + * Support cloning from Filesystem to Block and vice-versa (#1597) + * Add error to DV when VDDK configmap is missing. (#1627) + * Add focus for destructive tests. (#1614) + * Wait for clone to succeed before checking MD5. (#1601) + * doc: update url in doc/datavolumes.md. (#1609) + * Enable tests for featuregates (#1600) + * Make string we are checking for less specific to allow it pass for other platforms. (#1580) + * Validate image fits in filesystem in a lot more cases. take filesystem overhead into account when resizing. (#1466) + * Try to use the CDIConfig proxy URL if it is set, if not use port-forward (#1598) + * Update kubevirtci (#1579) + * Replaced file copying code with an existing utility function. (#1585) + * Global preallocation setting is not taken into account correctly. (#1565) + * Retry finding the pods for looking up the annotations. (#1583) + * Make DeletePodByName always wait for the pod to stop existing. (#1584) + * When cleaning up NFS disks, recursively delete their contents. (#1576) + * Typedef for preallocation status (#1568) + * Add Data Volume annotations documentation (#1582) + * core: Preallocate blank block volumes (#1559) + * Skip test 2555 if running on openshift (#1572) + +------------------------------------------------------------------- +Tue Jan 26 16:25:34 UTC 2021 - jfehlig@suse.com + +- Update to version 1.29.0: + * Document smartclone disable feature in markdown (#1571) + * update cdi config docs (#1556) + * Run bazelisk run //plugins/cmd/uploader:uploader -- -workspace /home/prow/go/src/github.com/kubevirt/project-infra/../containerized-data-importer/WORKSPACE -dry-run=false (#1569) + * Reduce the noise from the filesystem overhead functionality (#1558) + * VDDK: work with block devices better (BZ 1913756). (#1564) + * Add a DV/PVC annotation "storage.bind.immediate.requested" (#1560) + * Use nbdkit for direct stream for the http importer (#1508) + * Text-only changes missed in removing the Process phase (#1446) (#1562) + * Compare logs while ignoring differences in spaces. (#1557) + * update api for cert configuration (#1542) + * core: Preallocate blank image disks as well (#1555) + * Preallocation check all paths (#1535) + * Remove temporary approver status. + * Change verbosity for preallocation messages, avoid possible infinite loop (#1551) + * Add test ids to strict reconciliation tests (#1546) + * VDDK: more reliable transfers of full disks. (#1547) + * Stop Using Deprecated Packages (#1548) + * Run bazelisk run //plugins/cmd/uploader:uploader -- -workspace /home/prow/go/src/github.com/kubevirt/project-infra/../containerized-data-importer/WORKSPACE -dry-run=false (#1543) + * Preallocation support (#1498) + * VDDK: incremental copy with changed block tracking (#1517) + * Run bazelisk run //plugins/cmd/uploader:uploader -- -workspace /home/prow/go/src/github.com/kubevirt/project-infra/../containerized-data-importer/WORKSPACE -dry-run=false (#1536) + * Add maya-r to approver list. + * Simplify file host, now a new image only has to be added to bazel. (#1534) + * Update fedora 33 (#1486) + * Allow passing default multus network annotation to transfer pods (#1532) + * Try updating the node taint in a loop (#1510) + * Add an API for disabling smart-cloning. (#1461) + * Read-only clone source pods (#1524) + * Clone source program calls tar instead of getting piped input. This ensures we trap tar errors. (#1521) + * Add strict reconciliation tests (#1505) + * Allow specifying of the CONTAINER_DISK_IMAGE with a default of the current value. (#1515) + * Designate CDI as CDIConfig authority (#1516) + * Update builder to fedora 33 (#1511) + * In the operator test there is a critical addons test that removes and (#1513) + * Create a Datavolume if a coliding PVC with same name exists but is marked to delete (#1477) + * Fix make target cluster-sync-cdi, add cluster-clean-cdi & cluster-clean-test-infra (#1503) + * increase code coverage by moving utility functions from api packages (#1479) + * Pass specific PVC annotations to the transfer pods (#1480) + * Move configure_storage to test setup. (#1484) + * Make sure the DV is the main resource and single source of truth for WaitForFirstConsumer. (#1499) + * Controller support for Multistage Imports (#1450) + * Pull less from dockerhub when running testsuite (#1478) + * apiserver should serve up openapi spec (#1485) + * VDDK: Add more debug logging around nbdkit. (#1465) + * k8s-reporter: Add Endpoints logging (#1481) + * Add CDIConfig to CDI (#1475) + * Run bazelisk run //plugins/cmd/uploader:uploader -- -workspace /home/prow/go/src/github.com/fgimenez/project-infra/../../kubevirt/containerized-data-importer/WORKSPACE -dry-run=false + * Wait for stray pods to terminate, destroy/re-create at AfterEach. (#1459) + * Remove the "Process" data processor phase, simplify state machine. (#1446) + * Scratch import bug (#1424) + * Dump service resources after failed tests (#1463) + * VDDK: replace qemu-img with libnbd (#1448) + * update kubevirtci (#1457) + * Update WORKSPACE packages to non-404 ones, and add a second mirror. (#1444) + * Don't wait for NS to deleted in test before starting next test (#1439) + +------------------------------------------------------------------- +Tue Oct 27 17:11:40 UTC 2020 - James Fehlig + +- spec: Fix binary names for several CDI components + +------------------------------------------------------------------- +Mon Oct 26 19:37:49 UTC 2020 - jfehlig@suse.com + +- Update to version 1.25.0: + * Update builder image to add libnbd (#1452) + * Add make targets cluster-sync-cdi & cluster-sync-test-infra (#1451) + * Add library function to determine if a PVC is waiting for first consu… (#1442) + * Add test_ids for the tests (#1441) + * Retry upload in case upload pod wasn't 100% ready when attempting upload (#1440) + * add finalizer to target PVC before creating clone source pod (#1429) + * Make CDI infra deployments as critical addons. (#1361) + * Fix cloning checking fsGroup test in case of use with OCS. (#1435) + * Fix types.go vs code schema verification to actually fail if they are different. (#1428) + * Add files used in OpenShift CI. (#1416) + * Retry upload in case upload pod wasn't 100% ready when attempting upload (#1437) + * Check for expected changes after CDI upgrade (#1417) + * Files in tar archives can have paths relative to ./ (#1432) + * Attempt to schedula clone sourc/target pods on same node (#1426) + * Touch ups for filesystem overhead test cases (#1427) + * Fix imports for images with no info about MediaType. (#1413) + * Fix size mismatch between source and target in smart clone tests. Ceph no longer (#1421) + * use snappy compression for cloning instead of gzip (#1419) + * Update to k8s.io/klog/v2, used by kubernetes 1.19 (#1409) + +------------------------------------------------------------------- +Fri Oct 23 15:35:12 UTC 2020 - jfehlig@suse.com + +- Update to version 1.24.0: + * add system:authorized to groups checked for clone auth (#1415) + * Fixing CDIStatus generate-verify issues (#1412) + * Reserve overhead when validating that a Filesystem has enough space (#1319) + * Test behavior after client-side upload failure. (#1404) + * Removed hard coded registry:5000 for vddk datasource test. (#1402) + * Add library function to determine if a PVC has been populated fully. (#1400) + * Remove dependency update when building the OR CI build image (#1386) + * Add test_id for the test cases (#1398) + * Fix incorrect region parsing from aws s3 endpoint (#1395) + * Add functional test for cloning if source NS has enought quota and (#1387) + +------------------------------------------------------------------- +Fri Oct 23 15:27:46 UTC 2020 - James Fehlig + +- Initial attempt at packaging CDI diff --git a/containerized-data-importer.spec b/containerized-data-importer.spec new file mode 100644 index 0000000..b244820 --- /dev/null +++ b/containerized-data-importer.spec @@ -0,0 +1,307 @@ +# +# spec file for package containerized-data-importer +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if 0%{?sle_version} && !0%{?is_opensuse} +# SLE +%define _exclusive_arch x86_64 +%else +%if 0%{?suse_version} == 1600 +# ALP +%define _exclusive_arch x86_64 +%else +# TW +%define _exclusive_arch x86_64 aarch64 +%endif +%endif + +Name: containerized-data-importer +Version: 1.58.0 +Release: 0 +Summary: Container native virtualization +License: Apache-2.0 +Group: System/Packages +URL: https://github.com/kubevirt/containerized-data-importer +Source0: %{name}-%{version}.tar.gz +Source1: cdi_containers_meta +Source2: cdi_containers_meta.service +Source100: %{name}-rpmlintrc +BuildRequires: golang-packaging +BuildRequires: libnbd-devel +BuildRequires: pkgconfig +BuildRequires: rsync +BuildRequires: sed +BuildRequires: golang(API) >= 1.20 +ExclusiveArch: %{_exclusive_arch} + +%description +Containerized-Data-Importer (CDI) is a persistent storage management add-on for Kubernetes + +%package api +Summary: CDI API server +Group: System/Packages + +%description api +The containerized-data-importer-api package provides the kubernetes API extension for CDI + +%package cloner +Summary: Cloner for host assisted cloning +Group: System/Packages + +%description cloner +Source and Target cloner image for host assisted cloning + +%package controller +Summary: Controller for the data fetching service +Group: System/Packages + +%description controller +Controller for the data fetching service for VM container images + +%package importer +Summary: Data fetching service +Group: System/Packages + +%description importer +Data fetching service for VM container imagess + +%package operator +Summary: Operator for the data fetching service +Group: System/Packages + +%description operator +Operator for the data fetching service for VM container images + +%package uploadproxy +Summary: Upload proxy for the data fetching service +Group: System/Packages + +%description uploadproxy +Upload proxy for the data fetching service for VM container images + +%package uploadserver +Summary: Upload server for the data fetching service +Group: System/Packages + +%description uploadserver +Upload server for the data fetching service for VM container images + +%package manifests +Summary: YAML manifests used to install CDI +Group: System/Packages + +%description manifests +This contains the built YAML manifests used to install CDI into a +kubernetes installation with kubectl apply. + +%package -n obs-service-cdi_containers_meta +Summary: CDI containers meta information (build service) +Group: System/Packages + +%description -n obs-service-cdi_containers_meta +The package provides meta information that is used during the build of +the CDI container images. + +%prep +# Unpack the sources respecting the GOPATH directory structure expected by the +# go imports resolver. I.e. if DIR is in GOPATH then DIR/src/foo/bar can be +# imported as "foo/bar". The same 'visibility' rules apply to the local copies +# of external dependencies placed in 'vendor' directory when imported from the +# 'parent' package. +# +# Note: having bar symlink'ed to DIR/src/foo/bar does not seem to work. Looks +# like symlinks in go path are not resolved correctly. Hence the sources need +# to be 'physically' placed into the proper location. +%setup -n go/src/kubevirt.io/%{name} -c -T +tar --strip-components=1 -xf %{S:0} +%autopatch -p1 + +%build +# Hackery to determine which registry path to use in cdi-operator.yaml +# when building the manifests +# +# The 'kubevirt_registry_path' macro can be used to define an explicit path in +# the project config, e.g. +# +# Macros: +# %kubevirt_registry_path registry.opensuse.org/Virtualization/container +# :Macros +# +# 'kubevirt_registry_path' can also be defined when building locally, e.g. +# +# osc build --define='kubevirt_registry_path registry.opensuse.org/foo/bar/baz' ... +# +# If 'kubevirt_registry_path' is not specified, the standard publish location for +# SLE and openSUSE-based containers is used. +# +distro='%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}' +case "${distro}" in +150500:0) + tagprefix=suse/sles/15.5 + labelprefix=com.suse.kubevirt + registry=registry.suse.com + ;; +150600:0) + tagprefix=suse/sles/15.6 + labelprefix=com.suse.kubevirt + registry=registry.suse.com + ;; +*:1) + tagprefix=kubevirt + labelprefix=org.opensuse.kubevirt + registry=registry.opensuse.org + ;; +*) +%if 0%{?suse_version} == 1600 + tagprefix=alp/kubevirt + labelprefix=com.suse.kubevirt + registry=registry.suse.com +%else + echo "Unsupported distro: ${distro}" >&2 + exit 1 +%endif + ;; +esac + +%if "%{?kubevirt_registry_path}" == "" + reg_path="${registry}/${tagprefix}" +%else + reg_path='%{kubevirt_registry_path}' +%endif + +sed -i"" \ + -e "s#_TAGPREFIX_#${tagprefix}#g" \ + -e "s#_LABELPREFIX_#${labelprefix}#g" \ + -e "s#_REGISTRY_#${registry}#g" \ + -e "s#_PKG_VERSION_#%{version}#g" \ + -e "s#_PKG_RELEASE_#%{release}#g" \ + -e "s#_DISTRO_#${distro}#g" \ + %{S:1} + +export GOPATH=%{_builddir}/go +export GOFLAGS="-mod=vendor" +export CDI_SOURCE_DATE_EPOCH="$(date -r LICENSE +%s)" +export CDI_GIT_COMMIT='v%{version}' +export CDI_GIT_VERSION='v%{version}' +export CDI_GIT_TREE_STATE="clean" + +GOFLAGS="-buildmode=pie ${GOFLAGS}" ./hack/build/build-go.sh build \ + cmd/cdi-apiserver \ + cmd/cdi-cloner \ + cmd/cdi-controller \ + cmd/cdi-importer \ + cmd/cdi-uploadproxy \ + cmd/cdi-uploadserver \ + cmd/cdi-operator \ + tools/cdi-image-size-detection \ + tools/cdi-source-update-poller \ + %{nil} + +# Disable cgo to build static binaries, so they can run on scratch images +CGO_ENABLED=0 ./hack/build/build-go.sh build \ + tools/cdi-containerimage-server \ + %{nil} + +# Note: the generated manifests will point to the images based on SLE15 SP5 BCI. +env \ +DOCKER_PREFIX=registry.suse.com/suse/sles/15.5 \ +DOCKER_TAG=1.58.0-150500.6.9.1 \ +./hack/build/build-manifests.sh + +%install +mkdir -p %{buildroot}%{_bindir} + +install -p -m 0755 _out/cmd/cdi-apiserver/cdi-apiserver %{buildroot}%{_bindir}/virt-cdi-apiserver + +install -p -m 0755 cmd/cdi-cloner/cloner_startup.sh %{buildroot}%{_bindir}/ +install -p -m 0755 _out/cmd/cdi-cloner/cdi-cloner %{buildroot}%{_bindir}/ + +install -p -m 0755 _out/cmd/cdi-controller/cdi-controller %{buildroot}%{_bindir}/virt-cdi-controller + +install -p -m 0755 _out/cmd/cdi-importer/cdi-importer %{buildroot}%{_bindir}/virt-cdi-importer +install -p -m 0755 _out/tools/cdi-containerimage-server/cdi-containerimage-server %{buildroot}%{_bindir}/ +install -p -m 0755 _out/tools/cdi-image-size-detection/cdi-image-size-detection %{buildroot}%{_bindir}/ +install -p -m 0755 _out/tools/cdi-source-update-poller/cdi-source-update-poller %{buildroot}%{_bindir}/ + +install -p -m 0755 _out/cmd/cdi-operator/cdi-operator %{buildroot}%{_bindir}/virt-cdi-operator + +install -p -m 0755 _out/cmd/cdi-uploadproxy/cdi-uploadproxy %{buildroot}%{_bindir}/virt-cdi-uploadproxy + +install -p -m 0755 _out/cmd/cdi-uploadserver/cdi-uploadserver %{buildroot}%{_bindir}/virt-cdi-uploadserver + +# Install release manifests +mkdir -p %{buildroot}%{_datadir}/cdi/manifests/release +install -m 0644 _out/manifests/release/cdi-operator.yaml %{buildroot}%{_datadir}/cdi/manifests/release/ +install -m 0644 _out/manifests/release/cdi-cr.yaml %{buildroot}%{_datadir}/cdi/manifests/release/ + +# Install cdi_containers_meta build service +mkdir -p %{buildroot}%{_prefix}/lib/obs/service +install -m 0755 %{S:1} %{buildroot}%{_prefix}/lib/obs/service +install -m 0644 %{S:2} %{buildroot}%{_prefix}/lib/obs/service + +%files api +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-apiserver + +%files cloner +%license LICENSE +%doc README.md +%{_bindir}/cloner_startup.sh +%{_bindir}/cdi-cloner + +%files controller +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-controller + +%files importer +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-importer +%{_bindir}/cdi-containerimage-server +%{_bindir}/cdi-image-size-detection +%{_bindir}/cdi-source-update-poller + +%files operator +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-operator + +%files uploadproxy +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-uploadproxy + +%files uploadserver +%license LICENSE +%doc README.md +%{_bindir}/virt-cdi-uploadserver + +%files manifests +%license LICENSE +%doc README.md +%dir %{_datadir}/cdi +%{_datadir}/cdi/manifests + +%files -n obs-service-cdi_containers_meta +%license LICENSE +%doc README.md +%dir %{_prefix}/lib/obs +%{_prefix}/lib/obs/service + +%changelog