Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2.57 KB

contribute-operator-to-kubernetes.md

File metadata and controls

87 lines (61 loc) · 2.57 KB

Contribute the latest operator version to Kubernetes

Start by deleting the previous operator bundle in your OpenShift Local cluster.

oc -n keycloak delete catalogsource/keycloak-permissions-operator-catalog
oc -n keycloak delete subscription -l operators.coreos.com/keycloak-permissions-operator.keycloak=''
oc -n keycloak delete csv -l operators.coreos.com/keycloak-permissions-operator.keycloak=''

Set up reusable Operator Bundle environment variables

export USERNAME=computate
export VERSION=1.4.1
export IMG=quay.io/nerc-images/keycloak-permissions-operator:$VERSION
export BUNDLE_IMG=quay.io/nerc-images/keycloak-permissions-operator-bundle:$VERSION

Update the Operator version in the MakeFile and ClusterServiceVersion

perl -pi -e 's/^(VERSION \?= ).*/${1}'"$VERSION"'/g' Makefile
perl -pi -e 's/(containerImage: quay\.io\/nerc-images\/keycloak-permissions-operator:).*/${1}'"$VERSION"'/g' \
  config/manifests/bases/keycloak-permissions-operator.clusterserviceversion.yaml

Build and validate the latest Operator Bundle

make podman-build podman-push
make bundle
make bundle-build bundle-push
operator-sdk bundle validate $BUNDLE_IMG

Deploy the latest Operator bundle to OpenShift Local cluster for testing

operator-sdk -n keycloak run bundle $BUNDLE_IMG --security-context-config restricted

Contribute latest Operator version to operatorhub.io

Fork the k8s-operatorhub/community-operators repo

Clone the k8s-operatorhub/community-operators repo

  • Clone your community-operators fork repository.
git clone [email protected]:computate/community-operators.git ~/.local/src/community-operators/

Set up the community-operators upstream remote

cd ~/.local/src/community-operators/
git remote add upstream [email protected]:k8s-operatorhub/community-operators.git

Create a new branch for your version

git checkout -b keycloak-permissions-operator-$VERSION

Rsync latest version of the operator to community-operators

mkdir -p ~/.local/src/community-operators/operators/keycloak-permissions-operator/$VERSION/
rsync -r bundle/ ~/.local/src/community-operators/operators/keycloak-permissions-operator/$VERSION/

Commit your changes

  • Git add and git commit your changes.
  • Be sure to include your signature: Signed-off-by: My Name <[email protected]>
  • Make a pull request with the gh CLI.

Contribute the operator to operatorhub.io

gh pr create -f