diff --git a/cdi_containers_meta b/cdi_containers_meta
new file mode 100644
index 0000000..8da419e
--- /dev/null
+++ b/cdi_containers_meta
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+distro=$(rpm --eval '%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}')
+case "${distro}" in
+150200:0)
+ TAGPREFIX=suse/sles/15.2
+ LABELPREFIX=com.suse.kubevirt
+ ;;
+150300:0)
+ TAGPREFIX=suse/sles/15.3
+ LABELPREFIX=com.suse.kubevirt
+ ;;
+*)
+ TAGPREFIX=kubevirt
+ LABELPREFIX=org.opensuse.kubevirt
+ ;;
+esac
+
+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..bd383a6
--- /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.changes b/containerized-data-importer.changes
index cb6bd29..3c1c568 100644
--- a/containerized-data-importer.changes
+++ b/containerized-data-importer.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+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
diff --git a/containerized-data-importer.spec b/containerized-data-importer.spec
index 1018295..4ca6666 100644
--- a/containerized-data-importer.spec
+++ b/containerized-data-importer.spec
@@ -24,6 +24,8 @@ 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
BuildRequires: golang-packaging
BuildRequires: libnbd-devel
BuildRequires: pkgconfig
@@ -92,6 +94,14 @@ Group: System/Packages
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
@@ -158,7 +168,7 @@ CDI_GIT_TREE_STATE="clean" \
cmd/cdi-operator \
%{nil}
-env DOCKER_PREFIX=$reg_path DOCKER_TAG=%{version} ./hack/build/build-manifests.sh
+env DOCKER_PREFIX=$reg_path DOCKER_TAG=%{version}-%{release} ./hack/build/build-manifests.sh
%install
mkdir -p %{buildroot}%{_bindir}
@@ -181,6 +191,11 @@ install -p -m 0755 _out/cmd/cdi-uploadserver/cdi-uploadserver %{buildroot}%{_bin
mkdir -p %{buildroot}%{_datadir}/cdi
cp -r _out/manifests %{buildroot}%{_datadir}/cdi/
+# 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
@@ -223,4 +238,10 @@ cp -r _out/manifests %{buildroot}%{_datadir}/cdi/
%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