Skip to content

Commit

Permalink
Fix unbound variable
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Gamez Diaz <[email protected]>
  • Loading branch information
antgamdia committed Jan 8, 2024
1 parent ae4e96c commit fbf4e8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/apprepository-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG lint
# https://github.com/golangci/golangci-lint/releases
ARG GOLANGCILINT_VERSION="1.55.2"

RUN if [ ! -z "$lint" ]; then \
RUN if [ ! -z ${lint:-} ]; then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCILINT_VERSION && \
# Run golangci-lint to detect issues
golangci-lint run --timeout=10m ./cmd/apprepository-controller/... && \
Expand All @@ -27,7 +27,7 @@ RUN if [ ! -z "$lint" ]; then \
# https://github.com/golang/go/issues/27719#issuecomment-514747274
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOPROXY="https://proxy.golang.org,direct" CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/apprepository-controller/cmd.version=$VERSION" ./cmd/apprepository-controller
GOPROXY="https://proxy.golang.org,direct" CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/apprepository-controller/cmd.version=${VERSION:-}" ./cmd/apprepository-controller

FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand Down
4 changes: 2 additions & 2 deletions cmd/asset-syncer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG lint
# https://github.com/golangci/golangci-lint/releases
ARG GOLANGCILINT_VERSION="1.55.2"

RUN if [ ! -z "$lint" ]; then \
RUN if [ ! -z ${lint:-} ]; then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCILINT_VERSION && \
# Run golangci-lint to detect issues
golangci-lint run --timeout=10m ./cmd/asset-syncer/... && \
Expand All @@ -27,7 +27,7 @@ RUN if [ ! -z "$lint" ]; then \
# https://github.com/golang/go/issues/27719#issuecomment-514747274
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOPROXY="https://proxy.golang.org,direct" CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/asset-syncer/cmd.version=$VERSION" ./cmd/asset-syncer
GOPROXY="https://proxy.golang.org,direct" CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/asset-syncer/cmd.version=${VERSION:-}" ./cmd/asset-syncer

FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubeapps-apis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARG GOLANGCILINT_VERSION="1.55.2"
ARG GRPC_HEALTH_PROBE_VERSION="0.4.24"

# Install lint tools
RUN if [ ! -z "$lint" ]; then \
RUN if [ ! -z ${lint:-} ]; then \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCILINT_VERSION; \
fi

Expand All @@ -43,7 +43,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
COPY pkg pkg
COPY cmd cmd

RUN if [ ! -z "$lint" ]; then \
RUN if [ ! -z ${lint:-} ]; then \
# Run golangci-lint to detect issues
golangci-lint run --timeout=10m ./cmd/kubeapps-apis/... && \
golangci-lint run --timeout=10m ./pkg/...; \
Expand Down

0 comments on commit fbf4e8c

Please sign in to comment.