Skip to content

Commit bce5610

Browse files
authored
Merge pull request #29 from dahalperin/swipat
chore: add SWIPAT required changes
2 parents c0eac43 + ac81437 commit bce5610

File tree

13 files changed

+3548
-1
lines changed

13 files changed

+3548
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: License Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, master]
7+
8+
jobs:
9+
call-license-check:
10+
uses: Mellanox/cloud-orchestration-reusable-workflows/.github/workflows/license-check-reusable.yml@main

Dockerfile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
# Build the image
218
FROM golang:1.24 as builder
319

@@ -18,8 +34,9 @@ RUN task build
1834

1935
# Use distroless as minimal base image to package the manager binary
2036
# Refer to https://github.com/GoogleContainerTools/distroless for more details
21-
FROM gcr.io/distroless/static-debian11:latest
37+
FROM nvcr.io/nvidia/distroless/go:v3.1.8
2238
WORKDIR /
2339
COPY --from=builder /workspace/build/nic-feature-discovery .
40+
COPY . /src
2441

2542
ENTRYPOINT [ "/nic-feature-discovery" ]

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include make/license.mk

THIRD_PARTY_NOTICES

Lines changed: 3323 additions & 0 deletions
Large diffs are not rendered by default.

Taskfile.dist.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
version: "3"
218

319
set: [pipefail, e]

make/license.mk

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This file contains makefile targets to update copyrights and third party notices in the repo
2+
3+
# --- Configurable license header settings ---
4+
COPYRIGHT_YEAR ?= $(shell date +%Y)
5+
COPYRIGHT_OWNER ?= NVIDIA CORPORATION & AFFILIATES
6+
COPYRIGHT_STYLE ?= apache
7+
COPYRIGHT_FLAGS ?= -s
8+
COPYRIGHT_EXCLUDE ?= vendor deployment config bundle .*
9+
GIT_LS_FILES_EXCLUDES := $(foreach d,$(COPYRIGHT_EXCLUDE),:^"$(d)")
10+
11+
# --- Tool paths ---
12+
BIN_DIR ?= ./bin
13+
ADDLICENSE ?= $(BIN_DIR)/addlicense
14+
ADDLICENSE_VERSION ?= latest
15+
GO_LICENSES ?= $(BIN_DIR)/go-licenses
16+
GO_LICENSES_VERSION ?= latest
17+
18+
# Ensure bin dir exists
19+
$(BIN_DIR):
20+
@mkdir -p $(BIN_DIR)
21+
22+
# Install addlicense locally
23+
.PHONY: addlicense
24+
addlicense: $(BIN_DIR)
25+
@if [ ! -f "$(ADDLICENSE)" ]; then \
26+
echo "Installing addlicense to $(ADDLICENSE)..."; \
27+
GOBIN=$(abspath $(BIN_DIR)) go install github.com/google/addlicense@$(ADDLICENSE_VERSION); \
28+
else \
29+
echo "addlicense already installed at $(ADDLICENSE)"; \
30+
fi
31+
32+
# Check headers
33+
.PHONY: copyright-check
34+
copyright-check: addlicense
35+
@echo "Checking copyright headers..."
36+
@git ls-files '*' $(GIT_LS_FILES_EXCLUDES) | xargs grep -ILi "$(COPYRIGHT_OWNER)" | xargs -r $(ADDLICENSE) -check -c "$(COPYRIGHT_OWNER)" -l $(COPYRIGHT_STYLE) $(COPYRIGHT_FLAGS) -y $(COPYRIGHT_YEAR)
37+
38+
# Fix headers
39+
.PHONY: copyright
40+
copyright: addlicense
41+
@echo "Adding copyright headers..."
42+
@git ls-files '*' $(GIT_LS_FILES_EXCLUDES) | xargs grep -ILi "$(COPYRIGHT_OWNER)" | xargs -r $(ADDLICENSE) -c "$(COPYRIGHT_OWNER)" -l $(COPYRIGHT_STYLE) $(COPYRIGHT_FLAGS) -y $(COPYRIGHT_YEAR)
43+
44+
# Install go-licenses tool locally
45+
.PHONY: go-licenses
46+
go-licenses: $(BIN_DIR)
47+
@if [ ! -f "$(GO_LICENSES)" ]; then \
48+
echo "Installing go-licenses to $(GO_LICENSES)..."; \
49+
GOBIN=$(abspath $(BIN_DIR)) go install github.com/google/go-licenses@$(GO_LICENSES_VERSION); \
50+
else \
51+
echo "go-licenses already installed at $(GO_LICENSES)"; \
52+
fi
53+
54+
# Generate THIRD_PARTY_NOTICES from go-licenses
55+
.PHONY: third-party-licenses
56+
third-party-licenses: go-licenses
57+
@echo "Collecting third-party licenses..."
58+
@$(GO_LICENSES) save ./... --save_path=third_party_licenses --ignore=github.com/k8snetworkplumbingwg/cni-log
59+
@echo "Generating THIRD_PARTY_NOTICES..."
60+
@find third_party_licenses -type f -iname "LICENSE*" | sort --ignore-case | while read -r license; do \
61+
echo "---"; \
62+
echo "## $$(basename $$(dirname "$$license"))"; \
63+
echo ""; \
64+
cat "$$license"; \
65+
echo ""; \
66+
done > THIRD_PARTY_NOTICES
67+
@rm -rf third_party_licenses
68+
@echo "THIRD_PARTY_NOTICES updated."

pkg/dependencies/os.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
// Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// SPDX-License-Identifier: Apache-2.0
16+
117
package dependencies
218

319
import (

skaffold.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
apiVersion: skaffold/v4beta6
218
kind: Config
319
metadata:

taskfiles/Image.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
version: '3'
218

319
vars:

taskfiles/InstallDeps.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Copyright 2025 NVIDIA CORPORATION & AFFILIATES
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
117
version: '3'
218

319
vars:

0 commit comments

Comments
 (0)