From f72b79cc2a5c20cc0fd8d983ebb825de614d1c4b Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 8 Jun 2021 15:20:17 +0200 Subject: [PATCH] Move pkg to cmd/nvidia-container-toolkit This change moves the pkg folder to `cmd/nvidia-container-toolkit` to better match go best practices. This allows, for example, for the `cmd/nvidia-container-toolkit` to be go installed. The only package included in `pkg` was `main`. Signed-off-by: Evan Lezar --- Makefile | 5 ++--- {pkg => cmd/nvidia-container-toolkit}/capabilities.go | 0 {pkg => cmd/nvidia-container-toolkit}/container_config.go | 0 {pkg => cmd/nvidia-container-toolkit}/container_test.go | 0 {pkg => cmd/nvidia-container-toolkit}/hook_config.go | 0 {pkg => cmd/nvidia-container-toolkit}/hook_test.go | 0 {pkg => cmd/nvidia-container-toolkit}/main.go | 0 7 files changed, 2 insertions(+), 3 deletions(-) rename {pkg => cmd/nvidia-container-toolkit}/capabilities.go (100%) rename {pkg => cmd/nvidia-container-toolkit}/container_config.go (100%) rename {pkg => cmd/nvidia-container-toolkit}/container_test.go (100%) rename {pkg => cmd/nvidia-container-toolkit}/hook_config.go (100%) rename {pkg => cmd/nvidia-container-toolkit}/hook_test.go (100%) rename {pkg => cmd/nvidia-container-toolkit}/main.go (100%) diff --git a/Makefile b/Makefile index cfc07265..19b1defd 100644 --- a/Makefile +++ b/Makefile @@ -21,17 +21,16 @@ LIB_VERSION := 1.5.0 LIB_TAG ?= GOLANG_VERSION := 1.16.3 -GOLANG_PKG_PATH := github.com/NVIDIA/nvidia-container-toolkit/pkg +MODULE := github.com/NVIDIA/nvidia-container-toolkit # By default run all native docker-based targets docker-native: include $(CURDIR)/docker/docker.mk binary: - go build -ldflags "-s -w" -o "$(LIB_NAME)" $(GOLANG_PKG_PATH) + go build -ldflags "-s -w" -o "$(LIB_NAME)" $(MODULE)/cmd/$(LIB_NAME) # Define the check targets for the Golang codebase -MODULE := . .PHONY: check fmt assert-fmt ineffassign lint misspell vet check: assert-fmt lint misspell vet fmt: diff --git a/pkg/capabilities.go b/cmd/nvidia-container-toolkit/capabilities.go similarity index 100% rename from pkg/capabilities.go rename to cmd/nvidia-container-toolkit/capabilities.go diff --git a/pkg/container_config.go b/cmd/nvidia-container-toolkit/container_config.go similarity index 100% rename from pkg/container_config.go rename to cmd/nvidia-container-toolkit/container_config.go diff --git a/pkg/container_test.go b/cmd/nvidia-container-toolkit/container_test.go similarity index 100% rename from pkg/container_test.go rename to cmd/nvidia-container-toolkit/container_test.go diff --git a/pkg/hook_config.go b/cmd/nvidia-container-toolkit/hook_config.go similarity index 100% rename from pkg/hook_config.go rename to cmd/nvidia-container-toolkit/hook_config.go diff --git a/pkg/hook_test.go b/cmd/nvidia-container-toolkit/hook_test.go similarity index 100% rename from pkg/hook_test.go rename to cmd/nvidia-container-toolkit/hook_test.go diff --git a/pkg/main.go b/cmd/nvidia-container-toolkit/main.go similarity index 100% rename from pkg/main.go rename to cmd/nvidia-container-toolkit/main.go