Skip to content

Commit 25f7669

Browse files
committed
Fips changes
1 parent 824571c commit 25f7669

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/spectro-release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Spectro Release
2-
run-name: Release for Cluster API openstack ${{ github.event.inputs.release_version }}
2+
run-name: Release for Cluster API Openstack ${{ github.event.inputs.release_version }}
33
on:
44
workflow_dispatch:
55
inputs:
@@ -43,16 +43,16 @@ jobs:
4343
env:
4444
REGISTRY: gcr.io/spectro-images-public/release/cluster-api-openstack
4545
run: |
46-
make docker-build
47-
make docker-push
46+
make docker-build-all
47+
make docker-push-all
4848
-
4949
name: Build Image - FIPS Mode
5050
env:
5151
FIPS_ENABLE: yes
5252
REGISTRY: gcr.io/spectro-images-public/release-fips/cluster-api-openstack
5353
run: |
54-
make docker-build
55-
make docker-push
54+
make docker-build-all
55+
make docker-push-all
5656
-
5757
name: Create Release
5858
id: create_release

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Build the manager binary
18-
FROM golang:1.19.8 as builder
18+
FROM golang:1.19.10-alpine3.18 as builder
1919
WORKDIR /workspace
2020

2121
ARG CRYPTO_LIB
@@ -25,6 +25,9 @@ ENV GOEXPERIMENT=${CRYPTO_LIB:+boringcrypto}
2525
ARG goproxy=https://proxy.golang.org
2626
ENV GOPROXY=$goproxy
2727

28+
RUN apk update
29+
RUN apk add git gcc g++ curl
30+
2831
# Copy the Go Modules manifests
2932
COPY go.mod go.mod
3033
COPY go.sum go.sum
@@ -45,10 +48,10 @@ ARG ldflags
4548
# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
4649
RUN if [ "${CRYPTO_LIB}" ]; \
4750
then \
48-
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "-linkmode=external -extldflags=-static" -a -o manager "${package}" ; \
51+
CGO_ENABLED=1 GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -ldflags "-linkmode=external -extldflags '-static'" -a -o manager ${package}; \
4952
else \
50-
CGO_ENABLED=0 GOARCH=amd64 GO111MODULE=on go build -ldflags "-linkmode=external -extldflags=-static" -a -o manager "${package}" ;\
51-
fi
53+
CGO_ENABLED=0 GOARCH=amd64 GO111MODULE=on go build -ldflags "-extldflags=-static" -a -o manager "${package}" ;\
54+
fi
5255

5356

5457
# Production image

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ifeq ($(PODMAN), 1)
7676
else
7777
CONTAINERFILE ?= Dockerfile
7878
endif
79-
SPECTRO_VERSION ?= 4.0.0-dev
79+
8080
# Release variables
8181
SPECTRO_VERSION ?= 4.0.0-dev
8282
FIPS_ENABLE ?= ""
@@ -97,6 +97,7 @@ RELEASE_DIR := out
9797
TAG ?= v0.6.2-spectro-${SPECTRO_VERSION}
9898
ARCH ?= amd64
9999
#ALL_ARCH ?= amd64 arm arm64 ppc64le s390x
100+
ALL_ARCH = amd64
100101

101102
# main controller
102103
IMAGE_NAME ?= capi-openstack-controller
@@ -259,11 +260,11 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
259260

260261
.PHONY: docker-build
261262
docker-build: docker-pull-prerequisites ## Build the docker image for controller-manager
262-
docker build -f $(CONTAINERFILE) --build-arg CRYPTO_LIB=${FIPS_ENABLE} --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
263+
docker build -f $(CONTAINERFILE) --build-arg CRYPTO_LIB=${FIPS_ENABLE} --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg LDFLAGS="$(LDFLAGS)" . -t $(CONTROLLER_IMG)-$(ARCH):$(TAG)
263264

264265
.PHONY: docker-push
265266
docker-push: ## Push the docker image
266-
docker push $(CONTROLLER_IMG_TAG)
267+
docker push $(CONTROLLER_IMG)-$(ARCH):$(TAG)
267268

268269
.PHONY: docker-pull-prerequisites
269270
docker-pull-prerequisites:

0 commit comments

Comments
 (0)