Skip to content

Commit

Permalink
feat: Use ose-tools to get kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
flacatus committed Sep 12, 2024
1 parent a913920 commit 7153369
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .tekton/rhtap-cli-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .tekton/rhtap-cli-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 1 addition & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,14 @@ LABEL \

WORKDIR /rhtap-cli

COPY --from=registry.redhat.io/openshift4/ose-tools-rhel9:latest /usr/bin/kubectl /usr/bin
COPY --from=builder /workdir/rhtap-cli/installer ./

COPY --from=builder /workdir/rhtap-cli/bin/rhtap-cli /usr/local/bin/rhtap-cli

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

Expand Down

0 comments on commit 7153369

Please sign in to comment.