Skip to content

Commit

Permalink
[refactor] Fixing policy controller manifests generation, bundle and
Browse files Browse the repository at this point in the history
samples
  • Loading branch information
didierofrivia committed Dec 14, 2023
1 parent 8d0c72a commit 5457830
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ LIMITADOR_OPERATOR_GITREF = $(LIMITADOR_OPERATOR_BUNDLE_VERSION)
endif
LIMITADOR_OPERATOR_BUNDLE_IMG ?= quay.io/kuadrant/limitador-operator-bundle:$(LIMITADOR_OPERATOR_BUNDLE_IMG_TAG)

## policy-controller
POLICY_CONTROLLER_VERSION ?= latest
policy_controller_is_semantic := $(call is_semantic_version,$(POLICY_CONTROLLER_VERSION))
ifeq (latest,$(POLICY_CONTROLLER_VERSION))
POLICY_CONTROLLER_VERSION = 0.0.0
POLICY_CONTROLLER_GITREF = main
else ifeq (true,$(policy_controller_is_semantic))
POLICY_CONTROLLER_GITREF = v$(POLICY_CONTROLLER_VERSION)
else
POLICY_CONTROLLER_GITREF = $(POLICY_CONTROLLER_VERSION)
endif

## wasm-shim
WASM_SHIM_VERSION ?= latest
shim_version_is_semantic := $(call is_semantic_version,$(WASM_SHIM_VERSION))
Expand Down Expand Up @@ -251,9 +263,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
.PHONY: dependencies-manifests
dependencies-manifests: export AUTHORINO_OPERATOR_GITREF := $(AUTHORINO_OPERATOR_GITREF)
dependencies-manifests: export LIMITADOR_OPERATOR_GITREF := $(LIMITADOR_OPERATOR_GITREF)
dependencies-manifests: export POLICY_CONTROLLER_GITREF := $(POLICY_CONTROLLER_GITREF)
dependencies-manifests: ## Update kuadrant dependencies manifests.
$(call patch-dependencies-config,authorino,config/dependencies/authorino/kustomization.template.yaml,config/dependencies/authorino/kustomization.yaml)
$(call patch-dependencies-config,limitador,config/dependencies/limitador/kustomization.template.yaml,config/dependencies/limitador/kustomization.yaml)
$(call patch-dependencies-config,policy-controller,config/dependencies/policy-controller/kustomization.template.yaml,config/dependencies/policy-controller/kustomization.yaml)

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down Expand Up @@ -432,7 +446,7 @@ rm -rf $$TMP_DIR ;\
endef

.PHONY: bundle
bundle: $(OPM) $(YQ) manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
bundle: $(OPM) $(YQ) manifests dependencies-manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
$(OPERATOR_SDK) generate kustomize manifests -q
# Set desired operator image and related wasm shim image
V="$(RELATED_IMAGE_WASMSHIM)" \
Expand Down
13 changes: 13 additions & 0 deletions config/dependencies/policy-controller/kustomization.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resources:
- github.com/Kuadrant/multicluster-gateway-controller/config/policy-controller/default?ref=${POLICY_CONTROLLER_GITREF}

patchesStrategicMerge:
- delete-ns.yaml

patches:
- patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --ocm-hub=false
target:
kind: Deployment
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resources:
- github.com/Kuadrant/multicluster-gateway-controller/config/samples?ref=${POLICY_CONTROLLER_GITREF}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- github.com/Kuadrant/multicluster-gateway-controller/config/samples?ref=main
1 change: 0 additions & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ resources:
- bases/kuadrant-operator.clusterserviceversion.yaml
- ../default
- ../samples
- github.com/Kuadrant/multicluster-gateway-controller/config/samples
- ../scorecard

# [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix.
Expand Down
1 change: 1 addition & 0 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ resources:
- kuadrant_v1beta1_kuadrant.yaml
- kuadrant_v1beta2_authpolicy.yaml
- kuadrant_v1beta2_ratelimitpolicy.yaml
- ../dependencies/policy-controller/samples
#+kubebuilder:scaffold:manifestskustomizesamples

0 comments on commit 5457830

Please sign in to comment.