This is an automated email from the ASF dual-hosted git repository. tsato pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 3880907a3a725bcf68e14b7781ff6f8203415ea5 Author: Tadayoshi Sato <[email protected]> AuthorDate: Fri Dec 9 14:03:54 2022 +0900 feat(kustomize): add INSTALL_DEFAULT_KAMELETS parameter to make operator --- config/manager/patch-install-default-kamelets.yaml | 22 +++++++++++++++ install/Makefile | 32 ++++++++++++++-------- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/config/manager/patch-install-default-kamelets.yaml b/config/manager/patch-install-default-kamelets.yaml new file mode 100644 index 000000000..fa3012076 --- /dev/null +++ b/config/manager/patch-install-default-kamelets.yaml @@ -0,0 +1,22 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- + +- op: add + path: /spec/template/spec/containers/0/env/- + value: + name: KAMEL_INSTALL_DEFAULT_KAMELETS + value: "false" diff --git a/install/Makefile b/install/Makefile index fbc3af67d..fa7a1608c 100644 --- a/install/Makefile +++ b/install/Makefile @@ -50,6 +50,8 @@ MONITORING_PORT ?= 8080 HEALTH_PORT ?= 8081 # Operator Logging Level: string [info, debug, 0, 1] LOGGING_LEVEL ?= info +# Install default kamelets: [true|false] +INSTALL_DEFAULT_KAMELETS ?= true CONFIG := config MANAGER := $(CONFIG)/manager @@ -70,6 +72,7 @@ ROLEBIN_TO_CROLEBIN_PATCH := $(RBAC)/patch-rolebinding-to-clusterrolebinding # Operator patches PORTS_PATCH := patch-ports LOG_LEVEL_PATCH := patch-log-level +INSTALL_DEFAULT_KAMELETS_PATCH := patch-install-default-kamelets IMAGE_PULL_POLICY_PATCH := patch-image-pull-policy-always WATCH_NAMESPACE_PATCH := patch-watch-namespace-global # Platform patches @@ -284,17 +287,18 @@ endif #=== Cluster-admin privileges are required. # #* PARAMETERS: -#** NAMESPACE: Set the namespace to install the operator into -#** PLATFORM: Override the discovered platform, if required -#** GLOBAL: Set the operator to watch all namespaces for custom resources [true|false] -#** CUSTOM_IMAGE: Set a custom operator image name -#** CUSTOM_VERSION: Set a custom operator image version/tag -#** ALWAYS_PULL_IMAGES: Set whether to always pull the operator image [true|false] -#** MONITORING: Add the prometheus monitoring resources -#** MONITORING_PORT: Set a custom monitoring port -#** HEALTH_PORT: Set a custom health port -#** LOGGING_LEVEL: Set the level of logging [info|debug] -#** DRY_RUN: Print the resources to be applied instead of applying them [true|false] +#** NAMESPACE: Set the namespace to install the operator into +#** PLATFORM: Override the discovered platform, if required +#** GLOBAL: Set the operator to watch all namespaces for custom resources [true|false] +#** CUSTOM_IMAGE: Set a custom operator image name +#** CUSTOM_VERSION: Set a custom operator image version/tag +#** ALWAYS_PULL_IMAGES: Set whether to always pull the operator image [true|false] +#** MONITORING: Add the prometheus monitoring resources +#** MONITORING_PORT: Set a custom monitoring port +#** HEALTH_PORT: Set a custom health port +#** LOGGING_LEVEL: Set the level of logging [info|debug] +#** INSTALL_DEFAULT_KAMELETS: Install the default Kamelets from catalog [true|false] +#** DRY_RUN: Print the resources to be applied instead of applying them [true|false] # #--- operator: check-admin have-platform check-crd-api-support kustomize kubectl .operator-port-patch .operator-log-level-patch @@ -334,6 +338,12 @@ else ifneq ($(LOGGING_LEVEL), 0) else @$(call add-remove-kind-patch,$(MANAGER),remove,$(LOG_LEVEL_PATCH).$(YAML),Deployment) endif +# Set the INSTALL_DEFAULT_KAMELETS config depending on var +ifeq ($(INSTALL_DEFAULT_KAMELETS),false) + @$(call add-remove-kind-patch,$(MANAGER),add,$(INSTALL_DEFAULT_KAMELETS_PATCH).$(YAML),Deployment) +else + @$(call add-remove-kind-patch,$(MANAGER),remove,$(INSTALL_DEFAULT_KAMELETS_PATCH).$(YAML),Deployment) +endif ifeq ($(DRY_RUN), false) @$(KUSTOMIZE) build $(KOPTIONS) $@ | kubectl apply -f - else
