@@ -44,6 +44,19 @@ help: ## Display this help.
4444
4545# #@ Development
4646
47+ .PHONY : check
48+ check : generate manifests generate-api-docs
49+ @echo " > Checking for uncommitted changes"
50+ @if [ -n " $$ (git status --porcelain)" ]; then \
51+ echo " ERROR: Git tree is dirty after running validation steps." ; \
52+ echo " Please check the diff to identify the step that dirtied the tree." ; \
53+ git --no-pager status; \
54+ git --no-pager diff; \
55+ exit 1; \
56+ fi
57+ @echo " > Check complete"
58+
59+
4760.PHONY : ensure-yq
4861ensure-yq :
4962 @if ! command -v yq & > /dev/null; then \
@@ -100,6 +113,29 @@ manifests: controller-gen ensure-yq ## Generate WebhookConfiguration, ClusterRol
100113 if [ -d " ../helm/crds/templates/" ]; then \
101114 cp config/crd/bases/* .yaml ../helm/crds/templates/; \
102115 fi
116+ echo " Adding NVIDIA header to RBAC files"
117+ for file in config/rbac/* .yaml; do \
118+ if [ -f " $$ file" ] && ! head -20 " $$ file" | grep -q " NVIDIA CORPORATION" ; then \
119+ { printf ' %s\n' \
120+ ' # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.' \
121+ ' # SPDX-License-Identifier: Apache-2.0' \
122+ ' #' \
123+ ' # Licensed under the Apache License, Version 2.0 (the "License");' \
124+ ' # you may not use this file except in compliance with the License.' \
125+ ' # You may obtain a copy of the License at' \
126+ ' #' \
127+ ' # http://www.apache.org/licenses/LICENSE-2.0' \
128+ ' #' \
129+ ' # Unless required by applicable law or agreed to in writing, software' \
130+ ' # distributed under the License is distributed on an "AS IS" BASIS,' \
131+ ' # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.' \
132+ ' # See the License for the specific language governing permissions and' \
133+ ' # limitations under the License.' \
134+ ' ' ; \
135+ cat " $$ file" ; \
136+ } > " $$ file.tmp" && mv " $$ file.tmp" " $$ file" ; \
137+ fi ; \
138+ done
103139
104140.PHONY : generate
105141generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
0 commit comments