diff --git a/Makefile b/Makefile index 2b80d192..16d5bc56 100644 --- a/Makefile +++ b/Makefile @@ -1,51 +1,3 @@ -# VERSION defines the project version for the bundle. -# Update this value when you upgrade the version of your project. -# 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 ?= 0.0.1 - -# 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") -# To re-generate a bundle for other specific channels without changing the standard setup, you can: -# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=candidate,fast,stable) -# - use environment variables to overwrite this value (e.g export CHANNELS="candidate,fast,stable") -ifneq ($(origin CHANNELS), undefined) -BUNDLE_CHANNELS := --channels=$(CHANNELS) -endif - -# DEFAULT_CHANNEL defines the default channel used in the bundle. -# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable") -# To re-generate a bundle for any other default channel without changing the default setup, you can: -# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable) -# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable") -ifneq ($(origin DEFAULT_CHANNEL), undefined) -BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL) -endif -BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) - -# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images. -# This variable is used to construct full image tags for bundle and catalog images. -# -# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both -# aiven.io/kubernetes-operator-bundle:$VERSION and aiven.io/k8s-exp-catalog:$VERSION. -IMAGE_TAG_BASE ?= aiven.io/kubernetes-operator - -# BUNDLE_IMG defines the image:tag used for the bundle. -# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) -BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION) - -# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command -BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) - -# USE_IMAGE_DIGESTS defines if images are resolved via tags or digests -# You can enable this value if you would like to use SHA Based Digests -# To enable set flag to true -USE_IMAGE_DIGESTS ?= false -ifeq ($(USE_IMAGE_DIGESTS), true) - BUNDLE_GEN_FLAGS += --use-image-digests -endif - # Image URL to use all building/pushing image targets IMG_TAG ?= $(shell git rev-parse HEAD) IMG ?= aivenoy/aiven-operator:${IMG_TAG} @@ -231,68 +183,6 @@ golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. $(GOLANGCI_LINT): $(LOCALBIN) $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION}) -.PHONY: bundle -bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files. - operator-sdk generate kustomize manifests -q - cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) - $(KUSTOMIZE) build config/manifests | operator-sdk generate bundle $(BUNDLE_GEN_FLAGS) - operator-sdk bundle validate ./bundle - -.PHONY: bundle-build -bundle-build: ## Build the bundle image. - $(CONTAINER_TOOL) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . - -.PHONY: bundle-push -bundle-push: ## Push the bundle image. - $(MAKE) docker-push IMG=$(BUNDLE_IMG) - -.PHONY: opm -OPM = ./bin/opm -opm: ## Download opm locally if necessary. -ifeq (,$(wildcard $(OPM))) -ifeq (,$(shell which opm 2>/dev/null)) - @{ \ - set -e ;\ - mkdir -p $(dir $(OPM)) ;\ - OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ - curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\ - chmod +x $(OPM) ;\ - } -else -OPM = $(shell which opm) -endif -endif - -# A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). -# These images MUST exist in a registry and be pull-able. -BUNDLE_IMGS ?= $(BUNDLE_IMG) - -# The image tag given to the resulting catalog image (e.g. make catalog-build CATALOG_IMG=example.com/operator-catalog:v0.2.0). -CATALOG_IMG ?= $(IMAGE_TAG_BASE)-catalog:v$(VERSION) - -# Set CATALOG_BASE_IMG to an existing catalog image tag to add $BUNDLE_IMGS to that image. -ifneq ($(origin CATALOG_BASE_IMG), undefined) -FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG) -endif - -# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'. -# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see: -# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator -.PHONY: catalog-build -catalog-build: opm ## Build a catalog image. - $(OPM) index add --container-tool $(CONTAINER_TOOL) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) - -# Push the catalog image. -.PHONY: catalog-push -catalog-push: ## Push a catalog image. - $(MAKE) docker-push IMG=$(CATALOG_IMG) - -.PHONY: build-manifests -build-manifests: manifests kustomize - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - mkdir -p releases - $(KUSTOMIZE) build config/default > releases/aiven-operator-${IMG_TAG}.yaml - .PHONY: e2e-setup-kind WEBHOOKS_ENABLED ?= true CERT_MANAGER_TAG ?= v1.11.0 diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml deleted file mode 100644 index 6a6b0180..00000000 --- a/config/manifests/kustomization.yaml +++ /dev/null @@ -1,25 +0,0 @@ -# These resources constitute the fully configured set of manifests -# used to generate the 'manifests/' directory in a bundle. -resources: - - ../default - - ../samples - - ../scorecard -# [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. -# Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. -# These patches remove the unnecessary "cert" volume and its manager container volumeMount. -#patchesJson6902: -#- target: -# group: apps -# version: v1 -# kind: Deployment -# name: controller-manager -# namespace: system -# patch: |- -# # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. -# # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment. -# - op: remove -# path: /spec/template/spec/containers/1/volumeMounts/0 -# # Remove the "cert" volume, since OLM will create and mount a set of certs. -# # Update the indices in this path if adding or removing volumes in the manager's Deployment. -# - op: remove -# path: /spec/template/spec/volumes/0 diff --git a/config/operatorhub/manifests/bases/aiven-operator.clusterserviceversion.yaml b/config/operatorhub/manifests/bases/aiven-operator.clusterserviceversion.yaml deleted file mode 100644 index b11a9337..00000000 --- a/config/operatorhub/manifests/bases/aiven-operator.clusterserviceversion.yaml +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: ClusterServiceVersion -metadata: - annotations: - alm-examples: "[]" - capabilities: Basic Install - categories: Cloud Provider - repository: https://github.com/aiven/aiven-operator - support: aiven - name: aiven-operator - namespace: placeholder -spec: - apiservicedefinitions: {} - customresourcedefinitions: - owned: - - description: ConnectionPool is the Schema for the connectionpools API - displayName: Connection Pool - kind: ConnectionPool - name: connectionpools.aiven.io - version: v1alpha1 - - description: Database is the Schema for the databases API - displayName: Database - kind: Database - name: databases.aiven.io - version: v1alpha1 - - description: KafkaACL is the Schema for the kafkaacls API - displayName: Kafka ACL - kind: KafkaACL - name: kafkaacls.aiven.io - version: v1alpha1 - - description: KafkaConnector is the Schema for the kafkaconnectors API - displayName: Kafka Connector - kind: KafkaConnector - name: kafkaconnectors.aiven.io - version: v1alpha1 - - description: KafkaConnect is the Schema for the kafkaconnects API - displayName: Kafka Connect - kind: KafkaConnect - name: kafkaconnects.aiven.io - version: v1alpha1 - - description: Kafka is the Schema for the kafkas API - displayName: Kafka - kind: Kafka - name: kafkas.aiven.io - version: v1alpha1 - - description: KafkaSchema is the Schema for the kafkaschemas API - displayName: Kafka Schema - kind: KafkaSchema - name: kafkaschemas.aiven.io - version: v1alpha1 - - description: KafkaTopic is the Schema for the kafkatopics API - displayName: Kafka Topic - kind: KafkaTopic - name: kafkatopics.aiven.io - version: v1alpha1 - - description: PostgreSQL is the Schema for the postgresql API - displayName: Postgre SQL - kind: PostgreSQL - name: postgresqls.aiven.io - version: v1alpha1 - - description: Project is the Schema for the projects API - displayName: Project - kind: Project - name: projects.aiven.io - version: v1alpha1 - - description: ProjectVPC is the Schema for the projectvpcs API - displayName: Project VPC - kind: ProjectVPC - name: projectvpcs.aiven.io - version: v1alpha1 - - description: ServiceIntegration is the Schema for the serviceintegrations API - displayName: Service Integration - kind: ServiceIntegration - name: serviceintegrations.aiven.io - version: v1alpha1 - - description: ServiceUser is the Schema for the serviceusers API - displayName: Service User - kind: ServiceUser - name: serviceusers.aiven.io - version: v1alpha1 - description: - A Kubernetes operator for provisioning and managing Aiven Databases - and other resources - displayName: Aiven Operator - icon: - - base64data: "" - mediatype: "" - install: - spec: - deployments: null - strategy: "" - installModes: - - supported: false - type: OwnNamespace - - supported: false - type: SingleNamespace - - supported: false - type: MultiNamespace - - supported: true - type: AllNamespaces - keywords: - - aiven - links: - - name: Aiven Operator for Kubernetes - url: https://aiven.github.io/aiven-operator/ - maintainers: - - email: ivan.savciuc@gmail.com - name: Ivan Savciuc - - email: murad.biashimov@aiven.io - name: Murad Biashimov - maturity: alpha - provider: - name: aiven - version: 0.0.0 diff --git a/config/operatorhub/manifests/kustomization.yaml b/config/operatorhub/manifests/kustomization.yaml deleted file mode 100644 index c2920856..00000000 --- a/config/operatorhub/manifests/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -resources: - - ../../default - - ../samples - - ../scorecard - - bases/aiven-operator.clusterserviceversion.yaml diff --git a/config/operatorhub/samples/kustomization.yaml b/config/operatorhub/samples/kustomization.yaml deleted file mode 100644 index 63344ca6..00000000 --- a/config/operatorhub/samples/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -## Append samples you want in your CSV to this file as resources ## -resources: -#+kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/operatorhub/scorecard/bases/config.yaml b/config/operatorhub/scorecard/bases/config.yaml deleted file mode 100644 index 707a5c25..00000000 --- a/config/operatorhub/scorecard/bases/config.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: scorecard.operatorframework.io/v1alpha3 -kind: Configuration -metadata: - name: config -stages: - - parallel: true - tests: [] diff --git a/config/operatorhub/scorecard/kustomization.yaml b/config/operatorhub/scorecard/kustomization.yaml deleted file mode 100644 index 0b907f9d..00000000 --- a/config/operatorhub/scorecard/kustomization.yaml +++ /dev/null @@ -1,16 +0,0 @@ -resources: - - bases/config.yaml -patchesJson6902: - - path: patches/basic.config.yaml - target: - group: scorecard.operatorframework.io - version: v1alpha3 - kind: Configuration - name: config - - path: patches/olm.config.yaml - target: - group: scorecard.operatorframework.io - version: v1alpha3 - kind: Configuration - name: config -# +kubebuilder:scaffold:patchesJson6902 diff --git a/config/operatorhub/scorecard/patches/basic.config.yaml b/config/operatorhub/scorecard/patches/basic.config.yaml deleted file mode 100644 index 8159f1cd..00000000 --- a/config/operatorhub/scorecard/patches/basic.config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- op: add - path: /stages/0/tests/- - value: - entrypoint: - - scorecard-test - - basic-check-spec - image: quay.io/operator-framework/scorecard-test:v1.8.0 - labels: - suite: basic - test: basic-check-spec-test diff --git a/config/operatorhub/scorecard/patches/olm.config.yaml b/config/operatorhub/scorecard/patches/olm.config.yaml deleted file mode 100644 index 0933da47..00000000 --- a/config/operatorhub/scorecard/patches/olm.config.yaml +++ /dev/null @@ -1,40 +0,0 @@ -- op: add - path: /stages/0/tests/- - value: - entrypoint: - - scorecard-test - - olm-bundle-validation - image: quay.io/operator-framework/scorecard-test:v1.8.0 - labels: - suite: olm - test: olm-bundle-validation-test -- op: add - path: /stages/0/tests/- - value: - entrypoint: - - scorecard-test - - olm-crds-have-validation - image: quay.io/operator-framework/scorecard-test:v1.8.0 - labels: - suite: olm - test: olm-crds-have-validation-test -- op: add - path: /stages/0/tests/- - value: - entrypoint: - - scorecard-test - - olm-spec-descriptors - image: quay.io/operator-framework/scorecard-test:v1.8.0 - labels: - suite: olm - test: olm-spec-descriptors-test -- op: add - path: /stages/0/tests/- - value: - entrypoint: - - scorecard-test - - olm-status-descriptors - image: quay.io/operator-framework/scorecard-test:v1.8.0 - labels: - suite: olm - test: olm-status-descriptors-test