Skip to content

Add repository example #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 4_repositories/README.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions 4_repositories/build.sh
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions 4_repositories/pkgs/pkg-a/v0.1.0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions 4_repositories/pkgs/pkg-a/v0.2.0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions 4_repositories/pkgs/pkg-a/v0.3.0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
60 changes: 60 additions & 0 deletions 4_repositories/repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
apiVersion: manifests.package-operator.run/v1alpha1
kind: Repository
metadata:
creationTimestamp: "2023-12-06T18:10:01Z"
name: my-repo
---
apiVersion: manifests.package-operator.run/v1alpha1
data:
constraints:
- platform:
- OpenShift
- platformVersion:
name: OpenShift
range: 4.11.x
digest: 9f62412e643b6e3a8a2b3997e955062af3813dfe2aa577a01f724daa1033cd98
image: quay.io/nschiede/pkg-a
name: pkg-a
versions:
- v0.1.0
kind: RepositoryEntry
metadata:
creationTimestamp: null
name: pkg-a.9f62412e643b6e3a8a2b3997e955062af3813dfe2aa577a01f724daa1033cd98
---
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:
creationTimestamp: null
name: pkg-a.037ff25265533a1f314e20ba8f4825836a9712443c04a6cdf4f741c09163f861
---
apiVersion: manifests.package-operator.run/v1alpha1
data:
constraints:
- platform:
- OpenShift
- platformVersion:
name: OpenShift
range: 4.15.x
digest: 1f1347f666c05a769548d8e16e5c92a3304ce7603f67f0e3a2801d1f4d102c5b
image: quay.io/nschiede/pkg-a
name: pkg-a
versions:
- v0.3.0
kind: RepositoryEntry
metadata:
creationTimestamp: null
name: pkg-a.1f1347f666c05a769548d8e16e5c92a3304ce7603f67f0e3a2801d1f4d102c5b
23 changes: 23 additions & 0 deletions 4_repositories/root/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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.11.x
dependencies:
- image:
name: pkg-a
package: pkg-a.my-repo
# range: '0-1'
repositories:
- file: repo.yaml