Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shellcheck in k8s.io/metrics #73214

Merged
merged 1 commit into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions hack/.shellcheck_failures
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@
./pkg/kubectl/cmd/edit/testdata/record_testcase.sh
./pkg/util/verify-util-pkg.sh
./plugin/pkg/admission/imagepolicy/gencerts.sh
./staging/src/k8s.io/metrics/hack/update-codegen.sh
./staging/src/k8s.io/metrics/hack/verify-codegen.sh
./test/cmd/apply.sh
./test/cmd/apps.sh
./test/cmd/authorization.sh
Expand Down
16 changes: 8 additions & 8 deletions staging/src/k8s.io/metrics/hack/update-codegen.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

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
Expand All @@ -28,13 +28,13 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge
#
# we skip informers and listers for metrics, because we don't quite support the requisite operations yet
# we skip generating the internal clientset as it's not really needed
${CODEGEN_PKG}/generate-internal-groups.sh deepcopy,conversion \
"${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,conversion \
k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis k8s.io/metrics/pkg/apis \
"metrics:v1alpha1,v1beta1 custom_metrics:v1beta1 external_metrics:v1beta1" \
--output-base "$(dirname ${BASH_SOURCE})/../../.." \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
${CODEGEN_PKG}/generate-groups.sh client \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
"${CODEGEN_PKG}/generate-groups.sh" client \
k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis \
"metrics:v1alpha1,v1beta1" \
--output-base "$(dirname ${BASH_SOURCE})/../../.." \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
3 changes: 1 addition & 2 deletions staging/src/k8s.io/metrics/hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
SCRIPT_BASE=${SCRIPT_ROOT}/../..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is SCRIPT_BASE used anywhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This env is not exported, and not used in this script.
And k8s.io/kubernetes/hack/verify-codegen.sh can also pass if we delete this env here.

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

DIFFROOT="${SCRIPT_ROOT}/pkg"
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
Expand Down