Skip to content

Commit

Permalink
Addressing konflux error and fixing multi arch build with podman 5.2 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierCazade authored Sep 18, 2024
1 parent 118800c commit eeef1d6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 52 deletions.
24 changes: 1 addition & 23 deletions .tekton/flowlogs-pipeline-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
- default: "true"
description: Execute the build with network isolation
name: hermetic
type: string
Expand Down Expand Up @@ -405,28 +405,6 @@ spec:
operator: in
values:
- "false"
- name: sbom-json-check
params:
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
value: $(tasks.build-container.results.IMAGE_DIGEST)
runAfter:
- build-container
taskRef:
params:
- name: name
value: sbom-json-check
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sbom-json-check:0.1@sha256:acc9cb8a714f33c0e48d6ca219b6bd0191f09cdd767af4ef3a35d0a5cac53b5d
- name: kind
value: task
resolver: bundles
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- name: apply-tags
params:
- name: IMAGE
Expand Down
25 changes: 2 additions & 23 deletions .tekton/flowlogs-pipeline-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
build.appstudio.openshift.io/build-nudge-files: "hack/container_digest.sh"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main"
creationTimestamp: null
Expand Down Expand Up @@ -91,7 +92,7 @@ spec:
description: Skip checks against built image
name: skip-checks
type: string
- default: "false"
- default: "true"
description: Execute the build with network isolation
name: hermetic
type: string
Expand Down Expand Up @@ -402,28 +403,6 @@ spec:
operator: in
values:
- "false"
- name: sbom-json-check
params:
- name: IMAGE_URL
value: $(tasks.build-container.results.IMAGE_URL)
- name: IMAGE_DIGEST
value: $(tasks.build-container.results.IMAGE_DIGEST)
runAfter:
- build-container
taskRef:
params:
- name: name
value: sbom-json-check
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sbom-json-check:0.1@sha256:acc9cb8a714f33c0e48d6ca219b6bd0191f09cdd767af4ef3a35d0a5cac53b5d
- name: kind
value: task
resolver: bundles
when:
- input: $(params.skip-checks)
operator: in
values:
- "false"
- name: apply-tags
params:
- name: IMAGE
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ FORCE: ;
# build a single arch target provided as argument
define build_target
echo 'building image for arch $(1)'; \
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETPLATFORM=linux/$(1) --build-arg TARGETARCH=$(1) --build-arg BUILDPLATFORM=linux/amd64 ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f contrib/docker/Dockerfile .;
DOCKER_BUILDKIT=1 $(OCI_BIN) buildx build --load --build-arg TARGETARCH=$(1) ${OCI_BUILD_OPTS} -t ${IMAGE}-$(1) -f contrib/docker/Dockerfile .;
endef

# push a single arch target image
Expand Down
8 changes: 3 additions & 5 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
ARG TARGETPLATFORM=linux/amd64
ARG BUILDPLATFORM=linux/amd64
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.22 as builder
ARG TARGETARCH
FROM docker.io/library/golang:1.22 as builder

ARG TARGETPLATFORM
ARG TARGETARCH=amd64
WORKDIR /app

Expand All @@ -22,7 +20,7 @@ RUN git status --porcelain
RUN GOARCH=$TARGETARCH make build_code

# final stage
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.4
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal:9.4

COPY --from=builder /app/flowlogs-pipeline /app/
COPY --from=builder /app/confgenerator /app/
Expand Down
3 changes: 3 additions & 0 deletions hack/update-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ LABEL io.openshift.tags="network-observability-flowlogs-pipeline"
LABEL upstream-vcs-ref="${COMMIT}"
LABEL upstream-vcs-type="git"
EOF


sed -i 's/\(FROM.*\)docker.io\/library\/golang:1.22\(.*\)/\1brew.registry.redhat.io\/rh-osbs\/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9\2/g' ${CONTAINER_FILE}

0 comments on commit eeef1d6

Please sign in to comment.