From 36c035a613131bfe61a9c12dd5c14b66f87a28d8 Mon Sep 17 00:00:00 2001 From: Rui Vieira Date: Mon, 14 Oct 2024 22:42:50 +0100 Subject: [PATCH] Move operator's cmd/operator/main.go to cmd/main.go to keep operator-sdk compatibility (#295) --- Dockerfile | 2 +- Makefile | 4 ++-- cmd/{operator => }/main.go | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename cmd/{operator => }/main.go (100%) diff --git a/Dockerfile b/Dockerfile index eb880db..e4dd8ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ COPY controllers/ controllers/ # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. USER root -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/operator/main.go +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Makefile b/Makefile index 68d8afe..b6a77c7 100644 --- a/Makefile +++ b/Makefile @@ -114,11 +114,11 @@ test: manifests generate fmt vet envtest ## Run tests. .PHONY: build build: manifests generate fmt vet ## Build manager binary. - go build -o bin/manager cmd/operator/main.go + go build -o bin/manager cmd/main.go .PHONY: run run: manifests generate fmt vet ## Run a controller from your host. - go run ./cmd/operator/main.go --enable-services $(ENABLED_SERVICES) + go run ./cmd/main.go --enable-services $(ENABLED_SERVICES) # If you wish built the manager image targeting other platforms you can use the --platform flag. # (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it. diff --git a/cmd/operator/main.go b/cmd/main.go similarity index 100% rename from cmd/operator/main.go rename to cmd/main.go