Skip to content

Commit 5ed9621

Browse files
Merge pull request #14 from anirudhAgniRedhat/fix-go-version-build-fix
NO-JIRA: Downgrades the go versions for spire-server, spire-agents and spire-oidc-discovery-provider builds
2 parents 8d66667 + f7e20ad commit 5ed9621

7 files changed

+42
-30
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.idea
2-
3-
bin
2+
bin/

Containerfile.spiffe-spiffe-csi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ ENV GOEXPERIMENT=strictfipsruntime
1212
ENV CGO_ENABLED=1
1313
ENV GOFLAGS=""
1414

15+
RUN sed -i 's/^go 1\.24/go 1.23/' go.mod
16+
1517
RUN go build -o bin/spiffe-csi-driver -ldflags '-w -s' -tags ${GO_BUILD_TAGS} cmd/spiffe-csi-driver/main.go
1618

1719
FROM registry.redhat.io/rhel9-4-els/rhel:9.4

Containerfile.spire-agent

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ WORKDIR ${SOURCE_DIR}
66
COPY spiffe-spire .
77
COPY spiffe-spire/LICENSE /licenses/.
88

9+
# 1. Clean up .go-version and go.mod to support Go 1.23.6
10+
RUN echo "1.23.6" > .go-version && \
11+
sed -i '/^tool /d' go.mod && \
12+
sed -i 's/^go 1\.24\.1$/go 1.23.6/' go.mod
13+
914
ENV CGO_ENABLED=1
1015
ENV GOFLAGS=""
1116
ENV GO_BUILD_TAGS=strictfipsruntime,openssl

Containerfile.spire-oidc-discovery-provider

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ WORKDIR ${SOURCE_DIR}
77
COPY spiffe-spire .
88
COPY spiffe-spire/LICENSE /licenses/.
99

10-
# 3. Build the entire package (not just main.go)
10+
# 1. Clean up .go-version and go.mod to support Go 1.23.6
11+
RUN echo "1.23.6" > .go-version && \
12+
sed -i '/^tool /d' go.mod && \
13+
sed -i 's/^go 1\.24\.1$/go 1.23.6/' go.mod
14+
15+
# 2. Build the binary
1116
ENV CGO_ENABLED=1
1217
ENV GOFLAGS=""
1318
ENV GO_BUILD_TAGS=strictfipsruntime,openssl
1419
ENV GOEXPERIMENT=strictfipsruntime
1520

1621
RUN go build -o bin/oidc-discovery-provider -ldflags '-w -s' -tags ${GO_BUILD_TAGS} ./support/oidc-discovery-provider
1722

23+
# Stage 2: Minimal runtime image
1824
FROM registry.redhat.io/rhel9-4-els/rhel:9.4
1925

2026
ARG RELEASE_VERSION
@@ -42,4 +48,4 @@ LABEL com.redhat.component="oidc-discovery-provider-container" \
4248
io.k8s.display-name="OIDC Discovery Provider" \
4349
io.k8s.description="Container for OIDC Discovery Provider to expose SPIFFE identities via standard OIDC interfaces"
4450

45-
ENTRYPOINT ["/oidc-discovery-provider"]
51+
ENTRYPOINT ["/oidc-discovery-provider"]

Containerfile.spire-server

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ ENV GOCACHE=/go-cache
2020
ENV GOMODCACHE=/go-mod
2121
RUN mkdir -p ${GOTMPDIR} ${GOCACHE} ${GOMODCACHE}
2222

23+
# 1. Clean up .go-version and go.mod to support Go 1.23.6
24+
RUN echo "1.23.6" > .go-version && \
25+
sed -i '/^tool /d' go.mod && \
26+
sed -i 's/^go 1\.24\.1$/go 1.23.6/' go.mod
27+
28+
2329
# Build the binary and clean up Go build artifacts to free up space
2430
RUN go build -o bin/spire-server -ldflags '-w -s' -tags ${GO_BUILD_TAGS} cmd/spire-server/main.go \
2531
&& go clean -cache -modcache -i -r \

Makefile

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ zero_trust_workload_identity_manager_containerfile_name = Containerfile.zero-tru
55
zero_trust_workload_identity_manager_bundle_containerfile_name = Containerfile.zero-trust-workload-identity-manager.bundle
66

77
spiffe_spire_submodule_dir = spiffe-spire
8-
spiffe_spire_containerfile_name = Containerfile.spiffe-spire
98

109
spiffe_spire_controller_manager_submodule_dir = spiffe-spire-controller-manager
1110
spiffe_spire_controller_manager_containerfile_name = Containerfile.spiffe-spire-controller-manager
@@ -67,13 +66,11 @@ SPIFFE_SPIFFE_CSI_IMAGE ?= spiffe-spiffe-csi
6766

6867

6968
## image version to tag the created images with.
70-
IMAGE_VERSION ?= $(release_version)
69+
IMAGE_VERSION ?= 0.1.0
7170

72-
## image tag makes use of the branch name and
73-
## when branch name is `main` use `latest` as the tag.
74-
ifeq ($(release_version), main)
75-
IMAGE_VERSION = latest
76-
endif
71+
SPIFFE_SPIRE_IMAGE_VERSION ?= v1.12.0
72+
SPIFFE_CSI_IMAGE_VERSION ?= v0.2.7
73+
SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE_VERSION ?= v0.6.2
7774

