From c4ce97f1a5dbb63ff7208ce23450641d21d9e37a Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Tue, 18 Aug 2020 10:56:47 -0400 Subject: [PATCH] Remove old hack/{update,verify}-codegen.sh scripts We now use hack/module.sh codegen{,_verify}. See f95f585. Signed-off-by: Andrew Keesler --- hack/update-codegen.sh | 45 ------------------------------------------ hack/update.sh | 2 +- hack/verify-codegen.sh | 45 ------------------------------------------ hack/verify.sh | 2 +- 4 files changed, 2 insertions(+), 92 deletions(-) delete mode 100755 hack/update-codegen.sh delete mode 100755 hack/verify-codegen.sh diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh deleted file mode 100755 index c1b1b5eb1..000000000 --- a/hack/update-codegen.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2020 VMware, Inc. -# SPDX-License-Identifier: Apache-2.0 -set -euo pipefail -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" - -BASE_PKG="github.com/suzerain-io/placeholder-name" -CODEGEN_IMAGE=${CODEGEN_IMAGE:-gcr.io/tanzu-user-authentication/k8s-code-generator-1.19:latest} - -function codegen() { - PKG="$1" - shift 1 - if [[ ${IN_DOCKER:-0} -eq 1 ]]; then - # Already in a container ($CODEGEN_IMAGE). - mkdir -p "$(dirname /go/src/$BASE_PKG/$PKG)" - test -e "/go/src/$BASE_PKG/$PKG" || ln -s "$ROOT/$PKG" "/go/src/$BASE_PKG/$PKG" - cd "/go/src/$BASE_PKG/$PKG" - /codegen/entrypoint.sh "$@" 2>&1 \ - | sed "s|^|$1 ($PKG) > |" - else - # Local workstation. - docker run \ - --rm \ - --volume "$ROOT:/go/src/$BASE_PKG" \ - --workdir "/go/src/$BASE_PKG/$PKG" \ - "${CODEGEN_IMAGE}" \ - /codegen/entrypoint.sh "$@" 2>&1 \ - | sed "s|^|$1 ($PKG) > |" - fi -} - -codegen kubernetes/1.19/api generate-groups deepcopy,defaulter \ - $BASE_PKG/kubernetes/1.19/api/generated \ - $BASE_PKG/kubernetes/1.19/api/apis \ - "placeholder:v1alpha1 crdsplaceholder:v1alpha1" -codegen kubernetes/1.19/api generate-internal-groups deepcopy,defaulter,conversion,openapi \ - $BASE_PKG/kubernetes/1.19/api/generated \ - $BASE_PKG/kubernetes/1.19/api/apis \ - $BASE_PKG/kubernetes/1.19/api/apis \ - "placeholder:v1alpha1 crdsplaceholder:v1alpha1" -codegen kubernetes/1.19/client-go generate-groups client,lister,informer \ - $BASE_PKG/kubernetes/1.19/client-go \ - $BASE_PKG/kubernetes/1.19/api/apis \ - "placeholder:v1alpha1 crdsplaceholder:v1alpha1" diff --git a/hack/update.sh b/hack/update.sh index e855c2d74..32345a0ef 100755 --- a/hack/update.sh +++ b/hack/update.sh @@ -6,4 +6,4 @@ set -euo pipefail ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" "$ROOT/hack/module.sh" tidy -"$ROOT/hack/update-codegen.sh" +"$ROOT/hack/module.sh" codegen diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh deleted file mode 100755 index f8cdb3a18..000000000 --- a/hack/verify-codegen.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" - -DIFFROOT="${ROOT}/kubernetes" -TMP_DIFFROOT="${ROOT}/_tmp/kubernetes" -_tmp="${ROOT}/_tmp" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" - -"${ROOT}/hack/update-codegen.sh" -echo "diffing ${DIFFROOT} against freshly generated codegen" -ret=0 -diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? -cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" -if [[ $ret -eq 0 ]] -then - echo "${DIFFROOT} up to date." -else - echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" - exit 1 -fi diff --git a/hack/verify.sh b/hack/verify.sh index 7a9ea7f42..5f1997258 100755 --- a/hack/verify.sh +++ b/hack/verify.sh @@ -6,4 +6,4 @@ set -euo pipefail ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" "$ROOT/hack/module.sh" lint -"$ROOT/hack/verify-codegen.sh" +"$ROOT/hack/module.sh" codegen_verify