Skip to content

Commit 6249df0

Browse files
committed
ensure config/rbac files are getting license header
1 parent de706c9 commit 6249df0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

deploy/cloud/operator/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,29 @@ manifests: controller-gen ensure-yq ## Generate WebhookConfiguration, ClusterRol
113113
if [ -d "../helm/crds/templates/" ]; then \
114114
cp config/crd/bases/*.yaml ../helm/crds/templates/; \
115115
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
116139

117140
.PHONY: generate
118141
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

0 commit comments

Comments
 (0)