Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Update Golang dependencies (#292)
Browse files Browse the repository at this point in the history
Resolves: #291
Resolves: #293

Signed-off-by: Sergio Arroutbi <[email protected]>
  • Loading branch information
sarroutbi authored May 7, 2024
1 parent a9a3889 commit afbbe8f
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 112 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.7'
go-version: '1.22.2'

- name: Build
run: make build
Expand All @@ -43,5 +43,5 @@ jobs:
- name: Deploy and Scorecard
run: |
sh .github/workflows/scripts/retrieve_and_run_operator_sdk.sh \
"v1.32.0" "5m" "quay.io/sec-eng-special/tang-operator-bundle" \
"v1.33.0" "5m" "quay.io/sec-eng-special/tang-operator-bundle" \
"${GITHUB_HEAD_REF}"
4 changes: 2 additions & 2 deletions .github/workflows/scripts/retrieve_and_run_operator_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
set -x -e

OPERATOR_SDK_DEFAULT_RELEASE_VERSION="v1.32.0"
OPERATOR_SDK_DEFAULT_RELEASE_VERSION="v1.33.0"
DEFAULT_BUNDLE_IMG="quay.io/sec-eng-special/tang-operator-bundle"
DEFAULT_TIMEOUT="5m"
DEFAULT_GITHUB_BRANCH="main"
Expand Down Expand Up @@ -101,6 +101,6 @@ mv "operator-sdk_${OS}_${ARCH}" "$(pwd)/operator-sdk"
chmod +x "$(pwd)/operator-sdk"
"$(pwd)"/operator-sdk olm install --timeout "${TIMEOUT}"
"$(pwd)"/operator-sdk olm status
"$(pwd)"/operator-sdk run bundle --timeout "${TIMEOUT}" "${BUNDLE_IMG_VERSION}"
"$(pwd)"/operator-sdk run bundle --verbose --timeout "${TIMEOUT}" "${BUNDLE_IMG_VERSION}"
"$(pwd)"/operator-sdk olm status
"$(pwd)"/operator-sdk scorecard --wait-time="${TIMEOUT}" "${BUNDLE_IMG_VERSION}"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.0.8
VERSION ?= 1.0.9

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: redhat.com
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
Expand Down
122 changes: 61 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Tang operator-bundle are:
- v1.0.6: GA release. Fix Url to URL in CRD. GA Released Version in OpenShift
- v1.0.7: GA re-release. Fix channel ("alpha" to "stable")
- v1.0.8: ServiceType / ClusterIP configuration through TangServer CR
- v1.0.9: Golang dependencies update

## Installation

Expand All @@ -116,23 +117,23 @@ operator-sdk installation is described in the [Links](#links) section.

In order to deploy the latest version of the Tang operator, check latest released
version in the [Versions](#versions) section, and install the appropriate version
bundle. For example, in case latest version is **1.0.8**, the command to execute
bundle. For example, in case latest version is **1.0.9**, the command to execute
will be:

```bash
$ operator-sdk run bundle quay.io/sec-eng-special/tang-operator-bundle:v1.0.8
INFO[0008] Successfully created registry pod: quay-io-sec-eng-special-tang-operator-bundle-v1.0.8
$ operator-sdk run bundle quay.io/sec-eng-special/tang-operator-bundle:v1.0.9
INFO[0008] Successfully created registry pod: quay-io-sec-eng-special-tang-operator-bundle-v1.0.9
INFO[0009] Created CatalogSource: tang-operator-catalog
INFO[0009] OperatorGroup "operator-sdk-og" created
INFO[0009] Created Subscription: tang-operator-v1.0.8-sub
INFO[0011] Approved InstallPlan install-lqf9f for the Subscription: tang-operator-v1.0.8-sub
INFO[0009] Created Subscription: tang-operator-v1.0.9-sub
INFO[0011] Approved InstallPlan install-lqf9f for the Subscription: tang-operator-v1.0.9-sub
INFO[0011] Waiting for ClusterServiceVersion to reach 'Succeeded' phase
INFO[0012] Waiting for ClusterServiceVersion "default/tang-operator.v1.0.8"
INFO[0018] Found ClusterServiceVersion "default/tang-operator.v1.0.8" phase: Pending
INFO[0020] Found ClusterServiceVersion "default/tang-operator.v1.0.8" phase: InstallReady
INFO[0021] Found ClusterServiceVersion "default/tang-operator.v1.0.8" phase: Installing
INFO[0031] Found ClusterServiceVersion "default/tang-operator.v1.0.8" phase: Succeeded
INFO[0031] OLM has successfully installed "tang-operator.v1.0.8"
INFO[0012] Waiting for ClusterServiceVersion "default/tang-operator.v1.0.9"
INFO[0018] Found ClusterServiceVersion "default/tang-operator.v1.0.9" phase: Pending
INFO[0020] Found ClusterServiceVersion "default/tang-operator.v1.0.9" phase: InstallReady
INFO[0021] Found ClusterServiceVersion "default/tang-operator.v1.0.9" phase: Installing
INFO[0031] Found ClusterServiceVersion "default/tang-operator.v1.0.9" phase: Succeeded
INFO[0031] OLM has successfully installed "tang-operator.v1.0.9"
```
To install latest multi-arch image, execute:
```bash
Expand All @@ -148,10 +149,10 @@ your cluster takes long time to deploy. To do so, the option **--timeout** can b
used (if not used, default time is 2m, which stands for two minutes):

```bash
$ operator-sdk run bundle --timeout 3m quay.io/sec-eng-special/tang-operator-bundle:v1.0.8
INFO[0008] Successfully created registry pod: quay-io-sec-eng-special-tang-operator-bundle-v1.0.8
$ operator-sdk run bundle --timeout 3m quay.io/sec-eng-special/tang-operator-bundle:v1.0.9
INFO[0008] Successfully created registry pod: quay-io-sec-eng-special-tang-operator-bundle-v1.0.9
...
INFO[0031] OLM has successfully installed "tang-operator.v1.0.8"
INFO[0031] OLM has successfully installed "tang-operator.v1.0.9"
```

Additionally, correct Tang operator installation can be observed if an output like
Expand All @@ -161,7 +162,7 @@ the following is observed when prompting for installed pods:
$ oc get pods
NAME READY STATUS RESTARTS AGE
dbbd1837106ec169542546e7ad251b95d27c3542eb0409c1e 0/1 Completed 0 82s
quay-io-tang-operator-bundle-v1.0.8 1/1 Running 0 90s
quay-io-tang-operator-bundle-v1.0.9 1/1 Running 0 90s
tang-operator-controller-manager-5c9488d8dd-mgmsf 2/2 Running 0 52s
```

Expand Down Expand Up @@ -199,8 +200,7 @@ Note the **Running** state for the `tangserver` pods.
## Compilation

Requirements for tang-operator compilation is as follows:
* Go compiler (v1.19.6+). Recommended version: v1.21.7. **v1.22.0 does not work** (yet), possibly
due to this [issue](https://github.com/golang/go/issues/64812).
* Go compiler (v1.19.6+). Recommended version: v1.22.2.
* Docker (v24.0.7+ recommended). Podman (v4.9.0+ recommended) can be used as an alternative to Docker.

Compilation of Tang operator needs to be performed in top directory, by executing
Expand All @@ -212,33 +212,33 @@ to be released, it is recommended to increase version appropriately.
In this case, same version is used. Last released version can be observed in
[Versions](#versions) section.

To summarize, taking into account that the last released version is **v1.0.8**,
To summarize, taking into account that the last released version is **v1.0.9**,
compilation can be done with next command:

```bash
$ make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
...
Successfully built 4a88ba8e6426
Successfully tagged sec-eng-special/tang-operator:v1.0.8
docker push sec-eng-special/tang-operator:v1.0.8
Successfully tagged sec-eng-special/tang-operator:v1.0.9
docker push sec-eng-special/tang-operator:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator]
7910991.0.8a: Pushed
7910991.0.9a: Pushed
417cb9b79ade: Layer already exists
v1.0.8: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
v1.0.9: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
```

It is possible to use `podman` instead of `docker`:

```bash
$ make podman-build podman-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make podman-build podman-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
...
Successfully built 4a88ba8e6426
Successfully tagged sec-eng-special/tang-operator:v1.0.8
podman push sec-eng-special/tang-operator:v1.0.8
Successfully tagged sec-eng-special/tang-operator:v1.0.9
podman push sec-eng-special/tang-operator:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator]
7910991.0.8a: Pushed
7910991.0.9a: Pushed
417cb9b79ade: Layer already exists
v1.0.8: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
v1.0.9: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
```

In case a new release is planned to be done, the steps to follow will be:
Expand All @@ -248,29 +248,29 @@ In case a new release is planned to be done, the steps to follow will be:
```bash
$ git diff Makefile
diff --git a/Makefile b/Makefile
index 9a41c6a..db12a82 1.0.84
index 9a41c6a..db12a82 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
# To re-generate a bundle for another specific version without changing the
# standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=1.0.8)
# - use environment variables to overwrite this value (e.g export VERSION=1.0.8)
-VERSION ?= 1.0.6
+VERSION ?= 1.0.8
# - use the VERSION as arg of the bundle target (e.g. make bundle VERSION=1.0.9)
# - use environment variables to overwrite this value (e.g. export VERSION=1.0.9)
-VERSION ?= 1.0.8
+VERSION ?= 1.0.9
```

Apart from previous changes, it is recommended to generate a "latest" tag for tang-operator bundle:

```bash
$ docker tag quay.io/sec-eng-special/tang-operator-bundle:v1.0.8 quay.io/sec-eng-special/tang-operator-bundle:latest
$ docker tag quay.io/sec-eng-special/tang-operator-bundle:v1.0.9 quay.io/sec-eng-special/tang-operator-bundle:latest
$ docker push quay.io/sec-eng-special/tang-operator-bundle:latest
```

In case `podman` is being used:

```bash
$ podman tag quay.io/sec-eng-special/tang-operator-bundle:v1.0.8 quay.io/sec-eng-special/tang-operator-bundle:latest
$ podman tag quay.io/sec-eng-special/tang-operator-bundle:v1.0.9 quay.io/sec-eng-special/tang-operator-bundle:latest
$ podman push quay.io/sec-eng-special/tang-operator-bundle:latest
```

Expand All @@ -280,28 +280,28 @@ Compile Tang operator code, specifying new version,
by using **make docker-build** command:

```bash
$ make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
...
Successfully tagged sec-eng-special/tang-operator:v1.0.8
docker push sec-eng-special/tang-operator:v1.0.8
Successfully tagged sec-eng-special/tang-operator:v1.0.9
docker push sec-eng-special/tang-operator:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator]
9ff8a4099c67: Pushed
417cb9b79ade: Layer already exists
v1.0.8: digest: sha256:01620ab19faae54fb382a2ff285f589cf0bde6e168f14f07 size: 739
v1.0.9: digest: sha256:01620ab19faae54fb382a2ff285f589cf0bde6e168f14f07 size: 739
```

And, in case `podman` is being used instead of `docker`:

```bash
$ make podman-build podman-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make podman-build podman-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
...
Successfully built 4a88ba8e6426
Successfully tagged sec-eng-special/tang-operator:v1.0.8
podman push sec-eng-special/tang-operator:v1.0.8
Successfully tagged sec-eng-special/tang-operator:v1.0.9
podman push sec-eng-special/tang-operator:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator]
7910991.0.8a: Pushed
7910991.0.9a: Pushed
417cb9b79ade: Layer already exists
v1.0.8: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
v1.0.9: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
```

- <ins>Bundle push</ins>:
Expand All @@ -311,15 +311,15 @@ the bundle with **make bundle**, specifying appropriate image,
and push it with **make bundle-build bundle-push**:

```bash
$ make bundle IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make bundle-build bundle-push BUNDLE_IMG="quay.io/sec-eng-special/tang-operator-bundle:v1.0.8"
$ make bundle IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
$ make bundle-build bundle-push BUNDLE_IMG="quay.io/sec-eng-special/tang-operator-bundle:v1.0.9"
...
docker push sec-eng-special/tang-operator-bundle:v1.0.8
docker push sec-eng-special/tang-operator-bundle:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator-bundle]
02e3768cfc56: Pushed
df0c8060d328: Pushed
84774958bcf4: Pushed
v1.0.8: digest: sha256:925c2f844f941db2b53ce45cba9db7ee0be613321da8f0f05d size: 939
v1.0.9: digest: sha256:925c2f844f941db2b53ce45cba9db7ee0be613321da8f0f05d size: 939
make[1]: Leaving directory '/home/user/RedHat/TASKS/TANG_OPERATOR/tang-operator'
```

Expand All @@ -328,15 +328,15 @@ In case the operator bundle is required to be pushed, generate the bundle with *
specifying appropriate image, and push it with **make podman-bundle-build podman-bundle-push**:

```bash
$ make bundle IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ make podman-bundle-build podman-bundle-push BUNDLE_IMG="quay.io/sarroutb/tang-operator-bundle:v1.0.8"
$ make bundle IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
$ make podman-bundle-build podman-bundle-push BUNDLE_IMG="quay.io/sarroutb/tang-operator-bundle:v1.0.9"
...
podman push sec-eng-special/tang-operator-bundle:v1.0.8
podman push sec-eng-special/tang-operator-bundle:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator-bundle]
02e3768cfc56: Pushed
df0c8060d328: Pushed
84774958bcf4: Pushed
v1.0.8: digest: sha256:925c2f844f941db2b53ce45cba9db7ee0be613321da8f0f05d size: 939
v1.0.9: digest: sha256:925c2f844f941db2b53ce45cba9db7ee0be613321da8f0f05d size: 939
make[1]: Leaving directory '/home/user/RedHat/TASKS/TANG_OPERATOR/tang-operator'
```

Expand Down Expand Up @@ -376,15 +376,15 @@ In order to cross compile tang-operator, prepend **GOARCH** with required archit
**make docker-build**:

```bash
$ GOARCH=ppc64le make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.8"
$ GOARCH=ppc64le make docker-build docker-push IMG="quay.io/sec-eng-special/tang-operator:v1.0.9"
...
Successfully built 4a88ba8e6426
Successfully tagged sec-eng-special/tang-operator:v1.0.8
docker push sec-eng-special/tang-operator:v1.0.8
Successfully tagged sec-eng-special/tang-operator:v1.0.9
docker push sec-eng-special/tang-operator:v1.0.9
The push refers to repository [quay.io/sec-eng-special/tang-operator]
7910991.0.8a: Pushed
7910991.0.9a: Pushed
417cb9b79ade: Layer already exists
v1.0.8: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
v1.0.9: digest: sha256:c97bed08ab71556542602b008888bdf23ce4afd86228a07 size: 739
```
Examples of architectures to cross-compile are:
* `ppc64le`
Expand All @@ -401,9 +401,9 @@ recommended way:

```bash
$ operator-sdk cleanup tang-operator
INFO[0001] subscription "tang-operator-v1.0.8-sub" deleted
INFO[0001] subscription "tang-operator-v1.0.9-sub" deleted
INFO[0001] customresourcedefinition "tangservers.daemons.redhat.com" deleted
INFO[0002] clusterserviceversion "tang-operator.v1.0.8" deleted
INFO[0002] clusterserviceversion "tang-operator.v1.0.9" deleted
INFO[0002] catalogsource "tang-operator-catalog" deleted
INFO[0002] operatorgroup "operator-sdk-og" deleted
INFO[0002] Operator "tang-operator" uninstalled
Expand Down Expand Up @@ -493,7 +493,7 @@ However, scorecard tests can be executed manually. In order to execute these tes
run next command:

```bash
$ operator-sdk scorecard -w 60s quay.io/sec-eng-special/tang-operator-bundle:v1.0.8
$ operator-sdk scorecard -w 60s quay.io/sec-eng-special/tang-operator-bundle:v1.0.9
...
Results:
Name: olm-status-descriptors
Expand All @@ -520,7 +520,7 @@ Name: olm-bundle-validation
State: pass
```

As it can be observed, execution of operator-sdk scorecard tests are passing successfully in latest released version (v1.0.8).
As it can be observed, execution of operator-sdk scorecard tests are passing successfully in latest released version (v1.0.9).

## Links

Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL operators.operatorframework.io.bundle.package.v1=tang-operator
LABEL operators.operatorframework.io.bundle.channels.v1=stable
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.33.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4

# Labels for testing.
LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1
Expand Down
10 changes: 5 additions & 5 deletions bundle/manifests/tang-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2024-03-28T10:31:23Z"
createdAt: "2024-05-07T08:38:26Z"
operators.operatorframework.io/builder: operator-sdk-v1.33.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
name: tang-operator.v1.0.8
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
name: tang-operator.v1.0.9
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -328,7 +328,7 @@ spec:
- --leader-elect
command:
- /manager
image: quay.io/sec-eng-special/tang-operator:v1.0.8
image: quay.io/sec-eng-special/tang-operator:v1.0.9
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -411,4 +411,4 @@ spec:
maturity: alpha
provider:
name: Red Hat
version: 1.0.8
version: 1.0.9
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ annotations:
operators.operatorframework.io.bundle.channels.v1: stable
operators.operatorframework.io.metrics.builder: operator-sdk-v1.33.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4

# Annotations for testing.
operators.operatorframework.io.test.mediatype.v1: scorecard+v1
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/sec-eng-special/tang-operator
newTag: v1.0.8
newTag: v1.0.9
Loading

0 comments on commit afbbe8f

Please sign in to comment.