diff --git a/4_repositories/README.md b/4_repositories/README.md new file mode 100644 index 0000000..8e20b72 --- /dev/null +++ b/4_repositories/README.md @@ -0,0 +1,10 @@ +# Repositories + +## Packages + +### pkg-a + +Versions: +- **v0.1.0** Works with OpenShift 4.11.x +- **v0.2.0** Works with OpenShift 4.12 - 4.14 (But not 4.13.5 - known regression) +- **v0.3.0** Works with OpenShift 4.15.x \ No newline at end of file diff --git a/4_repositories/build.sh b/4_repositories/build.sh new file mode 100755 index 0000000..a4cea03 --- /dev/null +++ b/4_repositories/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail + +# build package images +PKG_A_REPO="quay.io/nschiede/pkg-a" +kubectl package build ./pkgs/pkg-a/v0.1.0 --tag="${PKG_A_REPO}:v0.1.0" --push +kubectl package build ./pkgs/pkg-a/v0.2.0 --tag="${PKG_A_REPO}:v0.2.0" --push +kubectl package build ./pkgs/pkg-a/v0.3.0 --tag="${PKG_A_REPO}:v0.3.0" --push + +rm repo.yaml +kubectl package repo initialize repo.yaml my-repo +kubectl package repo add repo.yaml "${PKG_A_REPO}:v0.1.0" 0.1.0 +kubectl package repo add repo.yaml "${PKG_A_REPO}:v0.2.0" 0.2.0 +kubectl package repo add repo.yaml "${PKG_A_REPO}:v0.3.0" 0.3.0 \ No newline at end of file diff --git a/4_repositories/pkgs/pkg-a/v0.1.0/manifest.yaml b/4_repositories/pkgs/pkg-a/v0.1.0/manifest.yaml new file mode 100644 index 0000000..bb7f1af --- /dev/null +++ b/4_repositories/pkgs/pkg-a/v0.1.0/manifest.yaml @@ -0,0 +1,18 @@ +apiVersion: manifests.package-operator.run/v1alpha1 +kind: PackageManifest +metadata: + name: pkg-a + annotations: + version: v0.1.0 +spec: + scopes: + - Cluster + - Namespaced + phases: + - name: deploy + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: '~4.11.x' \ No newline at end of file diff --git a/4_repositories/pkgs/pkg-a/v0.2.0/manifest.yaml b/4_repositories/pkgs/pkg-a/v0.2.0/manifest.yaml new file mode 100644 index 0000000..57b132a --- /dev/null +++ b/4_repositories/pkgs/pkg-a/v0.2.0/manifest.yaml @@ -0,0 +1,18 @@ +apiVersion: manifests.package-operator.run/v1alpha1 +kind: PackageManifest +metadata: + name: pkg-a + annotations: + version: v0.2.0 +spec: + scopes: + - Cluster + - Namespaced + phases: + - name: deploy + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: 4.12.x - 4.14.x && != 4.13.5 \ No newline at end of file diff --git a/4_repositories/pkgs/pkg-a/v0.3.0/manifest.yaml b/4_repositories/pkgs/pkg-a/v0.3.0/manifest.yaml new file mode 100644 index 0000000..e2e1169 --- /dev/null +++ b/4_repositories/pkgs/pkg-a/v0.3.0/manifest.yaml @@ -0,0 +1,18 @@ +apiVersion: manifests.package-operator.run/v1alpha1 +kind: PackageManifest +metadata: + name: pkg-a + annotations: + version: v0.3.0 +spec: + scopes: + - Cluster + - Namespaced + phases: + - name: deploy + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: '~4.15.x' \ No newline at end of file diff --git a/4_repositories/repo.yaml b/4_repositories/repo.yaml new file mode 100644 index 0000000..c78a47b --- /dev/null +++ b/4_repositories/repo.yaml @@ -0,0 +1,57 @@ +--- +apiVersion: manifests.package-operator.run/v1alpha1 +kind: Repository +metadata: + creationTimestamp: "2026-05-15T07:31:17Z" + name: my-repo +--- +apiVersion: manifests.package-operator.run/v1alpha1 +data: + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: ~4.11.x + digest: ab985be7292e13b696eaabbd02606a0af810cc9c5ae8e74be7c88865c949d720 + image: quay.io/nschiede/pkg-a + name: pkg-a + versions: + - v0.1.0 +kind: RepositoryEntry +metadata: + name: pkg-a.ab985be7292e13b696eaabbd02606a0af810cc9c5ae8e74be7c88865c949d720 +--- +apiVersion: manifests.package-operator.run/v1alpha1 +data: + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: 4.12.x - 4.14.x && != 4.13.5 + digest: 037ff25265533a1f314e20ba8f4825836a9712443c04a6cdf4f741c09163f861 + image: quay.io/nschiede/pkg-a + name: pkg-a + versions: + - v0.2.0 +kind: RepositoryEntry +metadata: + name: pkg-a.037ff25265533a1f314e20ba8f4825836a9712443c04a6cdf4f741c09163f861 +--- +apiVersion: manifests.package-operator.run/v1alpha1 +data: + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + range: ~4.15.x + digest: f1a73f5657459822bd819ba91f15431d425f4bacd0f77946246ad25e22274a55 + image: quay.io/nschiede/pkg-a + name: pkg-a + versions: + - v0.3.0 +kind: RepositoryEntry +metadata: + name: pkg-a.f1a73f5657459822bd819ba91f15431d425f4bacd0f77946246ad25e22274a55 diff --git a/4_repositories/root/manifest.lock.yaml b/4_repositories/root/manifest.lock.yaml new file mode 100644 index 0000000..57d77f8 --- /dev/null +++ b/4_repositories/root/manifest.lock.yaml @@ -0,0 +1,11 @@ +apiVersion: manifests.package-operator.run/v1alpha1 +kind: PackageManifestLock +metadata: + creationTimestamp: "2026-05-15T07:40:14Z" +spec: + dependencies: + - digest: 037ff25265533a1f314e20ba8f4825836a9712443c04a6cdf4f741c09163f861 + image: quay.io/nschiede/pkg-a + name: pkg-a + version: 0.2.0 + images: [] diff --git a/4_repositories/root/manifest.yaml b/4_repositories/root/manifest.yaml new file mode 100644 index 0000000..ef70810 --- /dev/null +++ b/4_repositories/root/manifest.yaml @@ -0,0 +1,32 @@ +apiVersion: manifests.package-operator.run/v1alpha1 +kind: PackageManifest +metadata: + name: root +spec: + scopes: + - Cluster + - Namespaced + phases: + - name: deploy + constraints: + - platform: + - OpenShift + - platformVersion: + name: OpenShift + # range: '>=4.12,<4.13' + # range: '=4.13.3' + # range: '=4.13.5' # no package supports this version + range: '4.13.0 - 4.13.4' + # range: '~4.11' # 4.11.0 - 4.11.x + # range: '~4.12' # 4.12.0 - 4.12.x + dependencies: + - image: + name: pkg-a + package: pkg-a.my-repo + # range: '0-1' + repositories: + - file: repo.yaml + # repository contains + # - pkg-a@0.1.0 [OpenShift ~4.11] + # - pkg-a@0.2.0 [OpenShift 4.12.x - 4.14.x && != 4.13.5] + # - pkg-a@0.3.0 [OpenShift ~4.15] \ No newline at end of file