From 9cccb9878c909b4a80f790278a3524e4fa026634 Mon Sep 17 00:00:00 2001 From: flacatus Date: Fri, 13 Sep 2024 12:38:18 +0200 Subject: [PATCH] feat: Use ose-tools for release-1.2 and use hermetic builds --- .tekton/rhtap-cli-pull-request.yaml | 2 +- .tekton/rhtap-cli-push.yaml | 2 +- Dockerfile | 22 +++++++--------------- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.tekton/rhtap-cli-pull-request.yaml b/.tekton/rhtap-cli-pull-request.yaml index fc92f632..0da3fe12 100644 --- a/.tekton/rhtap-cli-pull-request.yaml +++ b/.tekton/rhtap-cli-pull-request.yaml @@ -96,7 +96,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 diff --git a/.tekton/rhtap-cli-push.yaml b/.tekton/rhtap-cli-push.yaml index 67b328ec..77eb65a8 100644 --- a/.tekton/rhtap-cli-push.yaml +++ b/.tekton/rhtap-cli-push.yaml @@ -93,7 +93,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 diff --git a/Dockerfile b/Dockerfile index be465aa7..9cd2294d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # # Build # - +FROM registry.redhat.io/openshift4/ose-tools-rhel9:latestt@sha256:c2a2eca448a2e1b5d73f88dcd12a6c87e5f4580512303f4e38b67acf810b4778 as ose-tools FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder USER root @@ -45,22 +45,14 @@ COPY --from=builder /workdir/rhtap-cli/charts ./charts/ COPY --from=builder /workdir/rhtap-cli/scripts ./scripts/ COPY --from=builder /workdir/rhtap-cli/config.yaml . COPY --from=builder /workdir/rhtap-cli/bin/rhtap-cli . +COPY --from=ose-tools /usr/bin/kubectl /usr/bin/ -RUN microdnf install -y gzip shadow-utils tar && \ - groupadd --gid 1000 -r rhtap-cli && \ - useradd -r -d /rhtap-cli -g rhtap-cli -s /sbin/nologin --uid 1000 rhtap-cli && \ - ARCH=$(uname -m) && \ - KUBECTL_VERSION=$(curl -sL https://dl.k8s.io/release/stable.txt) && \ - if [ "$ARCH" = "x86_64" ]; then \ - curl --proto "=https" --tlsv1.2 -sSf -L -O "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"; \ - elif [ "$ARCH" = "aarch64" ]; then \ - curl --proto "=https" --tlsv1.2 -sSf -L -O "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/arm64/kubectl"; \ - fi && \ - chmod +x kubectl && \ - mv kubectl /usr/bin/kubectl && \ - microdnf remove -y shadow-utils && \ - microdnf clean all +RUN groupadd --gid 1000 -r rhtap-cli && \ + useradd -r -d /rhtap-cli -g rhtap-cli -s /sbin/nologin --uid 1000 rhtap-cli USER rhtap-cli +# Debug +RUN kubectl version --client + ENTRYPOINT ["/rhtap-cli/rhtap-cli"]