Skip to content

Commit d87c33f

Browse files
committed
Make image FIPS compatible
1 parent 7845c12 commit d87c33f

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.prow_ci.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export USE_IMAGE_DIGESTS=true
2+
export FAIL_FIPS_CHECK=true

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG GOLANG_BUILDER=golang:1.19
2-
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi8/ubi-minimal:8.6
1+
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.19
2+
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest
33

44
# Build the manager binary
55
FROM $GOLANG_BUILDER AS builder
@@ -12,17 +12,19 @@ ARG REMOTE_SOURCE_DIR=/remote-source
1212
ARG REMOTE_SOURCE_SUBDIR=
1313
ARG DEST_ROOT=/dest-root
1414

15-
ARG GO_BUILD_EXTRA_ARGS=
15+
ARG GO_BUILD_EXTRA_ARGS="-tags strictfipsruntime"
16+
ARG GO_BUILD_EXTRA_ENV_ARGS="CGO_ENABLED=1 GO111MODULE=on"
1617

1718
COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
1819
WORKDIR $REMOTE_SOURCE_DIR/$REMOTE_SOURCE_SUBDIR
1920

21+
USER root
2022
RUN mkdir -p ${DEST_ROOT}/usr/local/bin/
2123

2224
RUN if [ ! -f $CACHITO_ENV_FILE ]; then go mod download ; fi
2325

2426
# Build manager
25-
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; CGO_ENABLED=0 GO111MODULE=on go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager main.go
27+
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; env ${GO_BUILD_EXTRA_ENV_ARGS} go build ${GO_BUILD_EXTRA_ARGS} -a -o ${DEST_ROOT}/manager main.go
2628

2729
RUN cp -r templates ${DEST_ROOT}/templates
2830

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ run: manifests generate fmt vet ## Run a controller from your host.
132132
/bin/bash hack/clean_local_webhook.sh
133133
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)"
134134

135+
# Extra vars which will be passed to the Docker-build
136+
DOCKER_BUILD_ARGS ?=
137+
135138
.PHONY: docker-build
136139
docker-build: test ## Build docker image with the manager.
137-
podman build -t ${IMG} .
140+
podman build -t ${IMG} . ${DOCKER_BUILD_ARGS}
138141

139142
.PHONY: docker-push
140143
docker-push: ## Push docker image with the manager.

config/manifests/bases/telemetry-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
alm-examples: '[]'
66
capabilities: Basic Install
77
features.operators.openshift.io/disconnected: "true"
8+
features.operators.openshift.io/fips-compliant: "true"
89
operatorframework.io/suggested-namespace: openstack
910
operators.openshift.io/infrastructure-features: '["disconnected"]'
1011
operators.operatorframework.io/operator-type: non-standalone

0 commit comments

Comments
 (0)