From 1f99d42d7c6425db7fb7de27d471cd6a9380b88b Mon Sep 17 00:00:00 2001 From: Neo2308 Date: Thu, 31 Oct 2024 00:22:49 +0530 Subject: [PATCH] Fix other warnings * Fix "as" case mismatch warnings in dockerfiles * Fix "ENV" legacy format warnings in dockerfiles * Fix "set-output" deprecated warnings in github actions Signed-off-by: Neo2308 --- .github/workflows/deploy.yml | 6 +++--- .github/workflows/integration.yml | 2 +- .github/workflows/test-go.yml | 2 +- .github/workflows/test-helm.yml | 2 +- .github/workflows/test-sample-go.yml | 2 +- images/custom-scorecard-tests/Dockerfile | 8 ++++---- images/helm-operator/Dockerfile | 8 ++++---- images/operator-sdk/Dockerfile | 2 +- images/scorecard-storage/Dockerfile | 6 +++--- images/scorecard-test-kuttl/Dockerfile | 10 +++++----- images/scorecard-test/Dockerfile | 8 ++++---- images/scorecard-untar/Dockerfile | 6 +++--- .../helm/v1/scaffolds/internal/templates/dockerfile.go | 2 +- testdata/helm/memcached-operator/Dockerfile | 2 +- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3190a244aa5..863b71c96c3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,7 +27,7 @@ jobs: run: | REF="HEAD^" [[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2) - echo "::set-output name=skip::$(.github/workflows/check-docs-only.sh $REF)" + echo "skip=$(.github/workflows/check-docs-only.sh $REF)" >> $GITHUB_OUTPUT # Job to test release steps. This will only create a release remotely if run on a tagged commit. goreleaser: @@ -100,7 +100,7 @@ jobs: id: tags run: | IMG=quay.io/${{ github.repository_owner }}/${{ matrix.id }} - echo ::set-output name=tags::$(.github/workflows/get_image_tags.sh "$IMG" "v") + echo tags=$(.github/workflows/get_image_tags.sh "$IMG" "v") >> $GITHUB_OUTPUT - name: build and push uses: docker/build-push-action@v6 @@ -146,7 +146,7 @@ jobs: id: tags run: | IMG=quay.io/${{ github.repository_owner }}/scorecard-test-kuttl - echo ::set-output name=tags::$(.github/workflows/get_image_tags.sh "$IMG" "scorecard-kuttl/v") + echo tags=$(.github/workflows/get_image_tags.sh "$IMG" "scorecard-kuttl/v") >> $GITHUB_OUTPUT - name: build and push uses: docker/build-push-action@v6 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fd63511fd2b..e402088bd8d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,7 +18,7 @@ jobs: run: | REF="HEAD^" [[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2) - echo "::set-output name=skip::$(.github/workflows/check-docs-only.sh $REF)" + echo "skip=$(.github/workflows/check-docs-only.sh $REF)" >> $GITHUB_OUTPUT integration: name: integration diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml index f08524ed104..3b686274058 100644 --- a/.github/workflows/test-go.yml +++ b/.github/workflows/test-go.yml @@ -21,7 +21,7 @@ jobs: run: | REF="HEAD^" [[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2) - echo "::set-output name=skip::$(.github/workflows/check-docs-only.sh $REF)" + echo "skip=$(.github/workflows/check-docs-only.sh $REF)" >> $GITHUB_OUTPUT e2e: name: e2e diff --git a/.github/workflows/test-helm.yml b/.github/workflows/test-helm.yml index 557b248f9df..ab1160c1abe 100644 --- a/.github/workflows/test-helm.yml +++ b/.github/workflows/test-helm.yml @@ -18,7 +18,7 @@ jobs: run: | REF="HEAD^" [[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2) - echo "::set-output name=skip::$(.github/workflows/check-docs-only.sh $REF)" + echo "skip=$(.github/workflows/check-docs-only.sh $REF)" >> $GITHUB_OUTPUT e2e: name: e2e diff --git a/.github/workflows/test-sample-go.yml b/.github/workflows/test-sample-go.yml index 5873f5824ba..f1f117c064a 100644 --- a/.github/workflows/test-sample-go.yml +++ b/.github/workflows/test-sample-go.yml @@ -18,7 +18,7 @@ jobs: run: | REF="HEAD^" [[ -z "${{ github.base_ref }}" ]] || REF=$(git show-ref ${{ github.base_ref }} | head -1 | cut -d' ' -f2) - echo "::set-output name=skip::$(.github/workflows/check-docs-only.sh $REF)" + echo "skip=$(.github/workflows/check-docs-only.sh $REF)" >> $GITHUB_OUTPUT e2e: name: e2e diff --git a/images/custom-scorecard-tests/Dockerfile b/images/custom-scorecard-tests/Dockerfile index 95a81e0231c..7a4f66ba06c 100644 --- a/images/custom-scorecard-tests/Dockerfile +++ b/images/custom-scorecard-tests/Dockerfile @@ -1,5 +1,5 @@ # Build the custom-scorecard-tests binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder ARG TARGETARCH WORKDIR /workspace @@ -19,9 +19,9 @@ RUN GOOS=linux GOARCH=$TARGETARCH make build/custom-scorecard-tests # Final image. FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 -ENV HOME=/opt/custom-scorecard-tests \ - USER_NAME=custom-scorecard-tests \ - USER_UID=1001 +ENV HOME /opt/custom-scorecard-tests +ENV USER_NAME custom-scorecard-tests +ENV USER_UID 1001 RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/images/helm-operator/Dockerfile b/images/helm-operator/Dockerfile index 35036a7eea3..4b55c8008e7 100644 --- a/images/helm-operator/Dockerfile +++ b/images/helm-operator/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder ARG TARGETARCH WORKDIR /workspace @@ -19,9 +19,9 @@ RUN GOOS=linux GOARCH=$TARGETARCH make build/helm-operator # Final image. FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 -ENV HOME=/opt/helm \ - USER_NAME=helm \ - USER_UID=1001 +ENV HOME /opt/helm +ENV USER_NAME helm +ENV USER_UID 1001 RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/images/operator-sdk/Dockerfile b/images/operator-sdk/Dockerfile index 775d998f16c..0bd9ad2f067 100644 --- a/images/operator-sdk/Dockerfile +++ b/images/operator-sdk/Dockerfile @@ -1,5 +1,5 @@ # Build the operator-sdk binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder ARG TARGETARCH WORKDIR /workspace diff --git a/images/scorecard-storage/Dockerfile b/images/scorecard-storage/Dockerfile index d0a17eba198..4f85b83c4d4 100644 --- a/images/scorecard-storage/Dockerfile +++ b/images/scorecard-storage/Dockerfile @@ -1,9 +1,9 @@ FROM docker.io/busybox:1.36 ## Create a new non-root user to run as -ENV HOME=/opt/scorecard-untar \ - USER_NAME=scorecard-untar \ - USER_UID=1001 +ENV HOME /opt/scorecard-untar +ENV USER_NAME scorecard-untar +ENV USER_UID 1001 RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/images/scorecard-test-kuttl/Dockerfile b/images/scorecard-test-kuttl/Dockerfile index 0c4f9d81d4c..204fc1ecf7e 100644 --- a/images/scorecard-test-kuttl/Dockerfile +++ b/images/scorecard-test-kuttl/Dockerfile @@ -1,5 +1,5 @@ # Build the scorecard-test-kuttl binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder ARG TARGETARCH ARG BUILDPLATFORM @@ -21,10 +21,10 @@ RUN GOOS=linux GOARCH=$TARGETARCH make build/scorecard-test-kuttl #FROM kudobuilder/kuttl@sha256:8d4dad161521450db95f88fe0e62487cc6587c5818df2a4e750fb9e54c082170 FROM kudobuilder/kuttl:v0.15.0 -ENV HOME=/opt/scorecard-test-kuttl \ - USER_NAME=scorecard-test-kuttl \ - USER_UID=1001 \ - KUBECONFIG= +ENV HOME /opt/scorecard-test-kuttl +ENV USER_NAME scorecard-test-kuttl +ENV USER_UID 1001 +ENV KUBECONFIG "" RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/images/scorecard-test/Dockerfile b/images/scorecard-test/Dockerfile index cf417394cb6..5236d07d96f 100644 --- a/images/scorecard-test/Dockerfile +++ b/images/scorecard-test/Dockerfile @@ -1,5 +1,5 @@ # Build the scorecard-test binary -FROM --platform=$BUILDPLATFORM golang:1.21 as builder +FROM --platform=$BUILDPLATFORM golang:1.21 AS builder ARG TARGETARCH WORKDIR /workspace @@ -19,9 +19,9 @@ RUN GOOS=linux GOARCH=$TARGETARCH make build/scorecard-test # Final image. FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 -ENV HOME=/opt/scorecard-test \ - USER_NAME=scorecard-test \ - USER_UID=1001 +ENV HOME /opt/scorecard-test +ENV USER_NAME scorecard-test +ENV USER_UID 1001 RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/images/scorecard-untar/Dockerfile b/images/scorecard-untar/Dockerfile index a6f72053748..805aabb2ac8 100644 --- a/images/scorecard-untar/Dockerfile +++ b/images/scorecard-untar/Dockerfile @@ -1,9 +1,9 @@ FROM registry.access.redhat.com/ubi8:8.7 ## Create a new non-root user to run as -ENV HOME=/opt/scorecard-untar \ - USER_NAME=scorecard-untar \ - USER_UID=1001 +ENV HOME /opt/scorecard-untar +ENV USER_NAME scorecard-untar +ENV USER_UID 1001 RUN echo "${USER_NAME}:x:${USER_UID}:0:${USER_NAME} user:${HOME}:/sbin/nologin" >> /etc/passwd diff --git a/internal/plugins/helm/v1/scaffolds/internal/templates/dockerfile.go b/internal/plugins/helm/v1/scaffolds/internal/templates/dockerfile.go index 9cc3139cfca..1d4266d0552 100644 --- a/internal/plugins/helm/v1/scaffolds/internal/templates/dockerfile.go +++ b/internal/plugins/helm/v1/scaffolds/internal/templates/dockerfile.go @@ -48,7 +48,7 @@ func (f *Dockerfile) SetTemplateDefaults() error { const dockerfileTemplate = `# Build the manager binary FROM quay.io/operator-framework/helm-operator:{{.HelmOperatorVersion}} -ENV HOME=/opt/helm +ENV HOME /opt/helm COPY watches.yaml ${HOME}/watches.yaml COPY helm-charts ${HOME}/helm-charts WORKDIR ${HOME} diff --git a/testdata/helm/memcached-operator/Dockerfile b/testdata/helm/memcached-operator/Dockerfile index 9abcc9d8af9..a6b5b1e5712 100644 --- a/testdata/helm/memcached-operator/Dockerfile +++ b/testdata/helm/memcached-operator/Dockerfile @@ -1,7 +1,7 @@ # Build the manager binary FROM quay.io/operator-framework/helm-operator:v1.37.0 -ENV HOME=/opt/helm +ENV HOME /opt/helm COPY watches.yaml ${HOME}/watches.yaml COPY helm-charts ${HOME}/helm-charts WORKDIR ${HOME}