3scale / apicast-operator

Apache License 2.0
8 stars 15 forks source link

THREESCALE-10869 Bump Go, controller-runtime, and k8s dependencies #208

Closed carlkyrillos closed 7 months ago

carlkyrillos commented 7 months ago

Issue Link

JIRA: THREESCALE-10869

What

This PR bumps a number of dependencies, the notable ones being:

NOTE: This PR doesn't bump the version of operator-sdk, that will be done in a separate PR.

Verification Steps

Prerequisites

  1. Go v1.20 - I recommend using the gvm CLI to quickly switch between Go versions
  2. Provisioned OSD cluster

Cluster Scoped Scenario

  1. Create the CatalogSource and install the operator (note: feel free to build your own images or use the ones provided)

    make bundle-run quay.io/ckyrillo/apicast-operator-bundles:threescale-10683
  2. Create a Namespace, config Secret, and APIcast CR:

    
    export NAMESPACE=apicast-test
    oc new-project $NAMESPACE

cat << EOF | oc create -f - apiVersion: v1 kind: Secret metadata: name: apicast-config-secret namespace: $NAMESPACE type: Opaque stringData: config.json: | { "services": [ { "proxy": { "policy_chain": [ { "name": "apicast.policy.upstream", "configuration": { "rules": [{ "regex": "/", "url": "http://echo-api.3scale.net" }] } } ] } } ] } EOF

cat << EOF | oc create -f - apiVersion: apps.3scale.net/v1alpha1 kind: APIcast metadata: name: example-apicast namespace: $NAMESPACE spec: embeddedConfigurationSecretRef: name: apicast-config-secret EOF


3. Verify the installation completes successfully:
```bash
oc get apicast -n $NAMESPACE -o yaml -w
  1. Verify that the APIcast gateway is running and available

    • First, port-forward the apicast service:
      oc port-forward svc/apicast-example-apicast 8080
    • Then curl the endpoint in a separate terminal and confirm you get a response:
      curl 127.0.0.1:8080/test -H "Host: localhost"
  2. Delete the test namespace to prepare for the namespace scoped scenario

    oc delete project $NAMESPACE
  3. Uninstall the cluster scoped operator to prepare for the namespace scoped scenario

Namespace Scoped Scenario

  1. Create a fresh Namespace, config Secret, and APIcast CR:
    
    export NAMESPACE=apicast-test
    oc new-project $NAMESPACE

cat << EOF | oc create -f - apiVersion: v1 kind: Secret metadata: name: apicast-config-secret namespace: $NAMESPACE type: Opaque stringData: config.json: | { "services": [ { "proxy": { "policy_chain": [ { "name": "apicast.policy.upstream", "configuration": { "rules": [{ "regex": "/", "url": "http://echo-api.3scale.net" }] } } ] } } ] } EOF

cat << EOF | oc create -f - apiVersion: apps.3scale.net/v1alpha1 kind: APIcast metadata: name: example-apicast namespace: $NAMESPACE spec: embeddedConfigurationSecretRef: name: apicast-config-secret EOF

2. Navigate to the `OperatorHub` in the OpenShift UI, search for `apicast`, and install the dev version the apicast-operator in the `apicast-test` Namespace.

3. Verify the installation completes successfully:
```bash
oc get apicast -n $NAMESPACE -o yaml -w
  1. Verify that the APIcast gateway is running and available
    • First, port-forward the apicast service:
      oc port-forward svc/apicast-example-apicast 8080
    • Then curl the endpoint in a separate terminal and confirm you get a response:
      curl 127.0.0.1:8080/test -H "Host: localhost"
carlkyrillos commented 7 months ago

/retest

eguzki commented 7 months ago

My main concern is the upgrade of controller-runtime beyond v0.15.0 as v0.15.0 introduced large list of breaking changed. I review them and nothing caught my eye. But second pair of :eye: would be very nice https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0

carlkyrillos commented 7 months ago

My main concern is the upgrade of controller-runtime beyond v0.15.0 as v0.15.0 introduced large list of breaking changed. I review them and nothing caught my eye. But second pair of 👁️ would be very nice https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0

@eguzki I reviewed every breaking change for every version from v0.12.2 to v0.16.5 and cross referenced them with the source code to ensure we weren't affected (or I included the fix to support the breaking change if we were affected). I did this when performing the 3scale-operator bump as well. That being said, more eyes reviewing it is always a good thing.

eguzki commented 7 months ago

this is getting pretty close to be merged.

Just one iteration more with few comments and we should be ready to merge.