-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from controlplaneio-fluxcd/operatorhub
Add OperatorHub manifests
- Loading branch information
Showing
23 changed files
with
1,190 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: e2e-olm | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Flux operator strict semver e.g. v0.3.0' | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
- name: Setup Go | ||
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | ||
with: | ||
go-version-file: 'go.mod' | ||
cache-dependency-path: | | ||
**/go.sum | ||
**/go.mod | ||
- name: Setup Kubernetes | ||
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 | ||
with: | ||
version: v0.23.0 | ||
cluster_name: kind | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 | ||
- name: Setup Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | ||
- name: Run OLM tests | ||
run: | | ||
make test-olm FLUX_OPERATOR_VERSION="${{ github.event.inputs.version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM alpine:3.20 | ||
|
||
ARG DOCKER_VERSION=26.1.3 | ||
ARG OPM_VERSION=4.15.16 | ||
# x86_64 or aarch64 | ||
ARG ARCH=x86_64 | ||
|
||
WORKDIR /opt | ||
RUN wget https://download.docker.com/linux/static/stable/${ARCH}/docker-${DOCKER_VERSION}.tgz | ||
RUN tar xf docker-${DOCKER_VERSION}.tgz | ||
|
||
RUN wget https://mirror.openshift.com/pub/openshift-v4/${ARCH}/clients/ocp/${OPM_VERSION}/opm-linux-${OPM_VERSION}.tar.gz | ||
RUN tar xf opm-linux-${OPM_VERSION}.tar.gz | ||
|
||
FROM ubuntu:24.04 | ||
|
||
WORKDIR /opt | ||
|
||
COPY --from=0 /opt/docker/docker /usr/bin/ | ||
COPY --from=0 /opt/opm /opt/ | ||
|
||
ENTRYPOINT ["/opt/opm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM scratch | ||
|
||
# Core bundle labels. | ||
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 | ||
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ | ||
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ | ||
LABEL operators.operatorframework.io.bundle.package.v1=flux-operator | ||
LABEL operators.operatorframework.io.bundle.channels.v1=stable | ||
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable | ||
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.29.0 | ||
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 | ||
LABEL operators.operatorframework.io.metrics.project_layout=unknown | ||
|
||
# Labels for testing. | ||
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 | ||
LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ | ||
|
||
# Copy files to locations specified by labels. | ||
COPY manifests /manifests/ | ||
COPY metadata /metadata/ | ||
COPY tests/scorecard /tests/scorecard/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# Use `replaces-mode` or `semver-mode`. Once you switch to `semver-mode`, there is no easy way back. | ||
updateGraph: semver-mode | ||
addReviewers: true | ||
reviewers: | ||
- stefanprodan | ||
- souleb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
packageName: flux-operator | ||
defaultChannel: stable | ||
channels: | ||
- name: stable | ||
currentCSV: flux-operator.v0.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# | ||
# Prepare catalog for e2e testing | ||
# | ||
|
||
VERSION=$1 | ||
ARCH="" | ||
DIR="config/operatorhub/flux-operator/" | ||
case $(uname -m) in | ||
x86_64) ARCH="x86_64" ;; | ||
aarch64) ARCH="aarch64" ;; | ||
arm64) ARCH="aarch64" ;; | ||
*) echo "Unsupported architecture" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
if [ ! -d "${DIR}/${VERSION}" ]; then | ||
echo "Version ${VERSION} does not exist" | ||
exit 1 | ||
fi | ||
|
||
# docker build and push individual bundles | ||
docker build -t ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-catalog:bundle-"${VERSION}" \ | ||
-f "${DIR}/bundle.Dockerfile" "${DIR}/${VERSION}" | ||
docker push ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-catalog:bundle-"${VERSION}" | ||
|
||
docker build -t opm --build-arg ARCH=$ARCH -f "${DIR}/Dockerfile.opm" . | ||
|
||
docker run --rm -it \ | ||
--privileged \ | ||
-v /var/lib/docker:/var/lib/docker \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
opm:latest index add \ | ||
--container-tool docker \ | ||
--bundles ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-catalog:bundle-"${VERSION}" \ | ||
--tag ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-index:${VERSION} | ||
|
||
#push index | ||
docker push ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-index:${VERSION} |
6 changes: 6 additions & 0 deletions
6
config/operatorhub/flux-operator/testdata/001-flux-system-ns.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: flux-system | ||
spec: {} | ||
status: {} |
6 changes: 6 additions & 0 deletions
6
config/operatorhub/flux-operator/testdata/002-flux-system-og.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: operators.coreos.com/v1alpha2 | ||
kind: OperatorGroup | ||
metadata: | ||
name: flux-system-group | ||
namespace: flux-system | ||
|
14 changes: 14 additions & 0 deletions
14
config/operatorhub/flux-operator/testdata/003-catalog-source.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: CatalogSource | ||
metadata: | ||
name: custom | ||
namespace: flux-system | ||
spec: | ||
displayName: custom | ||
description: custom | ||
publisher: custom | ||
sourceType: grpc | ||
image: ghcr.io/controlplaneio-fluxcd/openshift-flux-operator-index:v0.3.0 | ||
updateStrategy: | ||
registryPoll: | ||
interval: 30m |
11 changes: 11 additions & 0 deletions
11
config/operatorhub/flux-operator/testdata/004-operator-subscription.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: operators.coreos.com/v1alpha1 | ||
kind: Subscription | ||
metadata: | ||
name: flux-subscription | ||
namespace: flux-system | ||
spec: | ||
channel: stable | ||
name: flux-operator | ||
startingCSV: flux-operator.v0.3.0 | ||
source: custom | ||
sourceNamespace: flux-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- 001-flux-system-ns.yaml | ||
- 002-flux-system-og.yaml | ||
- 003-catalog-source.yaml | ||
- 004-operator-subscription.yaml |
Oops, something went wrong.