7875
## args to pass during image build
7976
IMAGE_BUILD_ARGS ?= --build-arg RELEASE_VERSION=$(release_version) --build-arg COMMIT_SHA=$(commit_sha) --build-arg SOURCE_URL=$(source_url)
@@ -133,40 +130,34 @@ build-operator-image:
133130
## build spiffe-csi image.
134131
.PHONY: build-spiffe-csi-image
135132
build-spiffe-csi-image:
136-
$(IMAGE_BUILD_CMD) -f $(spiffe_spiffe_csi_containerfile_name) -t $(SPIFFE_SPIFFE_CSI_IMAGE):$(IMAGE_VERSION) .
133+
$(IMAGE_BUILD_CMD) -f $(spiffe_spiffe_csi_containerfile_name) -t $(SPIFFE_SPIFFE_CSI_IMAGE):$(SPIFFE_CSI_IMAGE_VERSION) .
137134

138135
## build all operand images
139136
.PHONY: build-operand-images
140-
build-operand-images: build-spiffe-spire-image
137+
build-operand-images: build-spiffe-csi-image build-spire-agent-image build-spire-controller-manager-image build-spire-server-image build-spire-oidc-discovery-provider-image
141138

142139
## build operator bundle image.
143140
.PHONY: build-bundle-image
144141
build-bundle-image:
145142
$(IMAGE_BUILD_CMD) -f $(zero_trust_workload_identity_manager_bundle_containerfile_name) -t $(ZERO_TRUST_WORKLOAD_IDENTITY_MANAGER_BUNDLE_IMAGE):$(IMAGE_VERSION) .
146143

147-
## build operand spiffe-spire image.
148-
.PHONY: build-spiffe-spire-image
149-
build-spiffe-spire-image:
150-
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_containerfile_name) -t $(SPIFFE_SPIRE_IMAGE):$(IMAGE_VERSION) .
151-
152-
153144
## build operand spire-controller-manager image.
154145
.PHONY: build-spire-controller-manager-image
155146
build-spire-controller-manager-image:
156-
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_controller_manager_containerfile_name) -t $(SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE):$(IMAGE_VERSION) .
147+
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_controller_manager_containerfile_name) -t $(SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE):$(SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE_VERSION) .
157148

158149
## build operand spire-controller-manager image.
159150
.PHONY: build-spire-server-image
160151
build-spire-server-image:
161-
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_server_containerfile_name) -t $(SPIFFE_SPIRE_SERVER_IMAGE):$(IMAGE_VERSION) .
152+
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_server_containerfile_name) -t $(SPIFFE_SPIRE_SERVER_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) .
162153

163154
.PHONY: build-spire-agent-image
164155
build-spire-agent-image:
165-
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_agent_containerfile_name) -t $(SPIFFE_SPIRE_AGENT_IMAGE):$(IMAGE_VERSION) .
156+
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_agent_containerfile_name) -t $(SPIFFE_SPIRE_AGENT_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) .
166157

167158
.PHONY: build-spire-oidc-discovery-provider-image
168159
build-spire-oidc-discovery-provider-image:
169-
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_oidc_discovery_provider_containerfile_name) -t $(SPIFFE_SPIRE_OIDC_DISCOVERY_PROVIDER_IMAGE):$(IMAGE_VERSION) .
160+
$(IMAGE_BUILD_CMD) -f $(spiffe_spire_oidc_discovery_provider_containerfile_name) -t $(SPIFFE_SPIRE_OIDC_DISCOVERY_PROVIDER_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) .
170161

171162
## check shell scripts.
172163
.PHONY: verify-shell-scripts
@@ -189,11 +180,16 @@ update: update-submodules
189180
## clean up temp dirs, images.
190181
.PHONY: clean
191182
clean:
192-
podman rmi -i $(ZERO_TRUST_WORKLOAD_IDENTITY_MANAGER_IMAGE):$(IMAGE_VERSION) \
193-
$(SPIFFE_SPIRE_IMAGE):$(IMAGE_VERSION) \
194-
$(SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE):$(IMAGE_VERSION) \
195-
$(SPIFFE_SPIFFE_CSI_IMAGE):$(IMAGE_VERSION) \
196-
$(ZERO_TRUST_WORKLOAD_IDENTITY_MANAGER_BUNDLE_IMAGE):$(IMAGE_VERSION)
183+
$(CONTAINER_ENGINE) rmi \
184+
$(ZERO_TRUST_WORKLOAD_IDENTITY_MANAGER_IMAGE):$(IMAGE_VERSION) \
185+
$(SPIFFE_SPIRE_SERVER_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) \
186+
$(SPIFFE_SPIRE_AGENT_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) \
187+
$(SPIFFE_SPIRE_OIDC_DISCOVERY_PROVIDER_IMAGE):$(SPIFFE_SPIRE_IMAGE_VERSION) \
188+
$(SPIFFE_SPIRE_CONTROLLER_MANAGER_IMAGE):$(IMAGE_VERSION) \
189+
$(SPIFFE_SPIFFE_CSI_IMAGE):$(SPIFFE_CSI_IMAGE_VERSION) \
190+
$(ZERO_TRUST_WORKLOAD_IDENTITY_MANAGER_BUNDLE_IMAGE):$(IMAGE_VERSION)
191+
192+
197193

198194
## validate renovate config.
199195
.PHONY: validate-renovate-config

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ outside the main code repository for better management.
2828
- [spiffe-spire](https://github.com/openshift/spiffe-spire)
2929
- [spiffe-spire-controller-manager](https://github.com/openshift/spiffe-spire-controller-manager)
3030
- [spiffe-spiffe-csi](https://github.com/openshift/spiffe-spiffe-csi)
31-
- [spiffe-spiffe-helper](https://github.com/openshift/spiffe-spiffe-helper)
32-
- [spiffe-go-spiffe](https://github.com/openshift/spiffe-go-spiffe)
3331

3432
In each release branch the git submodules are configured with equivalent release branch in their respective origin
3533
repositories. And when switching the parent repository between different branches, the submodule branches will not be

0 commit comments

Comments
 (0)