Skip to content

Commit

Permalink
fix some shellcheck errors
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Gomezdelatorre <gabriel.gomezdelatorre@hotmail.com>
  • Loading branch information
gabrielggg committed Feb 15, 2024
1 parent 934bafa commit 534d923
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion hack/make-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ set -o errexit
set -o nounset
set -o pipefail

readonly SCRIPT_ROOT
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
readonly SCRIPT_ROOT
cd "$SCRIPT_ROOT"

# Wrap sed to deal with GNU and BSD sed flags.
Expand Down
27 changes: 14 additions & 13 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
# shellcheck disable=SC2086
#Double quote to prevent globbing and word splitting. dont apply for this specific scenario

# Copyright 2020 The Kubernetes Authors.
#
Expand All @@ -18,17 +20,17 @@ set -o errexit
set -o nounset
set -o pipefail

readonly SCRIPT_ROOT
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
readonly SCRIPT_ROOT

# Keep outer module cache so we don't need to redownload them each time.
# The build cache already is persisted.
readonly GOMODCACHE
GOMODCACHE="$(go env GOMODCACHE)"
readonly GOMODCACHE
readonly GO111MODULE="on"
readonly GOFLAGS="-mod=readonly"
readonly GOPATH
GOPATH="$(mktemp -d)"
readonly GOPATH
readonly MIN_REQUIRED_GO_VER="1.19"

function go_version_matches {
Expand Down Expand Up @@ -66,31 +68,30 @@ go run k8s.io/code-generator/cmd/client-gen \
--input-base "" \
--input "${API_DIR}" \
--output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" \
"${COMMON_FLAGS}"
${COMMON_FLAGS}

echo "Generating listers at ${OUTPUT_PKG}/listers"
go run k8s.io/code-generator/cmd/lister-gen \
--input-dirs "${API_DIR}" \
--output-package "${OUTPUT_PKG}/listers" \
"${COMMON_FLAGS}"
${COMMON_FLAGS}

echo "Generating informers at ${OUTPUT_PKG}/informers"
go run k8s.io/code-generator/cmd/informer-gen \
--input-dirs "${API_DIR}" \
--versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}/${CLIENTSET_NAME}" \
--listers-package "${OUTPUT_PKG}/listers" \
--output-package "${OUTPUT_PKG}/informers" \
"${COMMON_FLAGS}"
${COMMON_FLAGS}

VERSION=v1alpha1 ## Add more versions eventually
VERSION=v1alpha1
echo "Generating ${VERSION} register at ${APIS_PKG}/apis/${VERSION}"
go run k8s.io/code-generator/cmd/register-gen \
--input-dirs "${APIS_PKG}/apis/${VERSION}" \
--output-package "${APIS_PKG}/apis/${VERSION}" \
"${COMMON_FLAGS}"
--input-dirs "${APIS_PKG}/apis/${VERSION}" \
--output-package "${APIS_PKG}/apis/${VERSION}" \
${COMMON_FLAGS}

echo "Generating ${VERSION} deepcopy at ${APIS_PKG}/apis/${VERSION}"
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
object:headerFile="${SCRIPT_ROOT}"/hack/boilerplate.generatego.txt \
paths="${APIS_PKG}/apis/${VERSION}"

object:headerFile="${SCRIPT_ROOT}/hack/boilerplate.generatego.txt" \
paths="${APIS_PKG}/apis/${VERSION}"
2 changes: 1 addition & 1 deletion hack/verify-golint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ set -o nounset
set -o pipefail

readonly VERSION="v1.55.2"
readonly KUBE_ROOT
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
readonly KUBE_ROOT

cd "${KUBE_ROOT}"

Expand Down
4 changes: 3 additions & 1 deletion hack/verify-govet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set -euo pipefail

echo "Verifying govet"

go vet "$(go list ./... | grep -v vendor)"
for key in $(go list ./... | grep -v vendor); do
go vet "$key"
done

echo "Done"

0 comments on commit 534d923

Please sign in to comment.