Skip to content

Commit

Permalink
Fix Unknown build info in CodeFlare operator log
Browse files Browse the repository at this point in the history
  • Loading branch information
oksanabaza authored and openshift-merge-bot[bot] committed Apr 26, 2024
1 parent 12b72cb commit 4606269
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY ./Makefile ./Makefile
RUN go mod download

# Copy the Go sources
Expand All @@ -13,7 +14,7 @@ COPY pkg/ pkg/

# Build
USER root
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags strictfipsruntime -a -o manager main.go
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 make go-build-for-image

FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
WORKDIR /
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ build: fmt vet ## Build manager binary.
" \
-o bin/manager main.go

.PHONY: go-build-for-image
go-build-for-image: fmt vet ## Build manager binary.
go build \
-ldflags " \
-X 'main.OperatorVersion=$(BUILD_VERSION)' \
-X 'main.BuildDate=$(BUILD_DATE)' \
" \
-tags strictfipsruntime -a -o manager main.go

.PHONY: run
run: manifests fmt vet ## Run a controller from your host.
go run ./main.go
Expand Down

0 comments on commit 4606269

Please sign in to comment.