Remove old hack/{update,verify}-codegen.sh scripts

We now use hack/module.sh codegen{,_verify}. See f95f585.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
Andrew Keesler 2020-08-18 10:56:47 -04:00
parent f95f5857ef
commit c4ce97f1a5
No known key found for this signature in database
GPG Key ID: 27CE0444346F9413
4 changed files with 2 additions and 92 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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