From fc14356a7abf5129a0823432574fc33cb3253887 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:14:16 +0200 Subject: [PATCH 1/6] [makefile] Replacing `go get` by `go install` --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3e24181c..ee706885 100644 --- a/Makefile +++ b/Makefile @@ -150,7 +150,7 @@ ENVTEST = $(shell pwd)/bin/setup-envtest envtest: ## Download envtest-setup locally if necessary. $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) -# go-get-tool will 'go get' any package $2 and install it to $1. +# go-get-tool will 'go install' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) define go-get-tool @[ -f $(1) ] || { \ @@ -159,7 +159,7 @@ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ rm -rf $$TMP_DIR ;\ } endef From 66189042941c538181280754d491b796ca3047ac Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:15:59 +0200 Subject: [PATCH 2/6] =?UTF-8?q?[kustomize]=C2=A0Bumping=20kustomize=20vers?= =?UTF-8?q?ion=20to=20v4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee706885..48f55011 100644 --- a/Makefile +++ b/Makefile @@ -144,7 +144,7 @@ controller-gen: ## Download controller-gen locally if necessary. KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) + $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5) ENVTEST = $(shell pwd)/bin/setup-envtest envtest: ## Download envtest-setup locally if necessary. From a77788c93c8337d2bfffa566d3ab766e12034ed6 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:16:29 +0200 Subject: [PATCH 3/6] [operator-sdk] Bumping version to 1.22 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 48f55011..aba3d239 100644 --- a/Makefile +++ b/Makefile @@ -175,7 +175,7 @@ deploy-manifest: cd $(PROJECT_DIR)/config/manager && $(KUSTOMIZE) edit set image controller=${DEFAULT_IMG} OPERATOR_SDK = $(shell pwd)/bin/operator-sdk -OPERATOR_SDK_VERSION = v1.15.0 +OPERATOR_SDK_VERSION = v1.22.0 operator-sdk: ## Download operator-sdk locally if necessary. ./utils/install-operator-sdk.sh $(OPERATOR_SDK) $(OPERATOR_SDK_VERSION) From 1af15f5b4ae04d3d8132cf95aeee083f524781e0 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:19:21 +0200 Subject: [PATCH 4/6] [manifests] Updating manifests --- api/v1alpha1/zz_generated.deepcopy.go | 1 + config/deploy/manfiests.yaml | 16 ++++++++++++---- config/install/manifests.yaml | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index d4a48fff..1c5e9ec2 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/config/deploy/manfiests.yaml b/config/deploy/manfiests.yaml index c86810ef..cf9d0478 100644 --- a/config/deploy/manfiests.yaml +++ b/config/deploy/manfiests.yaml @@ -27,10 +27,14 @@ spec: description: Limitador is the Schema for the limitadors API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object @@ -79,10 +83,14 @@ spec: description: RateLimit is the Schema for the ratelimits API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object diff --git a/config/install/manifests.yaml b/config/install/manifests.yaml index 6cfb6a90..ba62f033 100644 --- a/config/install/manifests.yaml +++ b/config/install/manifests.yaml @@ -20,10 +20,14 @@ spec: description: Limitador is the Schema for the limitadors API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object @@ -72,10 +76,14 @@ spec: description: RateLimit is the Schema for the ratelimits API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' type: string kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' type: string metadata: type: object From ed9f94ed3eeaf59ffb62ada6bcd4553701232686 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:19:46 +0200 Subject: [PATCH 5/6] [bundle] Updating bundle --- bundle.Dockerfile | 2 +- .../manifests/limitador-operator.clusterserviceversion.yaml | 6 ++++-- bundle/metadata/annotations.yaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 03118443..27eb6820 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ LABEL operators.operatorframework.io.bundle.package.v1=limitador-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha -LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.14.0+git +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 diff --git a/bundle/manifests/limitador-operator.clusterserviceversion.yaml b/bundle/manifests/limitador-operator.clusterserviceversion.yaml index 4949240b..4997ae09 100644 --- a/bundle/manifests/limitador-operator.clusterserviceversion.yaml +++ b/bundle/manifests/limitador-operator.clusterserviceversion.yaml @@ -35,7 +35,7 @@ metadata: } ] capabilities: Basic Install - operators.operatorframework.io/builder: operator-sdk-v1.14.0+git + operators.operatorframework.io/builder: operator-sdk-v1.22.0 operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 name: limitador-operator.v0.0.0 namespace: placeholder @@ -147,7 +147,9 @@ spec: - create serviceAccountName: limitador-operator-controller-manager deployments: - - name: limitador-operator-controller-manager + - label: + control-plane: controller-manager + name: limitador-operator-controller-manager spec: replicas: 1 selector: diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index c9ed5268..5ee5e1b7 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -5,7 +5,7 @@ annotations: operators.operatorframework.io.bundle.metadata.v1: metadata/ operators.operatorframework.io.bundle.package.v1: limitador-operator operators.operatorframework.io.bundle.channels.v1: alpha - operators.operatorframework.io.metrics.builder: operator-sdk-v1.14.0+git + operators.operatorframework.io.metrics.builder: operator-sdk-v1.22.0 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 From 0a3df69caa680084e1b0ee1933da2fc14bb198f3 Mon Sep 17 00:00:00 2001 From: dd di cesare Date: Thu, 16 Jun 2022 12:43:27 +0200 Subject: [PATCH 6/6] [script] Replacing with env bash * This fixes on macos old default bash, which differs with brew install one --- utils/install-operator-sdk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/install-operator-sdk.sh b/utils/install-operator-sdk.sh index 3d6d025f..13e69ef2 100755 --- a/utils/install-operator-sdk.sh +++ b/utils/install-operator-sdk.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Install a version of the operator sdk. # https://sdk.operatorframework.io/docs/installation/#install-from-github-release