Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ before:
- go mod tidy
- go mod download
builds:
- id: object-controller
main: ./cmd/object-controller/
binary: object-controller
asmflags: "{{ .Env.GO_BUILD_ASMFLAGS }}"
gcflags: "{{ .Env.GO_BUILD_GCFLAGS }}"
ldflags: "{{ .Env.GO_BUILD_LDFLAGS }}"
tags:
- "{{ .Env.GO_BUILD_TAGS }}"
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- linux
goarch:
- amd64
- arm64
- ppc64le
- s390x
- id: operator-controller
main: ./cmd/operator-controller/
binary: operator-controller
Expand Down Expand Up @@ -37,6 +53,42 @@ builds:
- ppc64le
- s390x
dockers:
- image_templates:
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
dockerfile: Dockerfile.object-controller
goos: linux
goarch: amd64
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--provenance=false"
- image_templates:
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
dockerfile: Dockerfile.object-controller
goos: linux
goarch: arm64
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
- "--provenance=false"
- image_templates:
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
dockerfile: Dockerfile.object-controller
goos: linux
goarch: ppc64le
use: buildx
build_flag_templates:
- "--platform=linux/ppc64le"
- "--provenance=false"
- image_templates:
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
dockerfile: Dockerfile.object-controller
goos: linux
goarch: s390x
use: buildx
build_flag_templates:
- "--platform=linux/s390x"
- "--provenance=false"
- image_templates:
- "{{ .Env.OPCON_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
dockerfile: Dockerfile.operator-controller
Expand Down Expand Up @@ -110,6 +162,12 @@ dockers:
- "--platform=linux/s390x"
- "--provenance=false"
docker_manifests:
- name_template: "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}"
image_templates:
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
- "{{ .Env.OBJECT_CONTROLLER_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
- name_template: "{{ .Env.OPCON_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}"
image_templates:
- "{{ .Env.OPCON_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-amd64"
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile.object-controller
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Build the binary with make build-linux before building this image.
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY object-controller object-controller
USER 65532:65532

ENTRYPOINT ["/object-controller"]
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ CATD_IMAGE_REPO := $(IMAGE_REGISTRY)/catalogd
endif
export CATD_IMAGE_REPO

ifeq ($(origin OBJECT_CONTROLLER_IMAGE_REPO), undefined)
OBJECT_CONTROLLER_IMAGE_REPO := $(IMAGE_REGISTRY)/object-controller
endif
export OBJECT_CONTROLLER_IMAGE_REPO

ifeq ($(origin IMAGE_TAG), undefined)
IMAGE_TAG := devel
endif
export IMAGE_TAG

OPCON_IMG := $(OPCON_IMAGE_REPO):$(IMAGE_TAG)
CATD_IMG := $(CATD_IMAGE_REPO):$(IMAGE_TAG)
OBJECT_CONTROLLER_IMG := $(OBJECT_CONTROLLER_IMAGE_REPO):$(IMAGE_TAG)

# Extract Kubernetes client-go version used to set the version to the PSA labels, for ENVTEST and KIND
ifeq ($(origin K8S_VERSION), undefined)
Expand Down Expand Up @@ -351,6 +357,7 @@ kind-cluster-%: $(KIND) #EXHELP Create a kind cluster named after the stem (%).
kind-load-%: kind-cluster-% docker-build
$(KIND) load docker-image $(OPCON_IMG) --name $*
$(KIND) load docker-image $(CATD_IMG) --name $*
$(KIND) load docker-image $(OBJECT_CONTROLLER_IMG) --name $*

.PHONY: kind-deploy-%
kind-deploy-%: kind-load-% manifests
Expand Down Expand Up @@ -605,7 +612,7 @@ export GO_BUILD_LDFLAGS := -s -w \
-X '$(VERSION_PATH).version=$(VERSION)' \
-X '$(VERSION_PATH).gitCommit=$(GIT_COMMIT)' \

BINARIES=operator-controller catalogd
BINARIES=operator-controller catalogd object-controller

.PHONY: $(BINARIES)
$(BINARIES):
Expand Down Expand Up @@ -644,9 +651,10 @@ FLUENTBIT_NAMESPACE := fluent-bit
FLUENTBIT_CHART_VERSION := 0.57.9

.PHONY: docker-build
docker-build: build-linux #EXHELP Build docker image for operator-controller and catalog with GOOS=linux and local GOARCH.
docker-build: build-linux #EXHELP Build controller images with GOOS=linux and local GOARCH.
$(CONTAINER_RUNTIME) build -t $(OPCON_IMG) -f Dockerfile.operator-controller ./bin/linux
$(CONTAINER_RUNTIME) build -t $(CATD_IMG) -f Dockerfile.catalogd ./bin/linux
$(CONTAINER_RUNTIME) build -t $(OBJECT_CONTROLLER_IMG) -f Dockerfile.object-controller ./bin/linux

#SECTION Release
ifeq ($(origin ENABLE_RELEASE_PIPELINE), undefined)
Expand All @@ -661,7 +669,7 @@ export GORELEASER_ARGS

.PHONY: release
release: $(GORELEASER) #EXHELP Runs goreleaser for the operator-controller. By default, this will run only as a snapshot and will not publish any artifacts unless it is run with different arguments. To override the arguments, run with "GORELEASER_ARGS=...". When run as a github action from a tag, this target will publish a full release.
OPCON_IMAGE_REPO=$(OPCON_IMAGE_REPO) CATD_IMAGE_REPO=$(CATD_IMAGE_REPO) $(GORELEASER) $(GORELEASER_ARGS)
OPCON_IMAGE_REPO=$(OPCON_IMAGE_REPO) CATD_IMAGE_REPO=$(CATD_IMAGE_REPO) OBJECT_CONTROLLER_IMAGE_REPO=$(OBJECT_CONTROLLER_IMAGE_REPO) $(GORELEASER) $(GORELEASER_ARGS)

.PHONY: quickstart
quickstart: export STANDARD_MANIFEST_URL := "https://github.com/operator-framework/operator-controller/releases/download/$(VERSION)/$(notdir $(STANDARD_RELEASE_MANIFEST))"
Expand Down
Loading