From d9c722f4b28db8c151023b5ba07a5d384a2458dd Mon Sep 17 00:00:00 2001 From: Jakub Warczarek Date: Tue, 16 Apr 2024 17:55:12 +0200 Subject: [PATCH] chore(bundle): get rid of bundle (operator-sdk) and fix paths --- .tools_versions.yaml | 2 -- Makefile | 11 ++--------- config/samples/kustomization.yaml | 2 +- controllers/dataplane/controller_utils.go | 2 +- controllers/pkg/controlplane/controlplane.go | 2 +- modules/manager/webhook.go | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.tools_versions.yaml b/.tools_versions.yaml index f42e0c73f..588591e0e 100644 --- a/.tools_versions.yaml +++ b/.tools_versions.yaml @@ -10,8 +10,6 @@ golangci-lint: "1.57.2" skaffold: "2.11.1" # renovate: datasource=github-releases depName=go-delve/delve dlv: "1.22.1" -# renovate: datasource=github-releases depName=operator-framework/operator-sdk -operator-sdk: "1.23.0" # renovate: datasource=github-releases depName=mikefarah/yq yq: "4.43.1" # renovate: datasource=github-releases depName=gotestyourself/gotestsum diff --git a/Makefile b/Makefile index 213cfb31e..1d1783c26 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ endif PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -TOOLS_VERSIONS_FILE = .tools_versions.yaml +TOOLS_VERSIONS_FILE = $(PROJECT_DIR)/.tools_versions.yaml .PHONY: tools tools: kic-role-generator controller-gen kustomize client-gen golangci-lint gotestsum skaffold yq crd-ref-docs @@ -54,7 +54,7 @@ KIC_WEBHOOKCONFIG_GENERATOR = $(PROJECT_DIR)/bin/kic-webhook-config-generator kic-webhook-config-generator: ( cd ./hack/generators/kic/webhook-config-generator && go build -o $(KIC_WEBHOOKCONFIG_GENERATOR) . ) -export MISE_DATA_DIR = bin/ +export MISE_DATA_DIR = $(PROJECT_DIR)/bin/ CONTROLLER_GEN_VERSION = $(shell yq -ojson -r '.controller-tools' < $(TOOLS_VERSIONS_FILE)) CONTROLLER_GEN = $(PROJECT_DIR)/bin/installs/kube-controller-tools/$(CONTROLLER_GEN_VERSION)/bin/controller-gen @@ -84,13 +84,6 @@ golangci-lint: mise ## Download golangci-lint locally if necessary. @$(MISE) plugin install --yes -q golangci-lint @$(MISE) install -q golangci-lint@$(GOLANGCI_LINT_VERSION) -OPERATOR_SDK_VERSION = $(shell yq -ojson -r '.operator-sdk' < $(TOOLS_VERSIONS_FILE)) -OPERATOR_SDK = $(PROJECT_DIR)/bin/installs/operator-sdk/$(OPERATOR_SDK_VERSION)/bin/operator-sdk -.PHONY: operator-sdk -operator-sdk: mise ## Download operator-sdk locally if necessary. - @$(MISE) plugin install --yes -q operator-sdk https://github.com/Medium/asdf-operator-sdk.git - @$(MISE) install -q operator-sdk@$(OPERATOR_SDK_VERSION) - GOTESTSUM_VERSION = $(shell yq -ojson -r '.gotestsum' < $(TOOLS_VERSIONS_FILE)) GOTESTSUM = $(PROJECT_DIR)/bin/installs/gotestsum/$(GOTESTSUM_VERSION)/bin/gotestsum .PHONY: gotestsum diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 0e13fd255..6f994988a 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -6,7 +6,7 @@ resources: - gateway.yaml - gatewayconfiguration.yaml - controlplane.yaml -# NOTE: Exclude AIGateway sample becuase it's not included in the bundle yet +# NOTE: Exclude AIGateway sample because it's not included in the bundle yet # and that causes the following bundle generation error: # /Users/patryk.malek@konghq.com/code_/gateway-operator-enterprise/gateway-operator/bin/operator-sdk bundle validate bundle --select-optional suite=operatorframework # ERRO[0000] Error: Value gateway-operator.konghq.com/v1alpha1, Kind=AIGateway: CRD "gateway-operator.konghq.com/v1alpha1, Kind=AIGateway" is present in bundle "kong-gateway-operator.v1.2.0-alpha.2" but not defined in CSV diff --git a/controllers/dataplane/controller_utils.go b/controllers/dataplane/controller_utils.go index 5882021ec..45977b43e 100644 --- a/controllers/dataplane/controller_utils.go +++ b/controllers/dataplane/controller_utils.go @@ -45,7 +45,7 @@ func generateDataPlaneImage(dataplane *operatorv1beta1.DataPlane, defaultImage s if relatedKongImage := os.Getenv("RELATED_IMAGE_KONG"); relatedKongImage != "" { // RELATED_IMAGE_KONG is set by the operator-sdk when building the operator bundle. - // https://github.com/Kong/gateway-operator/issues/261 + // https://github.com/Kong/gateway-operator-archive/issues/261 return relatedKongImage, nil } diff --git a/controllers/pkg/controlplane/controlplane.go b/controllers/pkg/controlplane/controlplane.go index 7bc7ccb68..8f83b3dcf 100644 --- a/controllers/pkg/controlplane/controlplane.go +++ b/controllers/pkg/controlplane/controlplane.go @@ -224,7 +224,7 @@ func GenerateImage(opts *operatorv1beta1.ControlPlaneOptions, validators ...vers if relatedKongControllerImage := os.Getenv("RELATED_IMAGE_KONG_CONTROLLER"); relatedKongControllerImage != "" { // RELATED_IMAGE_KONG_CONTROLLER is set by the operator-sdk when building the operator bundle. - // https://github.com/Kong/gateway-operator/issues/261 + // https://github.com/Kong/gateway-operator-archive/issues/261 return relatedKongControllerImage, nil } diff --git a/modules/manager/webhook.go b/modules/manager/webhook.go index 6814b5b0d..fd52d5fc4 100644 --- a/modules/manager/webhook.go +++ b/modules/manager/webhook.go @@ -259,7 +259,7 @@ func (m *webhookManager) createCertificateConfigJobs(ctx context.Context) error jobCertificateConfigImage := consts.WebhookCertificateConfigBaseImage if relatedJobImage := os.Getenv("RELATED_IMAGE_CERTIFICATE_CONFIG"); relatedJobImage != "" { // RELATED_IMAGE_CERTIFICATE_CONFIG is set by the operator-sdk when building the operator bundle. - // https://github.com/Kong/gateway-operator/issues/261 + // https://github.com/Kong/gateway-operator-archive/issues/261 jobCertificateConfigImage = relatedJobImage } job := k8sresources.GenerateNewWebhookCertificateConfigJob(