Skip to content

Commit

Permalink
Merge pull request #659 from spolti/patch-7.11.0-RHPAM-3763
Browse files Browse the repository at this point in the history
[RHPAM-3763] - Endless updating loop in Kie operator
  • Loading branch information
openshift-merge-robot authored Jun 23, 2021
2 parents 34add4a + 3c7d9cc commit 5521189
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,32 @@ docker push quay.io/kiegroup/kie-cloud-operator:<version>

## Deploy to OpenShift 4.5+ using OLM

To install this operator on OpenShift 4 for end-to-end testing, make sure you have access to a quay.io account to create an application repository. Follow the [authentication](https://github.com/operator-framework/operator-courier/#authentication) instructions for Operator Courier to obtain an account token. This token is in the form of "basic XXXXXXXXX" and both words are required for the command.
To install this operator on OpenShift 4 for end-to-end testing, make sure you have access to a quay.io account to create
an application repository. Follow the [authentication](https://github.com/operator-framework/operator-courier/#authentication)
instructions for Operator Courier to obtain an account token.
This token is in the form of "basic XXXXXXXXX" and both words are required for the command.

If pushing to another quay repository, replace _kiegroup_ with your username or other namespace. Also note that the push command does not overwrite an existing repository, and it needs to be deleted before a new version can be built and uploaded. Once the bundle has been uploaded, create an [Operator Source](https://github.com/operator-framework/community-operators/blob/master/docs/testing-operators.md#linking-the-quay-application-repository-to-your-openshift-40-cluster) to load your operator bundle in OpenShift.
If pushing to another quay repository, replace _kiegroup_ with your username or other namespace.
Also note that the push command does not overwrite an existing repository,
and it needs to be deleted before a new version can be built and uploaded.
Once the bundle has been uploaded, create an [Operator Source](https://github.com/operator-framework/community-operators/blob/master/docs/testing-operators.md#linking-the-quay-application-repository-to-your-openshift-40-cluster)
to load your operator bundle in OpenShift.

**Create your own index image**

Requires [opm](https://github.com/operator-framework/operator-registry/releases) v1.15.3+ -

```bash
$ make bundle-dev
USERNAME=tchughesiv
VERSION=$(go run getversion.go -csv)
IMAGE=quay.io/${USERNAME}/rhpam-operator-bundle
BUNDLE=${IMAGE}:${VERSION}
$ make bundle-dev


$ docker push ${BUNDLE}
BUNDLE_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${BUNDLE})
INDEX_VERSION=v4.6
INDEX_VERSION=v4.7
INDEX_IMAGE=quay.io/${USERNAME}/ba-operator-index:${INDEX_VERSION}
INDEX_FROM=${INDEX_IMAGE}_$(go run getversion.go -csvPrior)
INDEX_TO=${INDEX_IMAGE}_${VERSION}
Expand Down Expand Up @@ -68,11 +76,13 @@ spec:
EOF
```

It will take a few minutes for the operator to become visible under the _OperatorHub_ section of the OpenShift console _Catalog_. It can be easily found by filtering the provider type to _Custom_.
It will take a few minutes for the operator to become visible under the _OperatorHub_ section of the OpenShift console _Catalog_.
It can be easily found by filtering the provider type to _Custom_.

### Trigger a KieApp deployment

Use the OLM console to subscribe to the `Kie Cloud` Operator Catalog Source within your namespace. Once subscribed, use the console to `Create KieApp` or create one manually as seen below.
Use the OLM console to subscribe to the `Kie Cloud` Operator Catalog Source within your namespace. Once subscribed,
use the console to `Create KieApp` or create one manually as seen below.

```bash
$ oc create -f deploy/crs/v2/kieapp_rhpam_trial.yaml
Expand Down
7 changes: 5 additions & 2 deletions hack/go-build-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ if [[ ${LOCAL} != true ]]; then
fi
fi

echo ${CFLAGS}
echo "Cekit build flags : ${CFLAGS}"

OLMDIR=deploy/olm-catalog/prod
CSV=businessautomation-operator.clusterserviceversion.yaml
if [[ ${DEV} == true ]]; then
OLMDIR=deploy/olm-catalog/dev
BUNDLE_NAME=quay.io/tchughesiv/${BUNDLE}
BUNDLE_NAME=quay.io/${USERNAME}/${BUNDLE}
fi
VERDIR=${OLMDIR}/${CSVVERSION}

echo "Building bundle operator image version ${CSVVERSION}"


CRD=kieapp.crd.yaml
#if (( $(echo "${VERSION} 7.9.0" | awk '{print ($1 < $2)}') )); then
# CRD=kieapp.crd.v1beta1.yaml
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/kieapp/deploy_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func deployConsole(reconciler *Reconciler, operator *appsv1.Deployment) {
if semver.Compare(reconciler.OcpVersion, "v4.2") >= 0 || reconciler.OcpVersion == "" {
existing := &corev1.ConfigMap{}
new := getCaConfigMap(namespace)
new.SetOwnerReferences(operator.GetOwnerReferences())
controllerutil.SetOwnerReference(operator, new, scheme)
if err := reconciler.Service.Get(context.TODO(), types.NamespacedName{Name: new.Name, Namespace: new.Namespace}, existing); err != nil {
if errors.IsNotFound(err) {
log.Info("Creating ConfigMap ", new.Name)
Expand Down

0 comments on commit 5521189

Please sign in to comment.