Merge pull request #124898 from alexzielenski/apiserver/prerelease-ga-tags

Require prerelease lifecycle tags on GA types
This commit is contained in:
Kubernetes Prow Robot
2024-05-29 08:02:42 -07:00
committed by GitHub
73 changed files with 1736 additions and 56 deletions

View File

@@ -24,24 +24,22 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
# Tags must be put on all non-alpha API types
# prerelease-lifecycle-gen itself makes sure every type with TypeMeta in the
# package contains atleast an introduced tag
DIRGLOBS=(
"staging/src/k8s.io/api/**/*/doc.go"
"staging/src/k8s.io/kube-aggregator/pkg/apis/**/*/doc.go"
"staging/src/k8s.io/apiextensions-apiserver/pkg/apis/**/*/doc.go"
)
cd "${KUBE_ROOT}"
if git --no-pager grep -L '// +k8s:prerelease-lifecycle-gen=true' -- 'staging/src/k8s.io/api/**/*beta*/doc.go'; then
echo "!!! Some beta packages doc.go do not include prerelease-lifecycle tags."
echo "To fix these errors, add '// +k8s:prerelease-lifecycle-gen=true' to doc.go and"
echo "add '// +k8s:prerelease-lifecycle-gen:introduced=1.<release>' to every type that embeds metav1.TypeMeta"
exit 1
fi
if git --no-pager grep -L '// +k8s:prerelease-lifecycle-gen=true' -- 'staging/src/k8s.io/kube-aggregator/pkg/apis/**/*beta*/doc.go'; then
echo "!!! Some beta packages doc.go do not include prerelease-lifecycle tags."
echo "To fix these errors, add '// +k8s:prerelease-lifecycle-gen=true' to doc.go and"
echo "add '// +k8s:prerelease-lifecycle-gen:introduced=1.<release>' to every type that embeds metav1.TypeMeta"
exit 1
fi
if git --no-pager grep -L '// +k8s:prerelease-lifecycle-gen=true' -- 'staging/src/k8s.io/apiextensions-apiserver/pkg/apis/**/*beta*/doc.go'; then
echo "!!! Some beta packages doc.go do not include prerelease-lifecycle tags."
echo "To fix these errors, add '// +k8s:prerelease-lifecycle-gen=true' to doc.go and"
echo "add '// +k8s:prerelease-lifecycle-gen:introduced=1.<release>' to every type that embeds metav1.TypeMeta"
exit 1
fi
for DOCGLOB in "${DIRGLOBS[@]}"; do
if git --no-pager grep -L '// +k8s:prerelease-lifecycle-gen=true' -- "$DOCGLOB" ":!*api*/*alpha*/doc.go"; then
echo "!!! Some non-alpha packages doc.go do not include prerelease-lifecycle tags."
echo "To fix these errors, add '// +k8s:prerelease-lifecycle-gen=true' to doc.go and"
echo "add '// +k8s:prerelease-lifecycle-gen:introduced=1.<release>' to every type that embeds metav1.TypeMeta"
exit 1
fi
done