Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

carlkyrillos
Copy link
Contributor

Issue Link

JIRA: THREESCALE-10869

What

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

  • go: 1.19 -> 1.20
  • ginkgo: 1.16.5 -> 2.13.0
  • client-go: 0.24.3 -> 0.28.3
  • apimachinery: 0.24.3 -> 0.28.3
  • controller-runtime: 0.12.2 -> 0.16.5

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
  1. 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
  1. Verify the installation completes successfully:
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"
  1. Delete the test namespace to prepare for the namespace scoped scenario
oc delete project $NAMESPACE
  1. 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
  1. Navigate to the OperatorHub in the OpenShift UI, search for apicast, and install the dev version the apicast-operator in the apicast-test Namespace.

  2. Verify the installation completes successfully:

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
Copy link
Contributor Author

/retest

@carlkyrillos carlkyrillos force-pushed the THREESCALE-10869 branch 2 times, most recently from cc9106e to a9de498 Compare March 14, 2024 14:59
Copy link
Member

@eguzki eguzki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, some changes requested but I could be wrong

Makefile Show resolved Hide resolved
controllers/apps/apicast_controller.go Outdated Show resolved Hide resolved
controllers/apps/suite_test.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@eguzki
Copy link
Member

eguzki commented Mar 14, 2024

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

@carlkyrillos
Copy link
Contributor Author

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.

@carlkyrillos carlkyrillos force-pushed the THREESCALE-10869 branch 2 times, most recently from 1724609 to 1e43754 Compare March 15, 2024 20:19
main.go Outdated Show resolved Hide resolved
@eguzki
Copy link
Member

eguzki commented Mar 18, 2024

this is getting pretty close to be merged.

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

Copy link
Member

@eguzki eguzki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job! 🏅

@carlkyrillos carlkyrillos merged commit 19a99cd into 3scale:master Mar 18, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants