@@ -33,6 +33,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
3333# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
3434# functions.dev/func-operator-bundle:$VERSION and functions.dev/func-operator-catalog:$VERSION.
3535IMAGE_TAG_BASE ?= localhost:5001/func-operator
36+ IMAGE_TAG_BASE_SOURCE_OBJECTBUCKET ?= localhost:5001/objectbucket-notifications-adapter
3637
3738DEBUG_IMAGE_TAG_BASE ?= $(IMAGE_TAG_BASE ) -debug
3839
5657OPERATOR_SDK_VERSION ?= v1.41.1
5758# Image URL to use all building/pushing image targets
5859IMG ?= $(IMAGE_TAG_BASE ) :$(VERSION )
60+ IMG_SOURCE_OBJECTBUCKET ?= $(IMAGE_TAG_BASE_SOURCE_OBJECTBUCKET ) :$(VERSION )
5961DEBUG_IMG ?= $(DEBUG_IMAGE_TAG_BASE ) :v$(VERSION )
6062
6163# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
@@ -116,7 +118,7 @@ vet: ## Run go vet against code.
116118
117119.PHONY : test
118120test : manifests generate fmt vet setup-envtest # # Run tests.
119- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $$(go list ./... | grep -v / e2e ) -coverprofile cover.out
121+ KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test $$(go list ./... | grep -v e2e ) -coverprofile cover.out
120122
121123.PHONY : test-e2e # # Run e2e tests.
122124test-e2e : ginkgo
@@ -145,12 +147,23 @@ lint-config: golangci-lint ## Verify golangci-lint linter configuration
145147# #@ Build
146148
147149.PHONY : build
148- build : manifests generate fmt vet # # Build manager binary.
149- go build -o bin/manager cmd/main.go
150+ build : manifests generate fmt vet # # Build func-operator manager binary.
151+ go build -o bin/manager cmd/func-operator/main.go
152+
153+ .PHONY : build-source-objectbucket
154+ build-source-objectbucket : manifests generate fmt vet # # Build objectbucket-notifications-adapter binary.
155+ go build -o bin/source-objectbucket cmd/objectbucket-notifications-adapter/main.go
156+
157+ .PHONY : build-sources
158+ build-sources : build-source-objectbucket # # Build all event source binaries.
150159
151160.PHONY : run
152- run : manifests generate fmt vet # # Run a controller from your host.
153- go run ./cmd/main.go
161+ run : manifests generate fmt vet # # Run the func-operator controller from your host.
162+ go run ./cmd/func-operator/main.go
163+
164+ .PHONY : run-source-objectbucket
165+ run-source-objectbucket : manifests generate fmt vet # # Run the objectbucket-notifications-adapter controller from your host.
166+ go run ./cmd/objectbucket-notifications-adapter/main.go
154167
155168# If you wish to build the manager image targeting other platforms you can use the --platform flag.
156169# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
@@ -178,6 +191,20 @@ docker-push-debugger: ## Push debugger docker image with the manager.
178191# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
179192# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
180193PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
194+ .PHONY : docker-build-source-objectbucket
195+ docker-build-source-objectbucket : # # Build docker image for the objectbucket-notifications-adapter.
196+ $(CONTAINER_TOOL ) build -t ${IMG_SOURCE_OBJECTBUCKET} -f Dockerfile.source-objectbucket .
197+
198+ .PHONY : docker-push-source-objectbucket
199+ docker-push-source-objectbucket : # # Push docker image for the objectbucket-notifications-adapter.
200+ $(CONTAINER_TOOL ) push ${IMG_SOURCE_OBJECTBUCKET}
201+
202+ .PHONY : docker-build-sources
203+ docker-build-sources : docker-build-source-objectbucket # # Build docker images for all event sources.
204+
205+ .PHONY : docker-push-sources
206+ docker-push-sources : docker-push-source-objectbucket # # Push docker images for all event sources.
207+
181208.PHONY : docker-buildx
182209docker-buildx : # # Build and push docker image for the manager for cross-platform support
183210 # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
@@ -239,12 +266,31 @@ patch-registry-cert: ## Patch deployment to mount local registry certificate (fo
239266 fi
240267
241268.PHONY : deploy
242- deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
269+ deploy : manifests kustomize # # Deploy func-operator controller to the K8s cluster specified in ~/.kube/config.
243270 cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
244271 $(KUSTOMIZE ) build config/default | $(KUBECTL ) apply -f -
245272 $(MAKE ) patch-registry-cert
246273 $(KUBECTL ) wait deployment --all --timeout=120s --for=condition=Available -n func-operator-system
247274
275+ .PHONY : deploy-source-objectbucket
276+ deploy-source-objectbucket : manifests kustomize # # Deploy objectbucket-notifications-adapter to the K8s cluster.
277+ cd config/sources/objectbucket/manager && $(KUSTOMIZE ) edit set image controller=${IMG_SOURCE_OBJECTBUCKET}
278+ $(KUSTOMIZE ) build config/sources/objectbucket/default | $(KUBECTL ) apply -f -
279+ $(KUBECTL ) wait deployment --all --timeout=120s --for=condition=Available -n objectbucket-notifications-adapter-system
280+
281+ .PHONY : deploy-source-objectbucket-kafka
282+ deploy-source-objectbucket-kafka : manifests kustomize # # Deploy objectbucket-notifications-adapter in Kafka mode.
283+ cd config/sources/objectbucket/manager && $(KUSTOMIZE ) edit set image controller=${IMG_SOURCE_OBJECTBUCKET}
284+ $(KUSTOMIZE ) build config/sources/objectbucket/kafka | $(KUBECTL ) apply -f -
285+ $(KUBECTL ) wait deployment --all --timeout=120s --for=condition=Available -n objectbucket-notifications-adapter-system
286+
287+ .PHONY : deploy-combined
288+ deploy-combined : manifests kustomize # # Deploy both func-operator and all event sources in a single namespace.
289+ cd config/manager && $(KUSTOMIZE ) edit set image controller=${IMG}
290+ cd config/sources/objectbucket/manager && $(KUSTOMIZE ) edit set image controller=${IMG_SOURCE_OBJECTBUCKET}
291+ $(KUSTOMIZE ) build config/combined | $(KUBECTL ) apply -f -
292+ $(KUBECTL ) wait deployment --all --timeout=120s --for=condition=Available -n func-operator-system
293+
248294.PHONY : deploy-debugger
249295deploy-debugger : manifests kustomize # # Deploy debug controller to the K8s cluster specified in ~/.kube/config.
250296 cd config/manager && $(KUSTOMIZE ) edit set image controller=${DEBUG_IMG}
@@ -253,9 +299,17 @@ deploy-debugger: manifests kustomize ## Deploy debug controller to the K8s clust
253299 $(MAKE ) patch-registry-cert
254300
255301.PHONY : undeploy
256- undeploy : kustomize # # Undeploy controller from the K8s cluster specified in ~/.kube/config . Call with ignore-not-found=true to ignore resource not found errors during deletion.
302+ undeploy : kustomize # # Undeploy func-operator controller from the K8s cluster. Call with ignore-not-found=true to ignore resource not found errors during deletion.
257303 $(KUSTOMIZE ) build config/default | $(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f -
258304
305+ .PHONY : undeploy-source-objectbucket
306+ undeploy-source-objectbucket : kustomize # # Undeploy objectbucket-notifications-adapter from the K8s cluster.
307+ $(KUSTOMIZE ) build config/sources/objectbucket/default | $(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f -
308+
309+ .PHONY : undeploy-combined
310+ undeploy-combined : kustomize # # Undeploy both func-operator and all event sources from the K8s cluster.
311+ $(KUSTOMIZE ) build config/combined | $(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f -
312+
259313.PHONY : create-kind-cluster
260314create-kind-cluster :
261315 ./hack/create-kind-cluster.sh
@@ -382,6 +436,13 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada
382436 $(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
383437 $(OPERATOR_SDK ) bundle validate ./bundle
384438
439+ .PHONY : bundle-combined
440+ bundle-combined : manifests kustomize operator-sdk # # Generate combined OLM bundle with both func-operator and all event sources.
441+ cd config/manager && $(KUSTOMIZE ) edit set image controller=$(IMG )
442+ cd config/sources/objectbucket/manager && $(KUSTOMIZE ) edit set image controller=$(IMG_SOURCE_OBJECTBUCKET )
443+ $(KUSTOMIZE ) build config/combined/manifests | $(OPERATOR_SDK ) generate bundle $(BUNDLE_GEN_FLAGS )
444+ $(OPERATOR_SDK ) bundle validate ./bundle
445+
385446.PHONY : bundle-build
386447bundle-build : # # Build the bundle image.
387448 $(CONTAINER_TOOL ) build -f bundle.Dockerfile -t $(BUNDLE_IMG ) .
0 commit comments