Files
kubernetes/hack/verify-api-lint.sh
Tim Hockin 252d584cb7 Implement validation-gen lint for CI
Results in errors like:

```
$ ./hack/verify-api-lint.sh
+++ [0317 09:00:04] Generating validation code for 69 targets
F0317 09:00:05.637556 1049736 targets.go:363] lint failed:
  type k8s.io/api/core/v1.PodAffinityTerm:
    field LabelSelector: conflicting tags: {+k8s:optional, +k8s:required}: fields cannot be both optional and required
    field Namespaces: conflicting tags: {+default, +k8s:required}: fields with default values are always optional
!!! [0317 09:00:05] Call tree:
!!! [0317 09:00:05]  1: hack/update-codegen.sh:1132 codegen::validation(...)
```
2025-03-21 08:20:04 -07:00

31 lines
866 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2024 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.
# This script runs API lint tools.
#
# Usage: `hack/verify-api-lint.sh`.
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
cd "${KUBE_ROOT}"
LINT=true hack/update-codegen.sh