Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build) multiarch images #566

Merged
merged 8 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ header:
- '**/zz_generated.deepcopy.go' # Generated by Kubebuilder
- 'charts/**/templates/*.yaml' # license headers on helm templates are causing issues


comment: on-failure

# license-location-threshold specifies the index threshold where the license header can be located,
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
provenance: false
platforms: |
linux/amd64
# linux/arm64
linux/arm64

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV CGO_ENABLED=0
WORKDIR /workspace

COPY Makefile .
RUN make controller-gen
RUN make controller-gen-docker
COPY . .

# Build greenhouse operator and tooling.
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.dev-env
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ WORKDIR /workspace

COPY . .

# Build dev-env and setup-envtest
RUN make controller-gen-docker envtest-docker

# Build dev-env and setup-envtest
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make generate build-dev-env CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
&& GOBIN=/workspace/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \
&& cp $(/workspace/bin/setup-envtest use ${ENVTEST_K8S_VERSION} -p path)/* /usr/local/bin

# Get PluginDefinitions from https://github.com/cloudoperators/greenhouse-extensions
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,21 @@ controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessar
$(CONTROLLER_GEN): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: controller-gen-docker
controller-gen-docker: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN_DOCKER): $(LOCALBIN)
GOPATH=$(shell pwd) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: envtest-docker
envtest-docker: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST_DOCKER): $(LOCALBIN)
GOPATH=$(shell pwd) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: goimports
goimports: $(GOIMPORTS)
$(GOIMPORTS): $(LOCALBIN)
Expand Down
Loading