diff --git a/.gitignore b/.gitignore index c91812a4b4..292630f9ea 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,7 @@ rootfs-conv/* /build/ deps/* -out/* \ No newline at end of file +out/* + +go.work +go.work.sum \ No newline at end of file diff --git a/Makefile b/Makefile index 362ddea7c6..e1a0f51129 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ clean: rm -rf bin deps rootfs out test: - cd $(SRCROOT) && go test -v ./internal/guest/... + cd $(SRCROOT) && $(GO) test -v ./internal/guest/... rootfs: out/rootfs.vhd diff --git a/cmd/containerd-shim-runhcs-v1/clone.go b/cmd/containerd-shim-runhcs-v1/clone.go index 221aabacab..42ebf71d63 100644 --- a/cmd/containerd-shim-runhcs-v1/clone.go +++ b/cmd/containerd-shim-runhcs-v1/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/delete.go b/cmd/containerd-shim-runhcs-v1/delete.go index 2f8c50e597..69905c0f72 100644 --- a/cmd/containerd-shim-runhcs-v1/delete.go +++ b/cmd/containerd-shim-runhcs-v1/delete.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/events.go b/cmd/containerd-shim-runhcs-v1/events.go index 267b315d40..f15479c282 100644 --- a/cmd/containerd-shim-runhcs-v1/events.go +++ b/cmd/containerd-shim-runhcs-v1/events.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/events_test.go b/cmd/containerd-shim-runhcs-v1/events_test.go index 04f3d4897c..8c70c1043c 100644 --- a/cmd/containerd-shim-runhcs-v1/events_test.go +++ b/cmd/containerd-shim-runhcs-v1/events_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import "context" diff --git a/cmd/containerd-shim-runhcs-v1/exec.go b/cmd/containerd-shim-runhcs-v1/exec.go index 5a476757d8..f39f150b46 100644 --- a/cmd/containerd-shim-runhcs-v1/exec.go +++ b/cmd/containerd-shim-runhcs-v1/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_clone.go b/cmd/containerd-shim-runhcs-v1/exec_clone.go index 078149f140..f2c2ce03ff 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_clone.go +++ b/cmd/containerd-shim-runhcs-v1/exec_clone.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_hcs.go b/cmd/containerd-shim-runhcs-v1/exec_hcs.go index b3b8e84ee9..ffad91cb5a 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/exec_hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_test.go b/cmd/containerd-shim-runhcs-v1/exec_test.go index 3ba98bdb65..ef4e5a698b 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_test.go +++ b/cmd/containerd-shim-runhcs-v1/exec_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go index 0a4b4e7eb7..466cdb8b91 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go +++ b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go index 066f6c0470..aab573d562 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go +++ b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/main.go b/cmd/containerd-shim-runhcs-v1/main.go index 375b2dcb46..f64d93ec30 100644 --- a/cmd/containerd-shim-runhcs-v1/main.go +++ b/cmd/containerd-shim-runhcs-v1/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/pod.go b/cmd/containerd-shim-runhcs-v1/pod.go index b241d3439c..5069f4014b 100644 --- a/cmd/containerd-shim-runhcs-v1/pod.go +++ b/cmd/containerd-shim-runhcs-v1/pod.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/pod_test.go b/cmd/containerd-shim-runhcs-v1/pod_test.go index ff9941c8ae..d3ad0ba8b5 100644 --- a/cmd/containerd-shim-runhcs-v1/pod_test.go +++ b/cmd/containerd-shim-runhcs-v1/pod_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/serve.go b/cmd/containerd-shim-runhcs-v1/serve.go index c772dbf4a8..47e204cbb6 100644 --- a/cmd/containerd-shim-runhcs-v1/serve.go +++ b/cmd/containerd-shim-runhcs-v1/serve.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service.go b/cmd/containerd-shim-runhcs-v1/service.go index c1a080eff5..92abc70a5c 100644 --- a/cmd/containerd-shim-runhcs-v1/service.go +++ b/cmd/containerd-shim-runhcs-v1/service.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal.go b/cmd/containerd-shim-runhcs-v1/service_internal.go index 0571a13cd3..3c64932e80 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go index 0d1fcc7766..7850630e62 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go index 43fbaa66d1..ad97a71790 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -609,7 +611,7 @@ func Test_TaskShim_waitInternal_InitTaskID_2ndExecID_Success(t *testing.T) { } } -func Test_TaskShim_statsInternal_InitTaskID_Sucess(t *testing.T) { +func Test_TaskShim_statsInternal_InitTaskID_Success(t *testing.T) { testNames := []string{"WCOW", "LCOW"} for i, isWCOW := range []bool{true, false} { t.Run(testNames[i], func(t *testing.T) { diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_test.go index 2d0e483963..1e23ccc678 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/start.go b/cmd/containerd-shim-runhcs-v1/start.go index 520ddcb7f3..a0c06afb64 100644 --- a/cmd/containerd-shim-runhcs-v1/start.go +++ b/cmd/containerd-shim-runhcs-v1/start.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task.go b/cmd/containerd-shim-runhcs-v1/task.go index 5a0210a4af..6bae368284 100644 --- a/cmd/containerd-shim-runhcs-v1/task.go +++ b/cmd/containerd-shim-runhcs-v1/task.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs.go b/cmd/containerd-shim-runhcs-v1/task_hcs.go index 8238e7f172..d32fade6e5 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs_test.go b/cmd/containerd-shim-runhcs-v1/task_hcs_test.go index cbeeaabda7..a279e434f5 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs_test.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_test.go b/cmd/containerd-shim-runhcs-v1/task_test.go index 9b73486dd7..cb9e975ecc 100644 --- a/cmd/containerd-shim-runhcs-v1/task_test.go +++ b/cmd/containerd-shim-runhcs-v1/task_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go b/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go index 576573466c..c99dea3483 100644 --- a/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go +++ b/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/device-util/main.go b/cmd/device-util/main.go index 8ca35f3d3a..61deb0f977 100644 --- a/cmd/device-util/main.go +++ b/cmd/device-util/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/jobobject-util/main.go b/cmd/jobobject-util/main.go index 34b18a31f0..5d52a53454 100644 --- a/cmd/jobobject-util/main.go +++ b/cmd/jobobject-util/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/computeagent_cache.go b/cmd/ncproxy/computeagent_cache.go index 66b7a93ca4..bc2200783f 100644 --- a/cmd/ncproxy/computeagent_cache.go +++ b/cmd/ncproxy/computeagent_cache.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -38,7 +40,6 @@ func (c *computeAgentCache) getAllAndClear() ([]*computeAgentClient, error) { results = append(results, agent) } return results, nil - } func (c *computeAgentCache) get(cid string) (*computeAgentClient, error) { diff --git a/cmd/ncproxy/config.go b/cmd/ncproxy/config.go index e75373f7f4..ab5e0aaae4 100644 --- a/cmd/ncproxy/config.go +++ b/cmd/ncproxy/config.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/hcn.go b/cmd/ncproxy/hcn.go index 7c0063f976..9f75e40332 100644 --- a/cmd/ncproxy/hcn.go +++ b/cmd/ncproxy/hcn.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/hcn_networking_test.go b/cmd/ncproxy/hcn_networking_test.go index e0bd32411c..0d4533ebe8 100644 --- a/cmd/ncproxy/hcn_networking_test.go +++ b/cmd/ncproxy/hcn_networking_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/main.go b/cmd/ncproxy/main.go index 2430c1a450..319b0d2759 100644 --- a/cmd/ncproxy/main.go +++ b/cmd/ncproxy/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/ncproxy.go b/cmd/ncproxy/ncproxy.go index 922c615741..f5de74c66f 100644 --- a/cmd/ncproxy/ncproxy.go +++ b/cmd/ncproxy/ncproxy.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -153,7 +155,6 @@ func (s *grpcService) AddNIC(ctx context.Context, req *ncproxygrpc.AddNICRequest return nil, err } return &ncproxygrpc.AddNICResponse{}, nil - } func (s *grpcService) ModifyNIC(ctx context.Context, req *ncproxygrpc.ModifyNICRequest) (_ *ncproxygrpc.ModifyNICResponse, err error) { diff --git a/cmd/ncproxy/ncproxy_networking_test.go b/cmd/ncproxy/ncproxy_networking_test.go index 4d30acdbb8..1171c9cce2 100644 --- a/cmd/ncproxy/ncproxy_networking_test.go +++ b/cmd/ncproxy/ncproxy_networking_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/run.go b/cmd/ncproxy/run.go index 4e49de4aa5..6bfbd590e7 100644 --- a/cmd/ncproxy/run.go +++ b/cmd/ncproxy/run.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/server.go b/cmd/ncproxy/server.go index 975650618c..1be82a1146 100644 --- a/cmd/ncproxy/server.go +++ b/cmd/ncproxy/server.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/server_test.go b/cmd/ncproxy/server_test.go index eb08925d50..15921e2fa9 100644 --- a/cmd/ncproxy/server_test.go +++ b/cmd/ncproxy/server_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/service.go b/cmd/ncproxy/service.go index 1d45b81a55..83219c5868 100644 --- a/cmd/ncproxy/service.go +++ b/cmd/ncproxy/service.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/utilities_test.go b/cmd/ncproxy/utilities_test.go index 5a8411558d..fc9af997cd 100644 --- a/cmd/ncproxy/utilities_test.go +++ b/cmd/ncproxy/utilities_test.go @@ -32,7 +32,6 @@ func networkExists(targetName string, networks []*ncproxygrpc.GetNetworkResponse return true } } - } return false } @@ -50,7 +49,6 @@ func endpointExists(targetName string, endpoints []*ncproxygrpc.GetEndpointRespo return true } } - } return false } diff --git a/cmd/runhcs/container.go b/cmd/runhcs/container.go index 6726606839..c4b8d4ee43 100644 --- a/cmd/runhcs/container.go +++ b/cmd/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -36,7 +38,7 @@ type persistedState struct { ID string `json:",omitempty"` // Owner is the owner value passed into the runhcs command and may be `""`. Owner string `json:",omitempty"` - // SandboxID is the sandbox identifer passed in via OCI specifications. This + // SandboxID is the sandbox identifier passed in via OCI specifications. This // can either be the sandbox itself or the sandbox this container should run // in. See `parseSandboxAnnotations`. SandboxID string `json:",omitempty"` @@ -203,8 +205,8 @@ func launchShim(cmd, pidFile, logFile string, args []string, data interface{}) ( // different runtimes to represent a sandbox ID, and sandbox type. // // If found returns the tuple `(sandboxID, isSandbox)` where `isSandbox == true` -// indicates the identifer is the sandbox itself; `isSandbox == false` indicates -// the identifer is the sandbox in which to place this container. Otherwise +// indicates the identifier is the sandbox itself; `isSandbox == false` indicates +// the identifier is the sandbox in which to place this container. Otherwise // returns `("", false)`. func parseSandboxAnnotations(a map[string]string) (string, bool) { var t, id string diff --git a/cmd/runhcs/create-scratch.go b/cmd/runhcs/create-scratch.go index 78bb614171..e9a1f8cfcf 100644 --- a/cmd/runhcs/create-scratch.go +++ b/cmd/runhcs/create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/create.go b/cmd/runhcs/create.go index 7443729a53..cb1f8023ad 100644 --- a/cmd/runhcs/create.go +++ b/cmd/runhcs/create.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/delete.go b/cmd/runhcs/delete.go index 3edf3b8d41..91a150ff7a 100644 --- a/cmd/runhcs/delete.go +++ b/cmd/runhcs/delete.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/exec.go b/cmd/runhcs/exec.go index 3b4941f77c..f97f0f84a4 100644 --- a/cmd/runhcs/exec.go +++ b/cmd/runhcs/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/kill.go b/cmd/runhcs/kill.go index 1e7328c824..2f21a7c080 100644 --- a/cmd/runhcs/kill.go +++ b/cmd/runhcs/kill.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/list.go b/cmd/runhcs/list.go index a1b1a7555e..a022015e08 100644 --- a/cmd/runhcs/list.go +++ b/cmd/runhcs/list.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/main.go b/cmd/runhcs/main.go index 4ee443b837..39eeba503f 100644 --- a/cmd/runhcs/main.go +++ b/cmd/runhcs/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/pause.go b/cmd/runhcs/pause.go index b7878c2e11..56973d2d1c 100644 --- a/cmd/runhcs/pause.go +++ b/cmd/runhcs/pause.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/prepare-disk.go b/cmd/runhcs/prepare-disk.go index 6349e02911..b562d0e9db 100644 --- a/cmd/runhcs/prepare-disk.go +++ b/cmd/runhcs/prepare-disk.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/ps.go b/cmd/runhcs/ps.go index d83181b967..d989d31ac2 100644 --- a/cmd/runhcs/ps.go +++ b/cmd/runhcs/ps.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/run.go b/cmd/runhcs/run.go index a88bf8b4df..29f325e8ca 100644 --- a/cmd/runhcs/run.go +++ b/cmd/runhcs/run.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/shim.go b/cmd/runhcs/shim.go index cc37503eb7..c0c57919c1 100644 --- a/cmd/runhcs/shim.go +++ b/cmd/runhcs/shim.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/spec.go b/cmd/runhcs/spec.go index 005afdf442..4fca5c8c8b 100644 --- a/cmd/runhcs/spec.go +++ b/cmd/runhcs/spec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/start.go b/cmd/runhcs/start.go index d5d004cdf5..019e7e39b3 100644 --- a/cmd/runhcs/start.go +++ b/cmd/runhcs/start.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/state.go b/cmd/runhcs/state.go index bae1c3deea..2ece4fab9f 100644 --- a/cmd/runhcs/state.go +++ b/cmd/runhcs/state.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/tty.go b/cmd/runhcs/tty.go index 1a15c94740..c784c8ff05 100644 --- a/cmd/runhcs/tty.go +++ b/cmd/runhcs/tty.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/utils.go b/cmd/runhcs/utils.go index 846dd73351..f682ceecb1 100644 --- a/cmd/runhcs/utils.go +++ b/cmd/runhcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/utils_test.go b/cmd/runhcs/utils_test.go index 8fbebcdae2..5dfeb07e03 100644 --- a/cmd/runhcs/utils_test.go +++ b/cmd/runhcs/utils_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/vm.go b/cmd/runhcs/vm.go index 9e684e486b..93e96242f4 100644 --- a/cmd/runhcs/vm.go +++ b/cmd/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/exec.go b/cmd/shimdiag/exec.go index dc54332777..403ca7f987 100644 --- a/cmd/shimdiag/exec.go +++ b/cmd/shimdiag/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/list.go b/cmd/shimdiag/list.go index 4bb771acec..fec1b04031 100644 --- a/cmd/shimdiag/list.go +++ b/cmd/shimdiag/list.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/share.go b/cmd/shimdiag/share.go index 328e32f83f..703ba65996 100644 --- a/cmd/shimdiag/share.go +++ b/cmd/shimdiag/share.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/shimdiag.go b/cmd/shimdiag/shimdiag.go index 55fbb4687b..e658011d9c 100644 --- a/cmd/shimdiag/shimdiag.go +++ b/cmd/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/stacks.go b/cmd/shimdiag/stacks.go index 1ef6561d85..81d58236f2 100644 --- a/cmd/shimdiag/stacks.go +++ b/cmd/shimdiag/stacks.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/create.go b/cmd/wclayer/create.go index 5a48cbc355..7d797ec6cd 100644 --- a/cmd/wclayer/create.go +++ b/cmd/wclayer/create.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/export.go b/cmd/wclayer/export.go index b02b2eb365..d739e457de 100644 --- a/cmd/wclayer/export.go +++ b/cmd/wclayer/export.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/import.go b/cmd/wclayer/import.go index ea0f823aa8..523e0fba27 100644 --- a/cmd/wclayer/import.go +++ b/cmd/wclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/mount.go b/cmd/wclayer/mount.go index 096aba60cf..613de1f8ea 100644 --- a/cmd/wclayer/mount.go +++ b/cmd/wclayer/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/remove.go b/cmd/wclayer/remove.go index db5f73df8a..da27617047 100644 --- a/cmd/wclayer/remove.go +++ b/cmd/wclayer/remove.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/volumemountutils.go b/cmd/wclayer/volumemountutils.go index 316252c8f5..b9a02e8477 100644 --- a/cmd/wclayer/volumemountutils.go +++ b/cmd/wclayer/volumemountutils.go @@ -1,3 +1,5 @@ +//go:build windows + package main // Simple wrappers around SetVolumeMountPoint and DeleteVolumeMountPoint diff --git a/cmd/wclayer/wclayer.go b/cmd/wclayer/wclayer.go index cc8c0dca14..1a4a9b2370 100644 --- a/cmd/wclayer/wclayer.go +++ b/cmd/wclayer/wclayer.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/computestorage/attach.go b/computestorage/attach.go index 7f1f2823dd..05b6ea7bd4 100644 --- a/computestorage/attach.go +++ b/computestorage/attach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/destroy.go b/computestorage/destroy.go index 8e28e6c504..8dd942bab9 100644 --- a/computestorage/destroy.go +++ b/computestorage/destroy.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/detach.go b/computestorage/detach.go index 435473257e..934ee5b1a6 100644 --- a/computestorage/detach.go +++ b/computestorage/detach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/export.go b/computestorage/export.go index 2db6d40399..cf90d9b6c9 100644 --- a/computestorage/export.go +++ b/computestorage/export.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/format.go b/computestorage/format.go index 61d8d5a634..05e0729f50 100644 --- a/computestorage/format.go +++ b/computestorage/format.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/helpers.go b/computestorage/helpers.go index 87fee452cd..3bbbc226c0 100644 --- a/computestorage/helpers.go +++ b/computestorage/helpers.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/import.go b/computestorage/import.go index 0c61dab329..a40b4037cc 100644 --- a/computestorage/import.go +++ b/computestorage/import.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/initialize.go b/computestorage/initialize.go index 53ed8ea6ed..ddd8f318da 100644 --- a/computestorage/initialize.go +++ b/computestorage/initialize.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/mount.go b/computestorage/mount.go index fcdbbef814..6e445e766b 100644 --- a/computestorage/mount.go +++ b/computestorage/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/setup.go b/computestorage/setup.go index 06aaf841e8..4b27b895ad 100644 --- a/computestorage/setup.go +++ b/computestorage/setup.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/container.go b/container.go index bfd722898e..640e0b26f4 100644 --- a/container.go +++ b/container.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/errors.go b/errors.go index a1a2912177..594bbfb7a8 100644 --- a/errors.go +++ b/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/ext4/internal/compactext4/verify_linux_test.go b/ext4/internal/compactext4/verify_linux_test.go index 86ece03b50..e88d59c874 100644 --- a/ext4/internal/compactext4/verify_linux_test.go +++ b/ext4/internal/compactext4/verify_linux_test.go @@ -1,3 +1,5 @@ +//go:build linux + package compactext4 import ( diff --git a/hcn/doc.go b/hcn/doc.go new file mode 100644 index 0000000000..83b2fffb02 --- /dev/null +++ b/hcn/doc.go @@ -0,0 +1,3 @@ +// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server +// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +package hcn diff --git a/hcn/hcn.go b/hcn/hcn.go index fe3d13a052..17539b8694 100644 --- a/hcn/hcn.go +++ b/hcn/hcn.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( diff --git a/hcn/hcnendpoint.go b/hcn/hcnendpoint.go index 213cfe0b1f..267bbe7cb1 100644 --- a/hcn/hcnendpoint.go +++ b/hcn/hcnendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnendpoint_test.go b/hcn/hcnendpoint_test.go index 02ae9d63a6..a7eeda2e94 100644 --- a/hcn/hcnendpoint_test.go +++ b/hcn/hcnendpoint_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnerrors.go b/hcn/hcnerrors.go index 1d52d2e72a..8b719fa112 100644 --- a/hcn/hcnerrors.go +++ b/hcn/hcnerrors.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( @@ -87,7 +87,7 @@ func new(hr error, title string, rest string) error { // // Note that the below errors are not errors returned by hcn itself -// we wish to seperate them as they are shim usage error +// we wish to separate them as they are shim usage error // // NetworkNotFoundError results from a failed search for a network by Id or Name diff --git a/hcn/hcnerrors_test.go b/hcn/hcnerrors_test.go index b064d25a73..671f7cf7df 100644 --- a/hcn/hcnerrors_test.go +++ b/hcn/hcnerrors_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnglobals.go b/hcn/hcnglobals.go index 14903bc5e9..25e368fc23 100644 --- a/hcn/hcnglobals.go +++ b/hcn/hcnglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnloadbalancer.go b/hcn/hcnloadbalancer.go index 28fa855656..f68d39053e 100644 --- a/hcn/hcnloadbalancer.go +++ b/hcn/hcnloadbalancer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnloadbalancer_test.go b/hcn/hcnloadbalancer_test.go index a3ec0764ff..28dc12705b 100644 --- a/hcn/hcnloadbalancer_test.go +++ b/hcn/hcnloadbalancer_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnnamespace.go b/hcn/hcnnamespace.go index 12e69de9cc..7539e39fa8 100644 --- a/hcn/hcnnamespace.go +++ b/hcn/hcnnamespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnnamespace_test.go b/hcn/hcnnamespace_test.go index c075705525..d4c19d15f1 100644 --- a/hcn/hcnnamespace_test.go +++ b/hcn/hcnnamespace_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnnetwork.go b/hcn/hcnnetwork.go index c36b136387..41dcdac24a 100644 --- a/hcn/hcnnetwork.go +++ b/hcn/hcnnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnnetwork_test.go b/hcn/hcnnetwork_test.go index 642be24ede..2508845975 100644 --- a/hcn/hcnnetwork_test.go +++ b/hcn/hcnnetwork_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnpolicy.go b/hcn/hcnpolicy.go index 56bde82e1b..a695f1c27d 100644 --- a/hcn/hcnpolicy.go +++ b/hcn/hcnpolicy.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnroute.go b/hcn/hcnroute.go index 52e2498462..d0761d6bd0 100644 --- a/hcn/hcnroute.go +++ b/hcn/hcnroute.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnroute_test.go b/hcn/hcnroute_test.go index bbf5c83dd8..9d3222b7d8 100644 --- a/hcn/hcnroute_test.go +++ b/hcn/hcnroute_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnsupport.go b/hcn/hcnsupport.go index bacb91feda..00af20be31 100644 --- a/hcn/hcnsupport.go +++ b/hcn/hcnsupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnsupport_test.go b/hcn/hcnsupport_test.go index 3b9967cd46..35c2f16fcf 100644 --- a/hcn/hcnsupport_test.go +++ b/hcn/hcnsupport_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnutils_test.go b/hcn/hcnutils_test.go index 63d378f58f..039f920ad6 100644 --- a/hcn/hcnutils_test.go +++ b/hcn/hcnutils_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnv1schema_test.go b/hcn/hcnv1schema_test.go index 9683da9329..7558627915 100644 --- a/hcn/hcnv1schema_test.go +++ b/hcn/hcnv1schema_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hnsv1_test.go b/hcn/hnsv1_test.go index d727851d60..ef668cb8a9 100644 --- a/hcn/hnsv1_test.go +++ b/hcn/hnsv1_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcsshim.go b/hcsshim.go index ceb3ac85ee..95dc2a0255 100644 --- a/hcsshim.go +++ b/hcsshim.go @@ -1,3 +1,5 @@ +//go:build windows + // Shim for the Host Compute Service (HCS) to manage Windows Server // containers and Hyper-V containers. diff --git a/hnsendpoint.go b/hnsendpoint.go index 9e0059447d..ea71135acc 100644 --- a/hnsendpoint.go +++ b/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnsglobals.go b/hnsglobals.go index 2b53819047..c564bf4a35 100644 --- a/hnsglobals.go +++ b/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnsnetwork.go b/hnsnetwork.go index 25240d9ccc..925c212495 100644 --- a/hnsnetwork.go +++ b/hnsnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnspolicylist.go b/hnspolicylist.go index 55aaa4a50e..9bfe61ee83 100644 --- a/hnspolicylist.go +++ b/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnssupport.go b/hnssupport.go index 69405244b6..d97681e0ca 100644 --- a/hnssupport.go +++ b/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/interface.go b/interface.go index 300eb59966..81a2819516 100644 --- a/interface.go +++ b/interface.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/internal/clone/doc.go b/internal/clone/doc.go new file mode 100644 index 0000000000..c65f2e337e --- /dev/null +++ b/internal/clone/doc.go @@ -0,0 +1 @@ +package clone diff --git a/internal/clone/registry.go b/internal/clone/registry.go index 67fb7ef077..1727d57afb 100644 --- a/internal/clone/registry.go +++ b/internal/clone/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package clone import ( diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 91a7da0277..758eb78880 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -1,5 +1,5 @@ -// Package cmd provides functionality used to execute commands inside of containers -// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +//go:build windows + package cmd import ( diff --git a/internal/cmd/cmd_test.go b/internal/cmd/cmd_test.go index 5a7b7b98c3..c87fd07793 100644 --- a/internal/cmd/cmd_test.go +++ b/internal/cmd/cmd_test.go @@ -1,4 +1,5 @@ -// build +windows +//go:build windows +// +build windows package cmd diff --git a/internal/cmd/diag.go b/internal/cmd/diag.go index f4caff3251..e397bb85ee 100644 --- a/internal/cmd/diag.go +++ b/internal/cmd/diag.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/doc.go b/internal/cmd/doc.go new file mode 100644 index 0000000000..7fe443fc92 --- /dev/null +++ b/internal/cmd/doc.go @@ -0,0 +1,3 @@ +// Package cmd provides functionality used to execute commands inside of containers +// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +package cmd diff --git a/internal/cmd/io.go b/internal/cmd/io.go index 0912af160c..75ddd1f355 100644 --- a/internal/cmd/io.go +++ b/internal/cmd/io.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_binary.go b/internal/cmd/io_binary.go index ecfd1fa5ef..989a53c93c 100644 --- a/internal/cmd/io_binary.go +++ b/internal/cmd/io_binary.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_binary_test.go b/internal/cmd/io_binary_test.go index 7ff5b24176..fcb00a511b 100644 --- a/internal/cmd/io_binary_test.go +++ b/internal/cmd/io_binary_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_npipe.go b/internal/cmd/io_npipe.go index 63b9f9b732..614f34ca29 100644 --- a/internal/cmd/io_npipe.go +++ b/internal/cmd/io_npipe.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( @@ -53,7 +55,7 @@ func NewNpipeIO(ctx context.Context, stdin, stdout, stderr string, terminal bool } // We don't have any retry logic for stdin as there's no good way to detect that we'd even need to retry. If the process forwarding // stdin to the container (some client interface to exec a process in a container) exited, we'll get EOF which io.Copy treats as - // success. For fifos on Linux it seems if all fd's for the write end of the pipe dissappear, which is the same scenario, then + // success. For fifos on Linux it seems if all fd's for the write end of the pipe disappear, which is the same scenario, then // the read end will get EOF as well. nio.sin = c } diff --git a/internal/cni/doc.go b/internal/cni/doc.go new file mode 100644 index 0000000000..b94015b5aa --- /dev/null +++ b/internal/cni/doc.go @@ -0,0 +1 @@ +package cni diff --git a/internal/cni/registry.go b/internal/cni/registry.go index 2afcc6981c..3543a590d0 100644 --- a/internal/cni/registry.go +++ b/internal/cni/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/internal/cni/registry_test.go b/internal/cni/registry_test.go index 9533129734..854d3727fd 100644 --- a/internal/cni/registry_test.go +++ b/internal/cni/registry_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/internal/computeagent/doc.go b/internal/computeagent/doc.go index 4389559b9a..7df98b60c0 100644 --- a/internal/computeagent/doc.go +++ b/internal/computeagent/doc.go @@ -7,5 +7,4 @@ // The mock service is compiled using the following command: // // mockgen -source="computeagent.pb.go" -package="computeagent_mock" > mock\computeagent_mock.pb.go - package computeagent diff --git a/internal/conpty/conpty.go b/internal/conpty/conpty.go index 179c74389d..230c905738 100644 --- a/internal/conpty/conpty.go +++ b/internal/conpty/conpty.go @@ -1,3 +1,5 @@ +//go:build windows + package conpty import ( diff --git a/internal/conpty/doc.go b/internal/conpty/doc.go new file mode 100644 index 0000000000..012771ea11 --- /dev/null +++ b/internal/conpty/doc.go @@ -0,0 +1 @@ +package conpty diff --git a/internal/copyfile/copyfile.go b/internal/copyfile/copyfile.go index fe7a2faa11..61aa2dc405 100644 --- a/internal/copyfile/copyfile.go +++ b/internal/copyfile/copyfile.go @@ -1,3 +1,5 @@ +//go:build windows + package copyfile import ( diff --git a/internal/copyfile/doc.go b/internal/copyfile/doc.go new file mode 100644 index 0000000000..a2812a6ee8 --- /dev/null +++ b/internal/copyfile/doc.go @@ -0,0 +1 @@ +package copyfile diff --git a/internal/cow/cow.go b/internal/cow/cow.go index 27a62a7238..c6eeb167b9 100644 --- a/internal/cow/cow.go +++ b/internal/cow/cow.go @@ -1,3 +1,5 @@ +//go:build windows + package cow import ( diff --git a/internal/cpugroup/cpugroup.go b/internal/cpugroup/cpugroup.go index 61cd703586..3abaa9c439 100644 --- a/internal/cpugroup/cpugroup.go +++ b/internal/cpugroup/cpugroup.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/internal/cpugroup/cpugroup_test.go b/internal/cpugroup/cpugroup_test.go index 13cd3c83ac..c7b35e8998 100644 --- a/internal/cpugroup/cpugroup_test.go +++ b/internal/cpugroup/cpugroup_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/internal/cpugroup/doc.go b/internal/cpugroup/doc.go new file mode 100644 index 0000000000..a2c3357977 --- /dev/null +++ b/internal/cpugroup/doc.go @@ -0,0 +1 @@ +package cpugroup diff --git a/internal/credentials/credentials.go b/internal/credentials/credentials.go index 0c98eb1493..d9ec9a3490 100644 --- a/internal/credentials/credentials.go +++ b/internal/credentials/credentials.go @@ -1,9 +1,6 @@ //go:build windows // +build windows -// Package credentials holds the necessary structs and functions for adding -// and removing Container Credential Guard instances (shortened to CCG -// normally) for V2 HCS schema containers. package credentials import ( diff --git a/internal/credentials/doc.go b/internal/credentials/doc.go new file mode 100644 index 0000000000..cbf23ed082 --- /dev/null +++ b/internal/credentials/doc.go @@ -0,0 +1,4 @@ +// Package credentials holds the necessary structs and functions for adding +// and removing Container Credential Guard instances (shortened to CCG +// normally) for V2 HCS schema containers. +package credentials diff --git a/internal/devices/doc.go b/internal/devices/doc.go new file mode 100644 index 0000000000..c1c721e298 --- /dev/null +++ b/internal/devices/doc.go @@ -0,0 +1 @@ +package devices diff --git a/internal/exec/doc.go b/internal/exec/doc.go new file mode 100644 index 0000000000..bda552188c --- /dev/null +++ b/internal/exec/doc.go @@ -0,0 +1,3 @@ +// Package exec implements a minimalized external process launcher. It exists to work around some shortcomings for +// Windows scenarios that aren't exposed via the os/exec package. +package exec diff --git a/internal/exec/exec.go b/internal/exec/exec.go index 79463b3fb2..bfe197cdea 100644 --- a/internal/exec/exec.go +++ b/internal/exec/exec.go @@ -1,5 +1,5 @@ -// Package exec implements a minimalized external process launcher. It exists to work around some shortcomings for -// Windows scenarios that aren't exposed via the os/exec package. +//go:build windows + package exec import ( diff --git a/internal/exec/exec_test.go b/internal/exec/exec_test.go index 7afdf34ad6..7ee38265c7 100644 --- a/internal/exec/exec_test.go +++ b/internal/exec/exec_test.go @@ -1,3 +1,5 @@ +//go:build windows + package exec import ( diff --git a/internal/exec/options.go b/internal/exec/options.go index 0039125f66..30bd77db02 100644 --- a/internal/exec/options.go +++ b/internal/exec/options.go @@ -1,3 +1,5 @@ +//go:build windows + package exec import ( diff --git a/internal/gcs/bridge.go b/internal/gcs/bridge.go index 22d89dd303..1e3e7c201d 100644 --- a/internal/gcs/bridge.go +++ b/internal/gcs/bridge.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/bridge_test.go b/internal/gcs/bridge_test.go index 6699ac3a32..11363804a7 100644 --- a/internal/gcs/bridge_test.go +++ b/internal/gcs/bridge_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/container.go b/internal/gcs/container.go index 6ec5b8b84f..bf704fb548 100644 --- a/internal/gcs/container.go +++ b/internal/gcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/doc.go b/internal/gcs/doc.go new file mode 100644 index 0000000000..260915232f --- /dev/null +++ b/internal/gcs/doc.go @@ -0,0 +1 @@ +package gcs diff --git a/internal/gcs/guestconnection.go b/internal/gcs/guestconnection.go index bdf796010c..bb28d890ff 100644 --- a/internal/gcs/guestconnection.go +++ b/internal/gcs/guestconnection.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/guestconnection_test.go b/internal/gcs/guestconnection_test.go index 1202ffa4e7..f43a30d0bf 100644 --- a/internal/gcs/guestconnection_test.go +++ b/internal/gcs/guestconnection_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/iochannel_test.go b/internal/gcs/iochannel_test.go index 64352f96d9..e4ab3e92d0 100644 --- a/internal/gcs/iochannel_test.go +++ b/internal/gcs/iochannel_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/process.go b/internal/gcs/process.go index 628cb8b0d7..60141e9f70 100644 --- a/internal/gcs/process.go +++ b/internal/gcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/protocol.go b/internal/gcs/protocol.go index 840dcb2392..8450222a1a 100644 --- a/internal/gcs/protocol.go +++ b/internal/gcs/protocol.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/guest/bridge/bridge.go b/internal/guest/bridge/bridge.go index 6b371950b0..402034f479 100644 --- a/internal/guest/bridge/bridge.go +++ b/internal/guest/bridge/bridge.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package bridge defines the bridge struct, which implements the control loop -// and functions of the GCS's bridge client. package bridge import ( diff --git a/internal/guest/bridge/doc.go b/internal/guest/bridge/doc.go new file mode 100644 index 0000000000..727a615b7b --- /dev/null +++ b/internal/guest/bridge/doc.go @@ -0,0 +1,3 @@ +// Package bridge defines the bridge struct, which implements the control loop +// and functions of the GCS's bridge client. +package bridge diff --git a/internal/guest/kmsg/doc.go b/internal/guest/kmsg/doc.go new file mode 100644 index 0000000000..88a860d8e1 --- /dev/null +++ b/internal/guest/kmsg/doc.go @@ -0,0 +1,8 @@ +// Package kmsg contains support for parsing Linux kernel log entries read from +// /dev/kmsg. These are the same log entries that can be read via the `dmesg` +// command. Each read from /dev/kmsg is guaranteed to return a single log entry, +// so no line-splitting is required. +// +// More information can be found here: +// https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg +package kmsg diff --git a/internal/guest/kmsg/kmsg.go b/internal/guest/kmsg/kmsg.go index 429235bb16..112b26b2cc 100644 --- a/internal/guest/kmsg/kmsg.go +++ b/internal/guest/kmsg/kmsg.go @@ -1,10 +1,5 @@ -// Package kmsg contains support for parsing Linux kernel log entries read from -// /dev/kmsg. These are the same log entries that can be read via the `dmesg` -// command. Each read from /dev/kmsg is guaranteed to return a single log entry, -// so no line-splitting is required. -// -// More information can be found here: -// https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg +//go:build linux + package kmsg import ( diff --git a/internal/guest/network/doc.go b/internal/guest/network/doc.go new file mode 100644 index 0000000000..1ae2e9d505 --- /dev/null +++ b/internal/guest/network/doc.go @@ -0,0 +1 @@ +package network diff --git a/internal/guest/prot/protocol.go b/internal/guest/prot/protocol.go index 84d05ff446..538a206997 100644 --- a/internal/guest/prot/protocol.go +++ b/internal/guest/prot/protocol.go @@ -47,7 +47,7 @@ type MessageType uint32 const ( // MtNone is the default MessageType. MtNone = 0 - // MtRequest is the MessageType when a request is recieved. + // MtRequest is the MessageType when a request is received. MtRequest = 0x10000000 // MtResponse is the MessageType used to send a response. MtResponse = 0x20000000 @@ -144,7 +144,7 @@ const ( ComputeSystemNotificationV1 = 0x30100101 ) -// String returns the string representation of the message identifer. +// String returns the string representation of the message identifier. func (mi MessageIdentifier) String() string { switch mi { case MiNone: @@ -241,7 +241,7 @@ type ProtocolSupport struct { MaximumProtocolVersion uint32 } -// OsType defines the operating system type identifer of the guest hosting the +// OsType defines the operating system type identifier of the guest hosting the // GCS. type OsType string @@ -619,7 +619,7 @@ func (mrp *MessageResponseBase) Base() *MessageResponseBase { } // NegotiateProtocolResponse is the message to the HCS responding to a -// NegotiateProtocol message. It specifies the prefered protocol version and +// NegotiateProtocol message. It specifies the preferred protocol version and // available capabilities of the GCS. type NegotiateProtocolResponse struct { MessageResponseBase diff --git a/internal/guest/runtime/doc.go b/internal/guest/runtime/doc.go new file mode 100644 index 0000000000..d777766756 --- /dev/null +++ b/internal/guest/runtime/doc.go @@ -0,0 +1,3 @@ +// Package runtime defines the interface between the GCS and an OCI container +// runtime. +package runtime diff --git a/internal/guest/runtime/hcsv2/doc.go b/internal/guest/runtime/hcsv2/doc.go new file mode 100644 index 0000000000..dd988e19f4 --- /dev/null +++ b/internal/guest/runtime/hcsv2/doc.go @@ -0,0 +1 @@ +package hcsv2 diff --git a/internal/guest/runtime/runc/doc.go b/internal/guest/runtime/runc/doc.go new file mode 100644 index 0000000000..bc3fc77b48 --- /dev/null +++ b/internal/guest/runtime/runc/doc.go @@ -0,0 +1,3 @@ +// Package runc defines an implementation of the Runtime interface which uses +// runC as the container runtime. +package runc diff --git a/internal/guest/runtime/runc/runc.go b/internal/guest/runtime/runc/runc.go index 060bbf6867..2e31c26cfb 100644 --- a/internal/guest/runtime/runc/runc.go +++ b/internal/guest/runtime/runc/runc.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package runc defines an implementation of the Runtime interface which uses -// runC as the container runtime. package runc import ( diff --git a/internal/guest/runtime/runtime.go b/internal/guest/runtime/runtime.go index 8fc0c28bcd..a8c5231cfc 100644 --- a/internal/guest/runtime/runtime.go +++ b/internal/guest/runtime/runtime.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package runtime defines the interface between the GCS and an OCI container -// runtime. package runtime import ( diff --git a/internal/guest/stdio/doc.go b/internal/guest/stdio/doc.go new file mode 100644 index 0000000000..873c9263d4 --- /dev/null +++ b/internal/guest/stdio/doc.go @@ -0,0 +1 @@ +package stdio diff --git a/internal/guest/storage/crypt/doc.go b/internal/guest/storage/crypt/doc.go new file mode 100644 index 0000000000..283fd7b6ab --- /dev/null +++ b/internal/guest/storage/crypt/doc.go @@ -0,0 +1 @@ +package crypt diff --git a/internal/guest/storage/devicemapper/doc.go b/internal/guest/storage/devicemapper/doc.go new file mode 100644 index 0000000000..8506e94175 --- /dev/null +++ b/internal/guest/storage/devicemapper/doc.go @@ -0,0 +1 @@ +package devicemapper diff --git a/internal/guest/storage/doc.go b/internal/guest/storage/doc.go new file mode 100644 index 0000000000..82be0547ed --- /dev/null +++ b/internal/guest/storage/doc.go @@ -0,0 +1 @@ +package storage diff --git a/internal/guest/storage/overlay/doc.go b/internal/guest/storage/overlay/doc.go new file mode 100644 index 0000000000..3b838cf74b --- /dev/null +++ b/internal/guest/storage/overlay/doc.go @@ -0,0 +1 @@ +package overlay diff --git a/internal/guest/storage/pci/doc.go b/internal/guest/storage/pci/doc.go new file mode 100644 index 0000000000..93928ae73c --- /dev/null +++ b/internal/guest/storage/pci/doc.go @@ -0,0 +1 @@ +package pci diff --git a/internal/guest/storage/plan9/doc.go b/internal/guest/storage/plan9/doc.go new file mode 100644 index 0000000000..215f738050 --- /dev/null +++ b/internal/guest/storage/plan9/doc.go @@ -0,0 +1 @@ +package plan9 diff --git a/internal/guest/storage/pmem/doc.go b/internal/guest/storage/pmem/doc.go new file mode 100644 index 0000000000..b7fcd4b8cf --- /dev/null +++ b/internal/guest/storage/pmem/doc.go @@ -0,0 +1 @@ +package pmem diff --git a/internal/guest/storage/scsi/doc.go b/internal/guest/storage/scsi/doc.go new file mode 100644 index 0000000000..5ae8677e96 --- /dev/null +++ b/internal/guest/storage/scsi/doc.go @@ -0,0 +1 @@ +package scsi diff --git a/internal/guest/transport/doc.go b/internal/guest/transport/doc.go new file mode 100644 index 0000000000..02b02e9cc4 --- /dev/null +++ b/internal/guest/transport/doc.go @@ -0,0 +1,3 @@ +// Package transport defines the interfaces describing a connection-like data +// transport mechanism. +package transport diff --git a/internal/guest/transport/transport.go b/internal/guest/transport/transport.go index 0bff0299d5..59fdb804e4 100644 --- a/internal/guest/transport/transport.go +++ b/internal/guest/transport/transport.go @@ -1,5 +1,3 @@ -// Package transport defines the interfaces describing a connection-like data -// transport mechanism. package transport import ( diff --git a/internal/hcs/callback.go b/internal/hcs/callback.go index d13772b030..7b27173c3a 100644 --- a/internal/hcs/callback.go +++ b/internal/hcs/callback.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/doc.go b/internal/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/internal/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/internal/hcs/errors.go b/internal/hcs/errors.go index 85584f5b87..226dad2fbc 100644 --- a/internal/hcs/errors.go +++ b/internal/hcs/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/process.go b/internal/hcs/process.go index 605856f2a3..4bf3a167a5 100644 --- a/internal/hcs/process.go +++ b/internal/hcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -254,7 +256,7 @@ func (process *Process) waitBackground() { } // Wait waits for the process to exit. If the process has already exited returns -// the pervious error (if any). +// the previous error (if any). func (process *Process) Wait() error { <-process.waitBlock return process.waitError @@ -441,7 +443,6 @@ func (process *Process) CloseStderr(ctx context.Context) (err error) { if process.stderr != nil { process.stderr.Close() process.stderr = nil - } return nil } diff --git a/internal/hcs/schema1/schema1.go b/internal/hcs/schema1/schema1.go index b621c55938..d1f219cfad 100644 --- a/internal/hcs/schema1/schema1.go +++ b/internal/hcs/schema1/schema1.go @@ -1,3 +1,5 @@ +//go:build windows + package schema1 import ( @@ -101,7 +103,7 @@ type ContainerConfig struct { HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM Servicing bool `json:",omitempty"` // True if this container is for servicing AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution - DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution + DNSSearchList string `json:",omitempty"` // Comma separated list of DNS suffixes to use for name resolution ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise. TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start diff --git a/internal/hcs/service.go b/internal/hcs/service.go index a634dfc151..a46b0051df 100644 --- a/internal/hcs/service.go +++ b/internal/hcs/service.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/system.go b/internal/hcs/system.go index 75499c967f..052d08ccc3 100644 --- a/internal/hcs/system.go +++ b/internal/hcs/system.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -592,7 +594,7 @@ func (computeSystem *System) unregisterCallback(ctx context.Context) error { return nil } - // hcsUnregisterComputeSystemCallback has its own syncronization + // hcsUnregisterComputeSystemCallback has its own synchronization // to wait for all callbacks to complete. We must NOT hold the callbackMapLock. err := vmcompute.HcsUnregisterComputeSystemCallback(ctx, handle) if err != nil { diff --git a/internal/hcs/utils.go b/internal/hcs/utils.go index 3342e5bb94..5dcb97eb39 100644 --- a/internal/hcs/utils.go +++ b/internal/hcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/waithelper.go b/internal/hcs/waithelper.go index db4e14fdfb..6e161e6aa1 100644 --- a/internal/hcs/waithelper.go +++ b/internal/hcs/waithelper.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcserror/doc.go b/internal/hcserror/doc.go new file mode 100644 index 0000000000..ce70676789 --- /dev/null +++ b/internal/hcserror/doc.go @@ -0,0 +1 @@ +package hcserror diff --git a/internal/hcserror/hcserror.go b/internal/hcserror/hcserror.go index 921c2c8556..bad2705416 100644 --- a/internal/hcserror/hcserror.go +++ b/internal/hcserror/hcserror.go @@ -1,3 +1,5 @@ +//go:build windows + package hcserror import ( diff --git a/internal/hcsoci/create.go b/internal/hcsoci/create.go index 058530aac1..6df67ee876 100644 --- a/internal/hcsoci/create.go +++ b/internal/hcsoci/create.go @@ -132,7 +132,6 @@ func verifyCloneContainerSpecs(templateSpec, cloneSpec *specs.Spec) error { } func validateContainerConfig(ctx context.Context, coi *createOptionsInternal) error { - if coi.HostingSystem != nil && coi.HostingSystem.IsTemplate && !coi.isTemplate { return fmt.Errorf("only a template container can be created inside a template pod. Any other combination is not valid") } diff --git a/internal/hcsoci/devices.go b/internal/hcsoci/devices.go index 4f17a715d6..ccc19d4af8 100644 --- a/internal/hcsoci/devices.go +++ b/internal/hcsoci/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( @@ -117,7 +119,6 @@ func handleAssignedDevicesWindows( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure @@ -175,7 +176,6 @@ func handleAssignedDevicesLCOW( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure diff --git a/internal/hcsoci/doc.go b/internal/hcsoci/doc.go new file mode 100644 index 0000000000..b4b2ac611b --- /dev/null +++ b/internal/hcsoci/doc.go @@ -0,0 +1 @@ +package hcsoci diff --git a/internal/hcsoci/hcsdoc_wcow.go b/internal/hcsoci/hcsdoc_wcow.go index b3080399a6..1d25b44438 100644 --- a/internal/hcsoci/hcsdoc_wcow.go +++ b/internal/hcsoci/hcsdoc_wcow.go @@ -42,7 +42,6 @@ func createMountsConfig(ctx context.Context, coi *createOptionsInternal) (*mount // TODO: Mapped pipes to add in v2 schema. var config mountsConfig for _, mount := range coi.Spec.Mounts { - if uvm.IsPipe(mount.Source) { src, dst := uvm.GetContainerPipeMapping(coi.HostingSystem, mount) config.mpsv1 = append(config.mpsv1, schema1.MappedPipe{HostPath: src, ContainerPipeName: dst}) diff --git a/internal/hcsoci/network.go b/internal/hcsoci/network.go index daa4e46d00..27bf2669d2 100644 --- a/internal/hcsoci/network.go +++ b/internal/hcsoci/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( diff --git a/internal/hns/doc.go b/internal/hns/doc.go new file mode 100644 index 0000000000..f6d35df0e5 --- /dev/null +++ b/internal/hns/doc.go @@ -0,0 +1 @@ +package hns diff --git a/internal/hns/hnsendpoint.go b/internal/hns/hnsendpoint.go index 7cf954c7b2..83b683bd90 100644 --- a/internal/hns/hnsendpoint.go +++ b/internal/hns/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( @@ -146,7 +148,6 @@ func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) { } return false, nil - } // Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods @@ -281,7 +282,6 @@ func (endpoint *HNSEndpoint) HostAttach(compartmentID uint16) error { return err } return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response) - } // HostDetach detaches a nic on the host diff --git a/internal/hns/hnsfuncs.go b/internal/hns/hnsfuncs.go index 2df4a57f56..0a8f36d832 100644 --- a/internal/hns/hnsfuncs.go +++ b/internal/hns/hnsfuncs.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/hnsglobals.go b/internal/hns/hnsglobals.go index a8d8cc56ae..464bb8954f 100644 --- a/internal/hns/hnsglobals.go +++ b/internal/hns/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hns type HNSGlobals struct { diff --git a/internal/hns/hnsnetwork.go b/internal/hns/hnsnetwork.go index f12d3ab041..8861faee7a 100644 --- a/internal/hns/hnsnetwork.go +++ b/internal/hns/hnsnetwork.go @@ -1,13 +1,16 @@ +//go:build windows + package hns import ( "encoding/json" "errors" - "github.com/sirupsen/logrus" "net" + + "github.com/sirupsen/logrus" ) -// Subnet is assoicated with a network and represents a list +// Subnet is associated with a network and represents a list // of subnets available to the network type Subnet struct { AddressPrefix string `json:",omitempty"` @@ -15,7 +18,7 @@ type Subnet struct { Policies []json.RawMessage `json:",omitempty"` } -// MacPool is assoicated with a network and represents a list +// MacPool is associated with a network and represents a list // of macaddresses available to the network type MacPool struct { StartMacAddress string `json:",omitempty"` diff --git a/internal/hns/hnspolicylist.go b/internal/hns/hnspolicylist.go index 31322a6816..b98db40e8d 100644 --- a/internal/hns/hnspolicylist.go +++ b/internal/hns/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/hnssupport.go b/internal/hns/hnssupport.go index d5efba7f28..b9c30b9019 100644 --- a/internal/hns/hnssupport.go +++ b/internal/hns/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/namespace.go b/internal/hns/namespace.go index d3b04eefe0..749588ad39 100644 --- a/internal/hns/namespace.go +++ b/internal/hns/namespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/interop/doc.go b/internal/interop/doc.go new file mode 100644 index 0000000000..cb554867fe --- /dev/null +++ b/internal/interop/doc.go @@ -0,0 +1 @@ +package interop diff --git a/internal/interop/interop.go b/internal/interop/interop.go index 922f7c679e..137dc3990a 100644 --- a/internal/interop/interop.go +++ b/internal/interop/interop.go @@ -1,3 +1,5 @@ +//go:build windows + package interop import ( diff --git a/internal/jobcontainers/cpurate_test.go b/internal/jobcontainers/cpurate_test.go index 486b42f783..1dc7eba912 100644 --- a/internal/jobcontainers/cpurate_test.go +++ b/internal/jobcontainers/cpurate_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/doc.go b/internal/jobcontainers/doc.go new file mode 100644 index 0000000000..0ad9f81133 --- /dev/null +++ b/internal/jobcontainers/doc.go @@ -0,0 +1 @@ +package jobcontainers diff --git a/internal/jobcontainers/env.go b/internal/jobcontainers/env.go index b64a365471..25f1bab64d 100644 --- a/internal/jobcontainers/env.go +++ b/internal/jobcontainers/env.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/jobcontainer.go b/internal/jobcontainers/jobcontainer.go index b9cb630fab..f0433102a4 100644 --- a/internal/jobcontainers/jobcontainer.go +++ b/internal/jobcontainers/jobcontainer.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( @@ -164,7 +166,7 @@ func (c *JobContainer) CreateProcess(ctx context.Context, config interface{}) (_ return nil, errors.New("unsupported process config passed in") } - // Replace any occurences of the sandbox mount point env variable in the commandline. + // Replace any occurrences of the sandbox mount point env variable in the commandline. // %CONTAINER_SANDBOX_MOUNTPOINT%\mybinary.exe -> C:\C\123456789\mybinary.exe commandLine, _ := c.replaceWithMountPoint(conf.CommandLine) diff --git a/internal/jobcontainers/logon.go b/internal/jobcontainers/logon.go index 0ccfebd4da..45fafee715 100644 --- a/internal/jobcontainers/logon.go +++ b/internal/jobcontainers/logon.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/mounts.go b/internal/jobcontainers/mounts.go index 187c340de2..b962032609 100644 --- a/internal/jobcontainers/mounts.go +++ b/internal/jobcontainers/mounts.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/mounts_test.go b/internal/jobcontainers/mounts_test.go index 22d61dfcd4..856be66fce 100644 --- a/internal/jobcontainers/mounts_test.go +++ b/internal/jobcontainers/mounts_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/oci.go b/internal/jobcontainers/oci.go index da01236ae9..ef8a17a1f8 100644 --- a/internal/jobcontainers/oci.go +++ b/internal/jobcontainers/oci.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/path.go b/internal/jobcontainers/path.go index 94895ee249..62e32b4a89 100644 --- a/internal/jobcontainers/path.go +++ b/internal/jobcontainers/path.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( @@ -160,7 +162,7 @@ func getApplicationName(commandLine, workingDirectory, pathEnv string) (string, // searchPathForExe calls the Windows API function `SearchPathW` to try and locate // `fileName` by searching in `pathsToSearch`. `pathsToSearch` is generally a semicolon -// seperated string of paths to search that `SearchPathW` will iterate through one by one. +// separated string of paths to search that `SearchPathW` will iterate through one by one. // If the path resolved for `fileName` ends up being a directory, this function will return an // error. func searchPathForExe(fileName, pathsToSearch string) (string, error) { diff --git a/internal/jobcontainers/path_test.go b/internal/jobcontainers/path_test.go index c9ef5cda66..98b02df000 100644 --- a/internal/jobcontainers/path_test.go +++ b/internal/jobcontainers/path_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/process.go b/internal/jobcontainers/process.go index f6df14f498..3e53657338 100644 --- a/internal/jobcontainers/process.go +++ b/internal/jobcontainers/process.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/storage.go b/internal/jobcontainers/storage.go index c9fe72228a..2de67feef3 100644 --- a/internal/jobcontainers/storage.go +++ b/internal/jobcontainers/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/system_test.go b/internal/jobcontainers/system_test.go index 0b4a882e28..472ba53aad 100644 --- a/internal/jobcontainers/system_test.go +++ b/internal/jobcontainers/system_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobobject/doc.go b/internal/jobobject/doc.go new file mode 100644 index 0000000000..34b53d6e48 --- /dev/null +++ b/internal/jobobject/doc.go @@ -0,0 +1,8 @@ +// This package provides higher level constructs for the win32 job object API. +// Most of the core creation and management functions are already present in "golang.org/x/sys/windows" +// (CreateJobObject, AssignProcessToJobObject, etc.) as well as most of the limit information +// structs and associated limit flags. Whatever is not present from the job object API +// in golang.org/x/sys/windows is located in /internal/winapi. +// +// https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects +package jobobject diff --git a/internal/jobobject/iocp.go b/internal/jobobject/iocp.go index 3d640ac7bd..d31a6a1e66 100644 --- a/internal/jobobject/iocp.go +++ b/internal/jobobject/iocp.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/jobobject/jobobject.go b/internal/jobobject/jobobject.go index b8d586b204..882b2fca07 100644 --- a/internal/jobobject/jobobject.go +++ b/internal/jobobject/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( @@ -12,14 +14,6 @@ import ( "golang.org/x/sys/windows" ) -// This file provides higher level constructs for the win32 job object API. -// Most of the core creation and management functions are already present in "golang.org/x/sys/windows" -// (CreateJobObject, AssignProcessToJobObject, etc.) as well as most of the limit information -// structs and associated limit flags. Whatever is not present from the job object API -// in golang.org/x/sys/windows is located in /internal/winapi. -// -// https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects - // JobObject is a high level wrapper around a Windows job object. Holds a handle to // the job, a queue to receive iocp notifications about the lifecycle // of the job and a mutex for synchronized handle access. diff --git a/internal/jobobject/jobobject_test.go b/internal/jobobject/jobobject_test.go index c1baa033c7..6a2eed3eb4 100644 --- a/internal/jobobject/jobobject_test.go +++ b/internal/jobobject/jobobject_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/jobobject/limits.go b/internal/jobobject/limits.go index 5d4c90d241..fd69d9e341 100644 --- a/internal/jobobject/limits.go +++ b/internal/jobobject/limits.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/layers/doc.go b/internal/layers/doc.go new file mode 100644 index 0000000000..747ac49a97 --- /dev/null +++ b/internal/layers/doc.go @@ -0,0 +1,2 @@ +// Package layers deals with container layer mounting/unmounting for LCOW and WCOW +package layers diff --git a/internal/layers/layers.go b/internal/layers/layers.go index 0334076365..e0fa566b63 100644 --- a/internal/layers/layers.go +++ b/internal/layers/layers.go @@ -1,7 +1,6 @@ //go:build windows // +build windows -// Package layers deals with container layer mounting/unmounting for LCOW and WCOW package layers import ( diff --git a/internal/lcow/common.go b/internal/lcow/common.go index 32938641e8..fa78a8ecb6 100644 --- a/internal/lcow/common.go +++ b/internal/lcow/common.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/lcow/disk.go b/internal/lcow/disk.go index c7af7cf6ce..937b8deafa 100644 --- a/internal/lcow/disk.go +++ b/internal/lcow/disk.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/lcow/doc.go b/internal/lcow/doc.go new file mode 100644 index 0000000000..6105d5b57d --- /dev/null +++ b/internal/lcow/doc.go @@ -0,0 +1 @@ +package lcow diff --git a/internal/lcow/scratch.go b/internal/lcow/scratch.go index ae385a1c1b..001f3347cd 100644 --- a/internal/lcow/scratch.go +++ b/internal/lcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/oci/sandbox.go b/internal/oci/sandbox.go index 569b035654..3b9064d671 100644 --- a/internal/oci/sandbox.go +++ b/internal/oci/sandbox.go @@ -2,6 +2,7 @@ package oci import ( "fmt" + "github.com/Microsoft/hcsshim/pkg/annotations" ) diff --git a/internal/oci/uvm.go b/internal/oci/uvm.go index b0876465f0..4a624639f8 100644 --- a/internal/oci/uvm.go +++ b/internal/oci/uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -285,7 +287,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, lopts) // SecurityPolicy is very sensitive to other settings and will silently change those that are incompatible. - // Eg VMPem device count, overriden kernel option cannot be respected. + // Eg VMPem device count, overridden kernel option cannot be respected. handleSecurityPolicy(ctx, s.Annotations, lopts) // override the default GuestState filename if specified diff --git a/internal/oci/uvm_test.go b/internal/oci/uvm_test.go index c3425f8751..70bb54d669 100644 --- a/internal/oci/uvm_test.go +++ b/internal/oci/uvm_test.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -45,7 +47,6 @@ func Test_SpecUpdate_MemorySize_NoAnnotation_WithOpts(t *testing.T) { } func Test_SpecUpdate_ProcessorCount_WithAnnotation_WithOpts(t *testing.T) { - opts := &runhcsopts.Options{ VmProcessorCount: 4, } @@ -63,7 +64,6 @@ func Test_SpecUpdate_ProcessorCount_WithAnnotation_WithOpts(t *testing.T) { } func Test_SpecUpdate_ProcessorCount_NoAnnotation_WithOpts(t *testing.T) { - opts := &runhcsopts.Options{ VmProcessorCount: 4, } @@ -186,5 +186,4 @@ func Test_SpecToUVMCreateOptions_Common(t *testing.T) { } }) } - } diff --git a/internal/processorinfo/doc.go b/internal/processorinfo/doc.go new file mode 100644 index 0000000000..dd2a53b5c6 --- /dev/null +++ b/internal/processorinfo/doc.go @@ -0,0 +1 @@ +package processorinfo diff --git a/internal/processorinfo/host_information.go b/internal/processorinfo/host_information.go index f179857a63..0aa766a43e 100644 --- a/internal/processorinfo/host_information.go +++ b/internal/processorinfo/host_information.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/internal/processorinfo/processor_count.go b/internal/processorinfo/processor_count.go index 3f6301ed68..848df8248e 100644 --- a/internal/processorinfo/processor_count.go +++ b/internal/processorinfo/processor_count.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/internal/regstate/doc.go b/internal/regstate/doc.go new file mode 100644 index 0000000000..51bcdf6e98 --- /dev/null +++ b/internal/regstate/doc.go @@ -0,0 +1 @@ +package regstate diff --git a/internal/regstate/regstate.go b/internal/regstate/regstate.go index dcbc9334d7..184975add8 100644 --- a/internal/regstate/regstate.go +++ b/internal/regstate/regstate.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/internal/regstate/regstate_test.go b/internal/regstate/regstate_test.go index 7a449e27c4..9cafe08646 100644 --- a/internal/regstate/regstate_test.go +++ b/internal/regstate/regstate_test.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/internal/resources/doc.go b/internal/resources/doc.go new file mode 100644 index 0000000000..878cd99d0c --- /dev/null +++ b/internal/resources/doc.go @@ -0,0 +1,3 @@ +// Package resources handles creating, updating, and releasing resources +// on a container +package resources diff --git a/internal/resources/resources.go b/internal/resources/resources.go index 89851ae7c3..90fe116ae5 100644 --- a/internal/resources/resources.go +++ b/internal/resources/resources.go @@ -1,5 +1,5 @@ -// Package resources handles creating, updating, and releasing resources -// on a container +//go:build windows + package resources import ( diff --git a/internal/runhcs/container.go b/internal/runhcs/container.go index a161c204e2..33c43e6c59 100644 --- a/internal/runhcs/container.go +++ b/internal/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/internal/runhcs/vm.go b/internal/runhcs/vm.go index 2c8957b88d..b3e443d600 100644 --- a/internal/runhcs/vm.go +++ b/internal/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/internal/safefile/do.go b/internal/safefile/do.go new file mode 100644 index 0000000000..f211d25e72 --- /dev/null +++ b/internal/safefile/do.go @@ -0,0 +1 @@ +package safefile diff --git a/internal/safefile/safeopen.go b/internal/safefile/safeopen.go index 66b8d7e035..8770bf5627 100644 --- a/internal/safefile/safeopen.go +++ b/internal/safefile/safeopen.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( @@ -156,7 +158,6 @@ func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os. if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 { return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: winapi.RtlNtStatusToDosError(winapi.STATUS_REPARSE_POINT_ENCOUNTERED)} } - } else { parent = newroot } diff --git a/internal/safefile/safeopen_admin_test.go b/internal/safefile/safeopen_admin_test.go index 966903677e..fba451c8f6 100644 --- a/internal/safefile/safeopen_admin_test.go +++ b/internal/safefile/safeopen_admin_test.go @@ -1,5 +1,5 @@ -//go:build admin -// +build admin +//go:build windows && admin +// +build windows,admin package safefile diff --git a/internal/safefile/safeopen_test.go b/internal/safefile/safeopen_test.go index 900cc04d35..db2957c9e8 100644 --- a/internal/safefile/safeopen_test.go +++ b/internal/safefile/safeopen_test.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( diff --git a/internal/schemaversion/doc.go b/internal/schemaversion/doc.go new file mode 100644 index 0000000000..c1432114b1 --- /dev/null +++ b/internal/schemaversion/doc.go @@ -0,0 +1 @@ +package schemaversion diff --git a/internal/shimdiag/shimdiag.go b/internal/shimdiag/shimdiag.go index 2d1242da42..6d37c7b411 100644 --- a/internal/shimdiag/shimdiag.go +++ b/internal/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package shimdiag import ( diff --git a/internal/tools/extendedtask/extendedtask.go b/internal/tools/extendedtask/extendedtask.go index 34c988d15c..464ab3fb32 100644 --- a/internal/tools/extendedtask/extendedtask.go +++ b/internal/tools/extendedtask/extendedtask.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/grantvmgroupaccess/main.go b/internal/tools/grantvmgroupaccess/main.go index c3914cb64b..5fa6644d77 100644 --- a/internal/tools/grantvmgroupaccess/main.go +++ b/internal/tools/grantvmgroupaccess/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/networkagent/defs.go b/internal/tools/networkagent/defs.go index bdad12ac89..5af5d38fc1 100644 --- a/internal/tools/networkagent/defs.go +++ b/internal/tools/networkagent/defs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/networkagent/main.go b/internal/tools/networkagent/main.go index 50099e1b98..acf5508dbd 100644 --- a/internal/tools/networkagent/main.go +++ b/internal/tools/networkagent/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -313,7 +315,6 @@ func (s *service) ConfigureContainerNetworking(ctx context.Context, req *nodenet }, nil } else if req.RequestType == nodenetsvc.RequestType_Teardown { return s.teardownConfigureContainerNetworking(ctx, req) - } return nil, fmt.Errorf("invalid request type %v", req.RequestType) } @@ -361,7 +362,6 @@ func (s *service) addHelper(ctx context.Context, req *nodenetsvc.ConfigureNetwor } s.endpointToNicID[endpointName] = nicID.String() } - } defer func() { @@ -371,7 +371,6 @@ func (s *service) addHelper(ctx context.Context, req *nodenetsvc.ConfigureNetwor }() return &nodenetsvc.ConfigureNetworkingResponse{}, nil - } func (s *service) teardownHelper(ctx context.Context, req *nodenetsvc.ConfigureNetworkingRequest, containerNamespaceID string) (*nodenetsvc.ConfigureNetworkingResponse, error) { diff --git a/internal/tools/uvmboot/lcow.go b/internal/tools/uvmboot/lcow.go index 99446b40d9..e2c39af4f8 100644 --- a/internal/tools/uvmboot/lcow.go +++ b/internal/tools/uvmboot/lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/uvmboot/main.go b/internal/tools/uvmboot/main.go index 8f0a1b6293..3d89af513d 100644 --- a/internal/tools/uvmboot/main.go +++ b/internal/tools/uvmboot/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/uvmboot/wcow.go b/internal/tools/uvmboot/wcow.go index 808be645c0..1ed1e4eaf4 100644 --- a/internal/tools/uvmboot/wcow.go +++ b/internal/tools/uvmboot/wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/zapdir/main.go b/internal/tools/zapdir/main.go index 7a46cf3da8..777d569eb3 100644 --- a/internal/tools/zapdir/main.go +++ b/internal/tools/zapdir/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/uvm/capabilities.go b/internal/uvm/capabilities.go index d76bfdbef4..50ac874bce 100644 --- a/internal/uvm/capabilities.go +++ b/internal/uvm/capabilities.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import "github.com/Microsoft/hcsshim/internal/hcs/schema1" diff --git a/internal/uvm/clone.go b/internal/uvm/clone.go index 4e2f95a148..010bac3145 100644 --- a/internal/uvm/clone.go +++ b/internal/uvm/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/combine_layers.go b/internal/uvm/combine_layers.go index fe06563488..468139c0f7 100644 --- a/internal/uvm/combine_layers.go +++ b/internal/uvm/combine_layers.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/computeagent.go b/internal/uvm/computeagent.go index b87edf2796..44b328ad37 100644 --- a/internal/uvm/computeagent.go +++ b/internal/uvm/computeagent.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/computeagent_test.go b/internal/uvm/computeagent_test.go index 8a404cb3ad..46c37c63aa 100644 --- a/internal/uvm/computeagent_test.go +++ b/internal/uvm/computeagent_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/counter.go b/internal/uvm/counter.go index fc08daae2f..fd49be9bfc 100644 --- a/internal/uvm/counter.go +++ b/internal/uvm/counter.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/cpugroups.go b/internal/uvm/cpugroups.go index f4c17fae2c..f93a83ca6e 100644 --- a/internal/uvm/cpugroups.go +++ b/internal/uvm/cpugroups.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/cpulimits_update.go b/internal/uvm/cpulimits_update.go index 264da31a28..ea5fccf625 100644 --- a/internal/uvm/cpulimits_update.go +++ b/internal/uvm/cpulimits_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/create.go b/internal/uvm/create.go index a3d9fcd4e6..1f5d212276 100644 --- a/internal/uvm/create.go +++ b/internal/uvm/create.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -74,7 +76,7 @@ type Options struct { // far as the container is concerned and it is only able to view the NICs in the compartment it's assigned to. // This is the compartment setup (and behavior) that is followed for V1 HCS schema containers (docker) so // this change brings parity as well. This behavior is gated behind a registry key currently to avoid any - // unneccessary behavior and once this restriction is removed then we can remove the need for this variable + // unnecessary behavior and once this restriction is removed then we can remove the need for this variable // and the associated annotation as well. DisableCompartmentNamespace bool diff --git a/internal/uvm/create_lcow.go b/internal/uvm/create_lcow.go index 8df0e743e0..5aafd7f7d5 100644 --- a/internal/uvm/create_lcow.go +++ b/internal/uvm/create_lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -27,7 +29,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -// General infomation about how this works at a high level. +// General information about how this works at a high level. // // The purpose is to start an LCOW Utility VM or UVM using the Host Compute Service, an API to create and manipulate running virtual machines // HCS takes json descriptions of the work to be done. @@ -181,7 +183,7 @@ func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hc return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -279,7 +281,6 @@ Example JSON document produced once the hcsschema.ComputeSytem returned by makeL // Make a hcsschema.ComputeSytem with the parts that target booting from a VMGS file func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - // Kernel and initrd are combined into a single vmgs file. vmgsFullPath := filepath.Join(opts.BootFilesPath, opts.GuestStateFile) if _, err := os.Stat(vmgsFullPath); os.IsNotExist(err) { @@ -372,7 +373,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ ApplySecureBootTemplate: "Apply", - SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivilent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, + SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, } @@ -392,7 +393,6 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Many details are quite different (see the typical JSON examples), in particular it boots from a VMGS file // which contains both the kernel and initrd as well as kernel boot options. func makeLCOWSecurityDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - doc, vmgsErr := makeLCOWVMGSDoc(ctx, opts, uvm) if vmgsErr != nil { return nil, vmgsErr @@ -488,7 +488,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs } var processor *hcsschema.Processor2 - processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existance tests above. + processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existence tests above. if err != nil { return nil, err } diff --git a/internal/uvm/create_test.go b/internal/uvm/create_test.go index 0a6e82f322..98623f19b5 100644 --- a/internal/uvm/create_test.go +++ b/internal/uvm/create_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/create_wcow.go b/internal/uvm/create_wcow.go index 1d083ffda2..cd12bfd02a 100644 --- a/internal/uvm/create_wcow.go +++ b/internal/uvm/create_wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -86,7 +88,7 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -277,10 +279,10 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error } // TODO: BUGBUG Remove this. @jhowardmsft - // It should be the responsiblity of the caller to do the creation and population. + // It should be the responsibility of the caller to do the creation and population. // - Update runhcs too (vm.go). // - Remove comment in function header - // - Update tests that rely on this current behaviour. + // - Update tests that rely on this current behavior. // Create the RW scratch in the top-most layer folder, creating the folder if it doesn't already exist. scratchFolder := opts.LayerFolders[len(opts.LayerFolders)-1] diff --git a/internal/uvm/delete_container.go b/internal/uvm/delete_container.go index 5ef5c73cbd..46bef7b163 100644 --- a/internal/uvm/delete_container.go +++ b/internal/uvm/delete_container.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/doc.go b/internal/uvm/doc.go new file mode 100644 index 0000000000..c4e25cc15c --- /dev/null +++ b/internal/uvm/doc.go @@ -0,0 +1,2 @@ +// This package describes the external interface for utility VMs. +package uvm diff --git a/internal/uvm/dumpstacks.go b/internal/uvm/dumpstacks.go index d4ad56d7ec..ed39fd282d 100644 --- a/internal/uvm/dumpstacks.go +++ b/internal/uvm/dumpstacks.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/guest_request.go b/internal/uvm/guest_request.go index 5459859453..f097c4f33c 100644 --- a/internal/uvm/guest_request.go +++ b/internal/uvm/guest_request.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/hvsocket.go b/internal/uvm/hvsocket.go index 03c1855796..4e439c7894 100644 --- a/internal/uvm/hvsocket.go +++ b/internal/uvm/hvsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/memory_update.go b/internal/uvm/memory_update.go index 058ffff013..7a06f283dd 100644 --- a/internal/uvm/memory_update.go +++ b/internal/uvm/memory_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/modify.go b/internal/uvm/modify.go index 009806e683..5a57dce9a6 100644 --- a/internal/uvm/modify.go +++ b/internal/uvm/modify.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/network.go b/internal/uvm/network.go index dca3ad5ab9..03509ad882 100644 --- a/internal/uvm/network.go +++ b/internal/uvm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -41,7 +43,7 @@ var ( // In this function we take the namespace ID of the namespace that was created for this // UVM. We hot add the namespace (with the default ID if this is a template). We get the // endpoints associated with this namespace and then hot add those endpoints (by changing -// their namespace IDs by the deafult IDs if it is a template). +// their namespace IDs by the default IDs if it is a template). func (uvm *UtilityVM) SetupNetworkNamespace(ctx context.Context, nsid string) error { nsidInsideUVM := nsid if uvm.IsTemplate || uvm.IsClone { diff --git a/internal/uvm/pipes.go b/internal/uvm/pipes.go index c4fcd34e82..cc67f9a798 100644 --- a/internal/uvm/pipes.go +++ b/internal/uvm/pipes.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/plan9.go b/internal/uvm/plan9.go index 475a9dbc1d..d8fce975f8 100644 --- a/internal/uvm/plan9.go +++ b/internal/uvm/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/scsi.go b/internal/uvm/scsi.go index 5cac727387..072dbab116 100644 --- a/internal/uvm/scsi.go +++ b/internal/uvm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -521,7 +523,6 @@ func (uvm *UtilityVM) allocateSCSIMount( log.G(ctx).WithFields(uvm.scsiLocations[controller][lun].logFormat()).Debug("allocated SCSI mount") return uvm.scsiLocations[controller][lun], false, nil - } // GetScsiUvmPath returns the guest mounted path of a SCSI drive. diff --git a/internal/uvm/security_policy.go b/internal/uvm/security_policy.go index 89278acb6b..6570928ea7 100644 --- a/internal/uvm/security_policy.go +++ b/internal/uvm/security_policy.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/share.go b/internal/uvm/share.go index db05448c68..41ecda3a3a 100644 --- a/internal/uvm/share.go +++ b/internal/uvm/share.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/start.go b/internal/uvm/start.go index 702815ed6a..412717aca6 100644 --- a/internal/uvm/start.go +++ b/internal/uvm/start.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/stats.go b/internal/uvm/stats.go index d6a27b67a3..2cd5c24ce0 100644 --- a/internal/uvm/stats.go +++ b/internal/uvm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/timezone.go b/internal/uvm/timezone.go index 18c191cf4a..3ce7b9764f 100644 --- a/internal/uvm/timezone.go +++ b/internal/uvm/timezone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/types.go b/internal/uvm/types.go index b87fe45f7f..020eb7099b 100644 --- a/internal/uvm/types.go +++ b/internal/uvm/types.go @@ -1,6 +1,6 @@ -package uvm +//go:build windows -// This package describes the external interface for utility VMs. +package uvm import ( "net" diff --git a/internal/uvm/update_uvm.go b/internal/uvm/update_uvm.go index 1e1e07f274..b8fcddac6e 100644 --- a/internal/uvm/update_uvm.go +++ b/internal/uvm/update_uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/virtual_device.go b/internal/uvm/virtual_device.go index 0a729ecde5..3bd6e187a9 100644 --- a/internal/uvm/virtual_device.go +++ b/internal/uvm/virtual_device.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem.go b/internal/uvm/vpmem.go index b41ed27aa6..cde51aa014 100644 --- a/internal/uvm/vpmem.go +++ b/internal/uvm/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem_mapped.go b/internal/uvm/vpmem_mapped.go index b98948ecfd..510e9ed4c4 100644 --- a/internal/uvm/vpmem_mapped.go +++ b/internal/uvm/vpmem_mapped.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem_mapped_test.go b/internal/uvm/vpmem_mapped_test.go index b3d1a119d0..5ef9f1d257 100644 --- a/internal/uvm/vpmem_mapped_test.go +++ b/internal/uvm/vpmem_mapped_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vsmb.go b/internal/uvm/vsmb.go index b2ccf5be4f..348058c7ef 100644 --- a/internal/uvm/vsmb.go +++ b/internal/uvm/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/wait.go b/internal/uvm/wait.go index 552ee5fad7..d052be533a 100644 --- a/internal/uvm/wait.go +++ b/internal/uvm/wait.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvmfolder/doc.go b/internal/uvmfolder/doc.go new file mode 100644 index 0000000000..9e2b205da0 --- /dev/null +++ b/internal/uvmfolder/doc.go @@ -0,0 +1 @@ +package uvmfolder diff --git a/internal/vm/hcs/boot.go b/internal/vm/hcs/boot.go index 425feebd2c..a1794a4f2c 100644 --- a/internal/vm/hcs/boot.go +++ b/internal/vm/hcs/boot.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/builder.go b/internal/vm/hcs/builder.go index 676e114bf6..960f50e40c 100644 --- a/internal/vm/hcs/builder.go +++ b/internal/vm/hcs/builder.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/doc.go b/internal/vm/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/internal/vm/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/internal/vm/hcs/hcs.go b/internal/vm/hcs/hcs.go index 1c7f337304..ebf56a7cb6 100644 --- a/internal/vm/hcs/hcs.go +++ b/internal/vm/hcs/hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/memory.go b/internal/vm/hcs/memory.go index afb9932628..5934d470fc 100644 --- a/internal/vm/hcs/memory.go +++ b/internal/vm/hcs/memory.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/network.go b/internal/vm/hcs/network.go index 71a30c1dc5..f61f6bb4ed 100644 --- a/internal/vm/hcs/network.go +++ b/internal/vm/hcs/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/pci.go b/internal/vm/hcs/pci.go index 9936f3b45a..35e97e1de8 100644 --- a/internal/vm/hcs/pci.go +++ b/internal/vm/hcs/pci.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/plan9.go b/internal/vm/hcs/plan9.go index 3de9ed90ee..23cd7cc030 100644 --- a/internal/vm/hcs/plan9.go +++ b/internal/vm/hcs/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/processor.go b/internal/vm/hcs/processor.go index fcbe12954e..27bfbc61d3 100644 --- a/internal/vm/hcs/processor.go +++ b/internal/vm/hcs/processor.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs func (uvmb *utilityVMBuilder) SetProcessorCount(count uint32) error { diff --git a/internal/vm/hcs/scsi.go b/internal/vm/hcs/scsi.go index ca238df974..ad2582d16e 100644 --- a/internal/vm/hcs/scsi.go +++ b/internal/vm/hcs/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/serial.go b/internal/vm/hcs/serial.go index 974493344a..ef6541c5c1 100644 --- a/internal/vm/hcs/serial.go +++ b/internal/vm/hcs/serial.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/stats.go b/internal/vm/hcs/stats.go index bb4cbfc59c..8cd3edbc3e 100644 --- a/internal/vm/hcs/stats.go +++ b/internal/vm/hcs/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/storage.go b/internal/vm/hcs/storage.go index 9b2317a036..edc7d4dd6e 100644 --- a/internal/vm/hcs/storage.go +++ b/internal/vm/hcs/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs func (uvmb *utilityVMBuilder) SetStorageQos(iopsMaximum int64, bandwidthMaximum int64) error { diff --git a/internal/vm/hcs/supported.go b/internal/vm/hcs/supported.go index e179c252c3..0fb4453a80 100644 --- a/internal/vm/hcs/supported.go +++ b/internal/vm/hcs/supported.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import "github.com/Microsoft/hcsshim/internal/vm" diff --git a/internal/vm/hcs/vmsocket.go b/internal/vm/hcs/vmsocket.go index 22e268858a..49c50b88b8 100644 --- a/internal/vm/hcs/vmsocket.go +++ b/internal/vm/hcs/vmsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/vpmem.go b/internal/vm/hcs/vpmem.go index fb3a2dbc1a..915a10e7f7 100644 --- a/internal/vm/hcs/vpmem.go +++ b/internal/vm/hcs/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/vsmb.go b/internal/vm/hcs/vsmb.go index c48596fc2a..3cb1696c50 100644 --- a/internal/vm/hcs/vsmb.go +++ b/internal/vm/hcs/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/windows.go b/internal/vm/hcs/windows.go index e4775b0528..40ab8629c6 100644 --- a/internal/vm/hcs/windows.go +++ b/internal/vm/hcs/windows.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/remotevm/boot.go b/internal/vm/remotevm/boot.go index 9f170033b1..91e42ae748 100644 --- a/internal/vm/remotevm/boot.go +++ b/internal/vm/remotevm/boot.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/builder.go b/internal/vm/remotevm/builder.go index b289428044..5887bf4e7f 100644 --- a/internal/vm/remotevm/builder.go +++ b/internal/vm/remotevm/builder.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/doc.go b/internal/vm/remotevm/doc.go new file mode 100644 index 0000000000..651278471e --- /dev/null +++ b/internal/vm/remotevm/doc.go @@ -0,0 +1 @@ +package remotevm diff --git a/internal/vm/remotevm/memory.go b/internal/vm/remotevm/memory.go index f0933cfc4e..9f7b3ce8cb 100644 --- a/internal/vm/remotevm/memory.go +++ b/internal/vm/remotevm/memory.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/network.go b/internal/vm/remotevm/network.go index 25a634cb8a..d44f41c6a4 100644 --- a/internal/vm/remotevm/network.go +++ b/internal/vm/remotevm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/processor.go b/internal/vm/remotevm/processor.go index 9e1ca2264a..da8aa276ff 100644 --- a/internal/vm/remotevm/processor.go +++ b/internal/vm/remotevm/processor.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/remotevm.go b/internal/vm/remotevm/remotevm.go index 733e33b49d..d48ebd64b3 100644 --- a/internal/vm/remotevm/remotevm.go +++ b/internal/vm/remotevm/remotevm.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/scsi.go b/internal/vm/remotevm/scsi.go index ba30dde4af..fc7863669e 100644 --- a/internal/vm/remotevm/scsi.go +++ b/internal/vm/remotevm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/serial.go b/internal/vm/remotevm/serial.go index 599f7b5242..8a60db0e24 100644 --- a/internal/vm/remotevm/serial.go +++ b/internal/vm/remotevm/serial.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/stats.go b/internal/vm/remotevm/stats.go index ca2a780280..bef8363f8a 100644 --- a/internal/vm/remotevm/stats.go +++ b/internal/vm/remotevm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/storage.go b/internal/vm/remotevm/storage.go index f2f7783316..13a8358193 100644 --- a/internal/vm/remotevm/storage.go +++ b/internal/vm/remotevm/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/vmsocket.go b/internal/vm/remotevm/vmsocket.go index 048c9e48bd..d0a6c60468 100644 --- a/internal/vm/remotevm/vmsocket.go +++ b/internal/vm/remotevm/vmsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/windows.go b/internal/vm/remotevm/windows.go index 17aefa5422..9e1ef7fb18 100644 --- a/internal/vm/remotevm/windows.go +++ b/internal/vm/remotevm/windows.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vmcompute/doc.go b/internal/vmcompute/doc.go new file mode 100644 index 0000000000..9dd00c8128 --- /dev/null +++ b/internal/vmcompute/doc.go @@ -0,0 +1 @@ +package vmcompute diff --git a/internal/vmcompute/vmcompute.go b/internal/vmcompute/vmcompute.go index 8ca01f8247..ef2e3708b8 100644 --- a/internal/vmcompute/vmcompute.go +++ b/internal/vmcompute/vmcompute.go @@ -1,3 +1,5 @@ +//go:build windows + package vmcompute import ( diff --git a/internal/wclayer/activatelayer.go b/internal/wclayer/activatelayer.go index 5debe974d4..98a79ef4c5 100644 --- a/internal/wclayer/activatelayer.go +++ b/internal/wclayer/activatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/baselayer.go b/internal/wclayer/baselayer.go index 3ec708d1ed..aea8b421ef 100644 --- a/internal/wclayer/baselayer.go +++ b/internal/wclayer/baselayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -48,7 +50,6 @@ func reapplyDirectoryTimes(root *os.File, dis []dirInfo) error { if err != nil { return err } - } return nil } diff --git a/internal/wclayer/createlayer.go b/internal/wclayer/createlayer.go index 480aee8725..4e81298514 100644 --- a/internal/wclayer/createlayer.go +++ b/internal/wclayer/createlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/createscratchlayer.go b/internal/wclayer/createscratchlayer.go index 131aa94f14..5750d53e91 100644 --- a/internal/wclayer/createscratchlayer.go +++ b/internal/wclayer/createscratchlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/deactivatelayer.go b/internal/wclayer/deactivatelayer.go index d5bf2f5bdc..724af6223d 100644 --- a/internal/wclayer/deactivatelayer.go +++ b/internal/wclayer/deactivatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/destroylayer.go b/internal/wclayer/destroylayer.go index 424467ac33..20c5afea7f 100644 --- a/internal/wclayer/destroylayer.go +++ b/internal/wclayer/destroylayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/doc.go b/internal/wclayer/doc.go new file mode 100644 index 0000000000..dd1d555804 --- /dev/null +++ b/internal/wclayer/doc.go @@ -0,0 +1,4 @@ +// Package wclayer provides bindings to HCS's legacy layer management API and +// provides a higher level interface around these calls for container layer +// management. +package wclayer diff --git a/internal/wclayer/expandscratchsize.go b/internal/wclayer/expandscratchsize.go index 035c9041e6..38071322b7 100644 --- a/internal/wclayer/expandscratchsize.go +++ b/internal/wclayer/expandscratchsize.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/exportlayer.go b/internal/wclayer/exportlayer.go index 97b27eb7d6..3c388ef4bc 100644 --- a/internal/wclayer/exportlayer.go +++ b/internal/wclayer/exportlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/getlayermountpath.go b/internal/wclayer/getlayermountpath.go index 8d213f5871..761b5bbd1d 100644 --- a/internal/wclayer/getlayermountpath.go +++ b/internal/wclayer/getlayermountpath.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/getsharedbaseimages.go b/internal/wclayer/getsharedbaseimages.go index ae1fff8403..1da329c7a4 100644 --- a/internal/wclayer/getsharedbaseimages.go +++ b/internal/wclayer/getsharedbaseimages.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/grantvmaccess.go b/internal/wclayer/grantvmaccess.go index 4b282fef9d..b0da3e71df 100644 --- a/internal/wclayer/grantvmaccess.go +++ b/internal/wclayer/grantvmaccess.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/importlayer.go b/internal/wclayer/importlayer.go index 687550f0be..cd4e470837 100644 --- a/internal/wclayer/importlayer.go +++ b/internal/wclayer/importlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerexists.go b/internal/wclayer/layerexists.go index 01e6723393..5ee3379cfb 100644 --- a/internal/wclayer/layerexists.go +++ b/internal/wclayer/layerexists.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerid.go b/internal/wclayer/layerid.go index 0ce34a30f8..ea459d2d42 100644 --- a/internal/wclayer/layerid.go +++ b/internal/wclayer/layerid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerutils.go b/internal/wclayer/layerutils.go index 1ec893c6af..86f0549ef6 100644 --- a/internal/wclayer/layerutils.go +++ b/internal/wclayer/layerutils.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer // This file contains utility functions to support storage (graph) related diff --git a/internal/wclayer/legacy.go b/internal/wclayer/legacy.go index b7f3064f26..f012d51104 100644 --- a/internal/wclayer/legacy.go +++ b/internal/wclayer/legacy.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -262,7 +264,6 @@ func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.Fil // The creation time and access time get reset for files outside of the Files path. fileInfo.CreationTime = fileInfo.LastWriteTime fileInfo.LastAccessTime = fileInfo.LastWriteTime - } else { // The file attributes are written before the backup stream. var attr uint32 diff --git a/internal/wclayer/nametoguid.go b/internal/wclayer/nametoguid.go index 09950297ce..30938e3d66 100644 --- a/internal/wclayer/nametoguid.go +++ b/internal/wclayer/nametoguid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/preparelayer.go b/internal/wclayer/preparelayer.go index 90129faefb..2f128ab153 100644 --- a/internal/wclayer/preparelayer.go +++ b/internal/wclayer/preparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/processimage.go b/internal/wclayer/processimage.go index 30bcdff5f5..aaf55d887b 100644 --- a/internal/wclayer/processimage.go +++ b/internal/wclayer/processimage.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/unpreparelayer.go b/internal/wclayer/unpreparelayer.go index 71b130c525..c53a06ea2c 100644 --- a/internal/wclayer/unpreparelayer.go +++ b/internal/wclayer/unpreparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/wclayer.go b/internal/wclayer/wclayer.go index 9b1e06d50c..8aeab8d24e 100644 --- a/internal/wclayer/wclayer.go +++ b/internal/wclayer/wclayer.go @@ -1,6 +1,5 @@ -// Package wclayer provides bindings to HCS's legacy layer management API and -// provides a higher level interface around these calls for container layer -// management. +//go:build windows + package wclayer import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/internal/wcow/doc.go b/internal/wcow/doc.go new file mode 100644 index 0000000000..b02b2ddcf2 --- /dev/null +++ b/internal/wcow/doc.go @@ -0,0 +1 @@ +package wcow diff --git a/internal/wcow/scratch.go b/internal/wcow/scratch.go index 940ccbf7f6..992ac0edda 100644 --- a/internal/wcow/scratch.go +++ b/internal/wcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package wcow import ( diff --git a/internal/winapi/console.go b/internal/winapi/console.go index def9525417..4547cdd8e8 100644 --- a/internal/winapi/console.go +++ b/internal/winapi/console.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/devices.go b/internal/winapi/devices.go index df28ea2421..7875466cad 100644 --- a/internal/winapi/devices.go +++ b/internal/winapi/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/internal/winapi/doc.go b/internal/winapi/doc.go new file mode 100644 index 0000000000..9acc0bfc17 --- /dev/null +++ b/internal/winapi/doc.go @@ -0,0 +1,3 @@ +// Package winapi contains various low-level bindings to Windows APIs. It can +// be thought of as an extension to golang.org/x/sys/windows. +package winapi diff --git a/internal/winapi/errors.go b/internal/winapi/errors.go index 4e80ef68c9..49ce924cbe 100644 --- a/internal/winapi/errors.go +++ b/internal/winapi/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "syscall" diff --git a/internal/winapi/filesystem.go b/internal/winapi/filesystem.go index 7ce52afd5e..0d78c051ba 100644 --- a/internal/winapi/filesystem.go +++ b/internal/winapi/filesystem.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi //sys NtCreateFile(handle *uintptr, accessMask uint32, oa *ObjectAttributes, iosb *IOStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) = ntdll.NtCreateFile diff --git a/internal/winapi/jobobject.go b/internal/winapi/jobobject.go index b2ca47c02b..5eac5a3729 100644 --- a/internal/winapi/jobobject.go +++ b/internal/winapi/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/system.go b/internal/winapi/system.go index 9e4009d873..f5b1868e48 100644 --- a/internal/winapi/system.go +++ b/internal/winapi/system.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "golang.org/x/sys/windows" diff --git a/internal/winapi/user.go b/internal/winapi/user.go index 47aa63e34a..8abc095d60 100644 --- a/internal/winapi/user.go +++ b/internal/winapi/user.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/utils.go b/internal/winapi/utils.go index 859b753c24..7b93974846 100644 --- a/internal/winapi/utils.go +++ b/internal/winapi/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/winapi.go b/internal/winapi/winapi.go index d2cc9d9fba..9310bb7546 100644 --- a/internal/winapi/winapi.go +++ b/internal/winapi/winapi.go @@ -1,5 +1,3 @@ -// Package winapi contains various low-level bindings to Windows APIs. It can -// be thought of as an extension to golang.org/x/sys/windows. package winapi //go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/internal/winapi/winapi_test.go b/internal/winapi/winapi_test.go index 80759edf8a..de42adcd21 100644 --- a/internal/winapi/winapi_test.go +++ b/internal/winapi/winapi_test.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/windevice/devicequery.go b/internal/windevice/devicequery.go index 19eddec590..313c853abb 100644 --- a/internal/windevice/devicequery.go +++ b/internal/windevice/devicequery.go @@ -1,3 +1,5 @@ +//go:build windows + package windevice import ( diff --git a/internal/windevice/doc.go b/internal/windevice/doc.go new file mode 100644 index 0000000000..5b3c437e6e --- /dev/null +++ b/internal/windevice/doc.go @@ -0,0 +1 @@ +package windevice diff --git a/internal/winobjdir/doc.go b/internal/winobjdir/doc.go new file mode 100644 index 0000000000..3378df0134 --- /dev/null +++ b/internal/winobjdir/doc.go @@ -0,0 +1 @@ +package winobjdir diff --git a/internal/winobjdir/object_dir.go b/internal/winobjdir/object_dir.go index 83baf2551d..1b09f314a9 100644 --- a/internal/winobjdir/object_dir.go +++ b/internal/winobjdir/object_dir.go @@ -1,3 +1,5 @@ +//go:build windows + package winobjdir import ( diff --git a/layer.go b/layer.go index 8916163706..e323c8308d 100644 --- a/layer.go +++ b/layer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/osversion/osversion_windows.go b/osversion/osversion_windows.go index 3ab3bcd89a..ecb0766164 100644 --- a/osversion/osversion_windows.go +++ b/osversion/osversion_windows.go @@ -1,3 +1,5 @@ +//go:build windows + package osversion import ( diff --git a/pkg/go-runhcs/doc.go b/pkg/go-runhcs/doc.go new file mode 100644 index 0000000000..f2523af44a --- /dev/null +++ b/pkg/go-runhcs/doc.go @@ -0,0 +1 @@ +package runhcs diff --git a/pkg/go-runhcs/runhcs.go b/pkg/go-runhcs/runhcs.go index 64491a70cc..1d82f72c6f 100644 --- a/pkg/go-runhcs/runhcs.go +++ b/pkg/go-runhcs/runhcs.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -20,7 +22,7 @@ type Format string const ( none Format = "" - // Text is the default text log ouput. + // Text is the default text log output. Text Format = "text" // JSON is the JSON formatted log output. JSON Format = "json" @@ -140,7 +142,7 @@ func (r *Runhcs) runOrError(cmd *exec.Cmd) error { } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } @@ -166,7 +168,7 @@ func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) { status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return b.Bytes(), err diff --git a/pkg/go-runhcs/runhcs_create-scratch.go b/pkg/go-runhcs/runhcs_create-scratch.go index 720386c273..956e4c1f77 100644 --- a/pkg/go-runhcs/runhcs_create-scratch.go +++ b/pkg/go-runhcs/runhcs_create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_create.go b/pkg/go-runhcs/runhcs_create.go index 20d5d402ec..f908de4e29 100644 --- a/pkg/go-runhcs/runhcs_create.go +++ b/pkg/go-runhcs/runhcs_create.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -95,7 +97,7 @@ func (r *Runhcs) Create(context context.Context, id, bundle string, opts *Create } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/pkg/go-runhcs/runhcs_delete.go b/pkg/go-runhcs/runhcs_delete.go index 08b82bbd9a..307a1de5c1 100644 --- a/pkg/go-runhcs/runhcs_delete.go +++ b/pkg/go-runhcs/runhcs_delete.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_exec.go b/pkg/go-runhcs/runhcs_exec.go index 090a0a31f8..a85ee66f7a 100644 --- a/pkg/go-runhcs/runhcs_exec.go +++ b/pkg/go-runhcs/runhcs_exec.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -82,7 +84,7 @@ func (r *Runhcs) Exec(context context.Context, id, processFile string, opts *Exe } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/pkg/go-runhcs/runhcs_kill.go b/pkg/go-runhcs/runhcs_kill.go index 021e5b16fe..8480c64929 100644 --- a/pkg/go-runhcs/runhcs_kill.go +++ b/pkg/go-runhcs/runhcs_kill.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_list.go b/pkg/go-runhcs/runhcs_list.go index 3b9208017f..d7e88a2f05 100644 --- a/pkg/go-runhcs/runhcs_list.go +++ b/pkg/go-runhcs/runhcs_list.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_pause.go b/pkg/go-runhcs/runhcs_pause.go index 56392fa43e..93ec1e8770 100644 --- a/pkg/go-runhcs/runhcs_pause.go +++ b/pkg/go-runhcs/runhcs_pause.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_ps.go b/pkg/go-runhcs/runhcs_ps.go index 4dc9f144fe..b60dabe8f5 100644 --- a/pkg/go-runhcs/runhcs_ps.go +++ b/pkg/go-runhcs/runhcs_ps.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_resize-tty.go b/pkg/go-runhcs/runhcs_resize-tty.go index b9f90491d3..016b948056 100644 --- a/pkg/go-runhcs/runhcs_resize-tty.go +++ b/pkg/go-runhcs/runhcs_resize-tty.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_resume.go b/pkg/go-runhcs/runhcs_resume.go index 1fdeb87d9b..0116d0a2de 100644 --- a/pkg/go-runhcs/runhcs_resume.go +++ b/pkg/go-runhcs/runhcs_resume.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_start.go b/pkg/go-runhcs/runhcs_start.go index ad3df746a8..98de529de7 100644 --- a/pkg/go-runhcs/runhcs_start.go +++ b/pkg/go-runhcs/runhcs_start.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_state.go b/pkg/go-runhcs/runhcs_state.go index b22bb079cc..cc18801ec1 100644 --- a/pkg/go-runhcs/runhcs_state.go +++ b/pkg/go-runhcs/runhcs_state.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_test.go b/pkg/go-runhcs/runhcs_test.go index bdbae1bffb..b44b550915 100644 --- a/pkg/go-runhcs/runhcs_test.go +++ b/pkg/go-runhcs/runhcs_test.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/ociwclayer/doc.go b/pkg/ociwclayer/doc.go new file mode 100644 index 0000000000..0ec1aa05c4 --- /dev/null +++ b/pkg/ociwclayer/doc.go @@ -0,0 +1,3 @@ +// Package ociwclayer provides functions for importing and exporting Windows +// container layers from and to their OCI tar representation. +package ociwclayer diff --git a/pkg/ociwclayer/export.go b/pkg/ociwclayer/export.go index e3f1be333d..feea29080e 100644 --- a/pkg/ociwclayer/export.go +++ b/pkg/ociwclayer/export.go @@ -1,5 +1,5 @@ -// Package ociwclayer provides functions for importing and exporting Windows -// container layers from and to their OCI tar representation. +//go:build windows + package ociwclayer import ( diff --git a/pkg/ociwclayer/import.go b/pkg/ociwclayer/import.go index e74a6b5946..863329c1ba 100644 --- a/pkg/ociwclayer/import.go +++ b/pkg/ociwclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package ociwclayer import ( diff --git a/pkg/securitypolicy/securitypolicy_test.go b/pkg/securitypolicy/securitypolicy_test.go index 775c2e3744..0dbe84e9f8 100644 --- a/pkg/securitypolicy/securitypolicy_test.go +++ b/pkg/securitypolicy/securitypolicy_test.go @@ -156,7 +156,6 @@ func Test_EnforceDeviceMountPolicy_No_Matches(t *testing.T) { // return an error when there's a matching root hash in the policy func Test_EnforceDeviceMountPolicy_Matches(t *testing.T) { f := func(p *generatedContainers) bool { - policy := NewStandardSecurityPolicyEnforcer(p.containers, ignoredEncodedPolicyString) r := rand.New(rand.NewSource(time.Now().UnixNano())) @@ -959,7 +958,6 @@ func generateInvalidRootHash(r *rand.Rand) string { } func selectRootHashFromContainers(containers *generatedContainers, r *rand.Rand) string { - numberOfContainersInPolicy := len(containers.containers) container := containers.containers[r.Intn(numberOfContainersInPolicy)] numberOfLayersInContainer := len(container.Layers) diff --git a/pkg/securitypolicy/securitypolicyenforcer.go b/pkg/securitypolicy/securitypolicyenforcer.go index b435080e9e..97145d819b 100644 --- a/pkg/securitypolicy/securitypolicyenforcer.go +++ b/pkg/securitypolicy/securitypolicyenforcer.go @@ -85,7 +85,7 @@ type StandardSecurityPolicyEnforcer struct { // // Most of the work that this security policy enforcer does it around managing // state needed to map from a container definition in the SecurityPolicy to - // a specfic container ID as we bring up each container. See + // a specific container ID as we bring up each container. See // enforceCommandPolicy where most of the functionality is handling the case // were policy containers share an overlay and have to try to distinguish them // based on the command line arguments. enforceEnvironmentVariablePolicy can diff --git a/process.go b/process.go index 3362c68335..44df91cde2 100644 --- a/process.go +++ b/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/containerd-shim-runhcs-v1/delete_test.go b/test/containerd-shim-runhcs-v1/delete_test.go index 291dbbf227..b1df035deb 100644 --- a/test/containerd-shim-runhcs-v1/delete_test.go +++ b/test/containerd-shim-runhcs-v1/delete_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/containerd-shim-runhcs-v1/global_command_test.go b/test/containerd-shim-runhcs-v1/global_command_test.go index d927836bb1..c0bf688096 100644 --- a/test/containerd-shim-runhcs-v1/global_command_test.go +++ b/test/containerd-shim-runhcs-v1/global_command_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/containerd-shim-runhcs-v1/start_test.go b/test/containerd-shim-runhcs-v1/start_test.go index c478c3233e..dbc7c48974 100644 --- a/test/containerd-shim-runhcs-v1/start_test.go +++ b/test/containerd-shim-runhcs-v1/start_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/cri-containerd/clone_test.go b/test/cri-containerd/clone_test.go index f2d578f9de..1da12e4903 100644 --- a/test/cri-containerd/clone_test.go +++ b/test/cri-containerd/clone_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container.go b/test/cri-containerd/container.go index de5cad1702..8257f988b2 100644 --- a/test/cri-containerd/container.go +++ b/test/cri-containerd/container.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_downlevel_test.go b/test/cri-containerd/container_downlevel_test.go index 0197b9da2f..6bee88adf6 100644 --- a/test/cri-containerd/container_downlevel_test.go +++ b/test/cri-containerd/container_downlevel_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_fileshare_test.go b/test/cri-containerd/container_fileshare_test.go index cdd9c088ac..511a133c87 100644 --- a/test/cri-containerd/container_fileshare_test.go +++ b/test/cri-containerd/container_fileshare_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_gmsa_test.go b/test/cri-containerd/container_gmsa_test.go index ac59a38b8c..ef9fe22701 100644 --- a/test/cri-containerd/container_gmsa_test.go +++ b/test/cri-containerd/container_gmsa_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_layers_packing_test.go b/test/cri-containerd/container_layers_packing_test.go index 9b9ec85704..89a64bbb02 100644 --- a/test/cri-containerd/container_layers_packing_test.go +++ b/test/cri-containerd/container_layers_packing_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_network_test.go b/test/cri-containerd/container_network_test.go index 73129d508a..6e4888ea85 100644 --- a/test/cri-containerd/container_network_test.go +++ b/test/cri-containerd/container_network_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_test.go b/test/cri-containerd/container_test.go index 1afbc1b7ce..0f777c740a 100644 --- a/test/cri-containerd/container_test.go +++ b/test/cri-containerd/container_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_update_test.go b/test/cri-containerd/container_update_test.go index b9df5e5d28..ccfdc8bb8d 100644 --- a/test/cri-containerd/container_update_test.go +++ b/test/cri-containerd/container_update_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_virtual_device_test.go b/test/cri-containerd/container_virtual_device_test.go index ecbee741d0..591da7b7fd 100644 --- a/test/cri-containerd/container_virtual_device_test.go +++ b/test/cri-containerd/container_virtual_device_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/containerdrestart_test.go b/test/cri-containerd/containerdrestart_test.go index a234776bc7..706730fb4a 100644 --- a/test/cri-containerd/containerdrestart_test.go +++ b/test/cri-containerd/containerdrestart_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/createcontainer_test.go b/test/cri-containerd/createcontainer_test.go index 18f855342a..0efa1c62e3 100644 --- a/test/cri-containerd/createcontainer_test.go +++ b/test/cri-containerd/createcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/exec.go b/test/cri-containerd/exec.go index a3381cc44d..729541640f 100644 --- a/test/cri-containerd/exec.go +++ b/test/cri-containerd/exec.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/execcontainer_test.go b/test/cri-containerd/execcontainer_test.go index 640f4fe42f..fb7a7fa702 100644 --- a/test/cri-containerd/execcontainer_test.go +++ b/test/cri-containerd/execcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/extended_task_test.go b/test/cri-containerd/extended_task_test.go index 040ec8c835..214f718dc0 100644 --- a/test/cri-containerd/extended_task_test.go +++ b/test/cri-containerd/extended_task_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/gmsa.go b/test/cri-containerd/gmsa_test.go similarity index 94% rename from test/cri-containerd/gmsa.go rename to test/cri-containerd/gmsa_test.go index 4e73b1b84a..3fd4de016f 100644 --- a/test/cri-containerd/gmsa.go +++ b/test/cri-containerd/gmsa_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/helpers/log.go b/test/cri-containerd/helpers/log.go index fe8933afef..8c58021d3c 100644 --- a/test/cri-containerd/helpers/log.go +++ b/test/cri-containerd/helpers/log.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/test/cri-containerd/jobcontainer_test.go b/test/cri-containerd/jobcontainer_test.go index 91ba59793a..c533012192 100644 --- a/test/cri-containerd/jobcontainer_test.go +++ b/test/cri-containerd/jobcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/layer_integrity_test.go b/test/cri-containerd/layer_integrity_test.go index 2be96dda8c..b4ae92ea59 100644 --- a/test/cri-containerd/layer_integrity_test.go +++ b/test/cri-containerd/layer_integrity_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/logging_binary_test.go b/test/cri-containerd/logging_binary_test.go index 4e4949c60d..a0f31a62a1 100644 --- a/test/cri-containerd/logging_binary_test.go +++ b/test/cri-containerd/logging_binary_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/main_test.go b/test/cri-containerd/main_test.go index 4af3204e1c..5e0a5468aa 100644 --- a/test/cri-containerd/main_test.go +++ b/test/cri-containerd/main_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/pod_update_test.go b/test/cri-containerd/pod_update_test.go index e8ba337c13..bf1fc6f50f 100644 --- a/test/cri-containerd/pod_update_test.go +++ b/test/cri-containerd/pod_update_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/policy_test.go b/test/cri-containerd/policy_test.go index f46f34b555..2f8d5e8d8b 100644 --- a/test/cri-containerd/policy_test.go +++ b/test/cri-containerd/policy_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/pullimage_test.go b/test/cri-containerd/pullimage_test.go index ce536b3a3e..d8da0ade31 100644 --- a/test/cri-containerd/pullimage_test.go +++ b/test/cri-containerd/pullimage_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/removepodsandbox_test.go b/test/cri-containerd/removepodsandbox_test.go index 506d78c2ca..db192ac598 100644 --- a/test/cri-containerd/removepodsandbox_test.go +++ b/test/cri-containerd/removepodsandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/runpodsandbox_test.go b/test/cri-containerd/runpodsandbox_test.go index e7a7b6af4c..515ab9765e 100644 --- a/test/cri-containerd/runpodsandbox_test.go +++ b/test/cri-containerd/runpodsandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/sandbox.go b/test/cri-containerd/sandbox_test.go similarity index 97% rename from test/cri-containerd/sandbox.go rename to test/cri-containerd/sandbox_test.go index e2723e955e..9c1dc65c36 100644 --- a/test/cri-containerd/sandbox.go +++ b/test/cri-containerd/sandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go b/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go index d079dc6eec..609b55efcc 100644 --- a/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go +++ b/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/service_test.go b/test/cri-containerd/service_test.go index e995a9a194..4656891a67 100644 --- a/test/cri-containerd/service_test.go +++ b/test/cri-containerd/service_test.go @@ -1,3 +1,5 @@ +//go:build windows && functional + package cri_containerd import ( diff --git a/test/cri-containerd/share.go b/test/cri-containerd/share.go index d6dc7d692a..a3be151988 100644 --- a/test/cri-containerd/share.go +++ b/test/cri-containerd/share.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/stats_test.go b/test/cri-containerd/stats_test.go index a8f367ad4c..f7a4906d40 100644 --- a/test/cri-containerd/stats_test.go +++ b/test/cri-containerd/stats_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/stopcontainer_test.go b/test/cri-containerd/stopcontainer_test.go index 89e0478b8f..3a582877a6 100644 --- a/test/cri-containerd/stopcontainer_test.go +++ b/test/cri-containerd/stopcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/test-images/jobcontainer_createvhd/main.go b/test/cri-containerd/test-images/jobcontainer_createvhd/main.go index 1788dea39f..0e51cc10a4 100644 --- a/test/cri-containerd/test-images/jobcontainer_createvhd/main.go +++ b/test/cri-containerd/test-images/jobcontainer_createvhd/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/jobcontainer_etw/main.go b/test/cri-containerd/test-images/jobcontainer_etw/main.go index 4637d6160f..43f34758f5 100644 --- a/test/cri-containerd/test-images/jobcontainer_etw/main.go +++ b/test/cri-containerd/test-images/jobcontainer_etw/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/jobcontainer_hns/main.go b/test/cri-containerd/test-images/jobcontainer_hns/main.go index e2e28f8d6b..1ac550fee0 100644 --- a/test/cri-containerd/test-images/jobcontainer_hns/main.go +++ b/test/cri-containerd/test-images/jobcontainer_hns/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/timezone/main.go b/test/cri-containerd/test-images/timezone/main.go index 1cca744fca..318c61a154 100644 --- a/test/cri-containerd/test-images/timezone/main.go +++ b/test/cri-containerd/test-images/timezone/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/update_utilities.go b/test/cri-containerd/update_utilities_test.go similarity index 97% rename from test/cri-containerd/update_utilities.go rename to test/cri-containerd/update_utilities_test.go index d6dfa225df..1cfe00d337 100644 --- a/test/cri-containerd/update_utilities.go +++ b/test/cri-containerd/update_utilities_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/internal/schemaversion_test.go b/test/internal/schemaversion_test.go index cb7ecf241a..1c492bd8a9 100644 --- a/test/internal/schemaversion_test.go +++ b/test/internal/schemaversion_test.go @@ -1,3 +1,5 @@ +//go:build windows + package internal import ( diff --git a/test/runhcs/create-scratch_test.go b/test/runhcs/create-scratch_test.go index 059bf60fe6..79fd555db2 100644 --- a/test/runhcs/create-scratch_test.go +++ b/test/runhcs/create-scratch_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/e2e_matrix_test.go b/test/runhcs/e2e_matrix_test.go index 28c81a7746..8aeb815134 100644 --- a/test/runhcs/e2e_matrix_test.go +++ b/test/runhcs/e2e_matrix_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/list_test.go b/test/runhcs/list_test.go index 4716c5c969..8230338d92 100644 --- a/test/runhcs/list_test.go +++ b/test/runhcs/list_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/runhcs_test.go b/test/runhcs/runhcs_test.go index 427c3d1ec2..6e7b98152e 100644 --- a/test/runhcs/runhcs_test.go +++ b/test/runhcs/runhcs_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/.gitignore b/test/vendor/github.com/Microsoft/hcsshim/.gitignore index c91812a4b4..292630f9ea 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/.gitignore +++ b/test/vendor/github.com/Microsoft/hcsshim/.gitignore @@ -34,4 +34,7 @@ rootfs-conv/* /build/ deps/* -out/* \ No newline at end of file +out/* + +go.work +go.work.sum \ No newline at end of file diff --git a/test/vendor/github.com/Microsoft/hcsshim/Makefile b/test/vendor/github.com/Microsoft/hcsshim/Makefile index 362ddea7c6..e1a0f51129 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/Makefile +++ b/test/vendor/github.com/Microsoft/hcsshim/Makefile @@ -32,7 +32,7 @@ clean: rm -rf bin deps rootfs out test: - cd $(SRCROOT) && go test -v ./internal/guest/... + cd $(SRCROOT) && $(GO) test -v ./internal/guest/... rootfs: out/rootfs.vhd diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go index 7f1f2823dd..05b6ea7bd4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go index 8e28e6c504..8dd942bab9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go index 435473257e..934ee5b1a6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go index 2db6d40399..cf90d9b6c9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go index 61d8d5a634..05e0729f50 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go index 87fee452cd..3bbbc226c0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go index 0c61dab329..a40b4037cc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go index 53ed8ea6ed..ddd8f318da 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go index fcdbbef814..6e445e766b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go index 06aaf841e8..4b27b895ad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/container.go b/test/vendor/github.com/Microsoft/hcsshim/container.go index bfd722898e..640e0b26f4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/container.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/errors.go b/test/vendor/github.com/Microsoft/hcsshim/errors.go index a1a2912177..594bbfb7a8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go new file mode 100644 index 0000000000..83b2fffb02 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go @@ -0,0 +1,3 @@ +// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server +// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +package hcn diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go index fe3d13a052..17539b8694 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go index 213cfe0b1f..267bbe7cb1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go index 1d52d2e72a..8b719fa112 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( @@ -87,7 +87,7 @@ func new(hr error, title string, rest string) error { // // Note that the below errors are not errors returned by hcn itself -// we wish to seperate them as they are shim usage error +// we wish to separate them as they are shim usage error // // NetworkNotFoundError results from a failed search for a network by Id or Name diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go index 14903bc5e9..25e368fc23 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go index 28fa855656..f68d39053e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go index 12e69de9cc..7539e39fa8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go index c36b136387..41dcdac24a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go index 56bde82e1b..a695f1c27d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go index 52e2498462..d0761d6bd0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go index bacb91feda..00af20be31 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go b/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go index ceb3ac85ee..95dc2a0255 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go @@ -1,3 +1,5 @@ +//go:build windows + // Shim for the Host Compute Service (HCS) to manage Windows Server // containers and Hyper-V containers. diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go index 9e0059447d..ea71135acc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go b/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go index 2b53819047..c564bf4a35 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go index 25240d9ccc..925c212495 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go b/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go index 55aaa4a50e..9bfe61ee83 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go b/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go index 69405244b6..d97681e0ca 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/interface.go b/test/vendor/github.com/Microsoft/hcsshim/interface.go index 300eb59966..81a2819516 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/interface.go +++ b/test/vendor/github.com/Microsoft/hcsshim/interface.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go new file mode 100644 index 0000000000..c65f2e337e --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go @@ -0,0 +1 @@ +package clone diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go index 67fb7ef077..1727d57afb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package clone import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go index 91a7da0277..758eb78880 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go @@ -1,5 +1,5 @@ -// Package cmd provides functionality used to execute commands inside of containers -// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go index f4caff3251..e397bb85ee 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go new file mode 100644 index 0000000000..7fe443fc92 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go @@ -0,0 +1,3 @@ +// Package cmd provides functionality used to execute commands inside of containers +// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +package cmd diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go index 0912af160c..75ddd1f355 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go index ecfd1fa5ef..989a53c93c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go index 63b9f9b732..614f34ca29 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( @@ -53,7 +55,7 @@ func NewNpipeIO(ctx context.Context, stdin, stdout, stderr string, terminal bool } // We don't have any retry logic for stdin as there's no good way to detect that we'd even need to retry. If the process forwarding // stdin to the container (some client interface to exec a process in a container) exited, we'll get EOF which io.Copy treats as - // success. For fifos on Linux it seems if all fd's for the write end of the pipe dissappear, which is the same scenario, then + // success. For fifos on Linux it seems if all fd's for the write end of the pipe disappear, which is the same scenario, then // the read end will get EOF as well. nio.sin = c } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go new file mode 100644 index 0000000000..b94015b5aa --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go @@ -0,0 +1 @@ +package cni diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go index 2afcc6981c..3543a590d0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go index 4389559b9a..7df98b60c0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go @@ -7,5 +7,4 @@ // The mock service is compiled using the following command: // // mockgen -source="computeagent.pb.go" -package="computeagent_mock" > mock\computeagent_mock.pb.go - package computeagent diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go index fe7a2faa11..61aa2dc405 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go @@ -1,3 +1,5 @@ +//go:build windows + package copyfile import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go new file mode 100644 index 0000000000..a2812a6ee8 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go @@ -0,0 +1 @@ +package copyfile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go index 27a62a7238..c6eeb167b9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go @@ -1,3 +1,5 @@ +//go:build windows + package cow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go index 61cd703586..3abaa9c439 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go new file mode 100644 index 0000000000..a2c3357977 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go @@ -0,0 +1 @@ +package cpugroup diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go index 0c98eb1493..d9ec9a3490 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go @@ -1,9 +1,6 @@ //go:build windows // +build windows -// Package credentials holds the necessary structs and functions for adding -// and removing Container Credential Guard instances (shortened to CCG -// normally) for V2 HCS schema containers. package credentials import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go new file mode 100644 index 0000000000..cbf23ed082 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go @@ -0,0 +1,4 @@ +// Package credentials holds the necessary structs and functions for adding +// and removing Container Credential Guard instances (shortened to CCG +// normally) for V2 HCS schema containers. +package credentials diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go new file mode 100644 index 0000000000..c1c721e298 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go @@ -0,0 +1 @@ +package devices diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go index 22d89dd303..1e3e7c201d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go index 6ec5b8b84f..bf704fb548 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go new file mode 100644 index 0000000000..260915232f --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go @@ -0,0 +1 @@ +package gcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go index bdf796010c..bb28d890ff 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go index 628cb8b0d7..60141e9f70 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go index 840dcb2392..8450222a1a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go index d13772b030..7b27173c3a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go index 85584f5b87..226dad2fbc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go index 605856f2a3..4bf3a167a5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -254,7 +256,7 @@ func (process *Process) waitBackground() { } // Wait waits for the process to exit. If the process has already exited returns -// the pervious error (if any). +// the previous error (if any). func (process *Process) Wait() error { <-process.waitBlock return process.waitError @@ -441,7 +443,6 @@ func (process *Process) CloseStderr(ctx context.Context) (err error) { if process.stderr != nil { process.stderr.Close() process.stderr = nil - } return nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go index b621c55938..d1f219cfad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go @@ -1,3 +1,5 @@ +//go:build windows + package schema1 import ( @@ -101,7 +103,7 @@ type ContainerConfig struct { HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM Servicing bool `json:",omitempty"` // True if this container is for servicing AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution - DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution + DNSSearchList string `json:",omitempty"` // Comma separated list of DNS suffixes to use for name resolution ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise. TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go index a634dfc151..a46b0051df 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go index 75499c967f..052d08ccc3 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -592,7 +594,7 @@ func (computeSystem *System) unregisterCallback(ctx context.Context) error { return nil } - // hcsUnregisterComputeSystemCallback has its own syncronization + // hcsUnregisterComputeSystemCallback has its own synchronization // to wait for all callbacks to complete. We must NOT hold the callbackMapLock. err := vmcompute.HcsUnregisterComputeSystemCallback(ctx, handle) if err != nil { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go index 3342e5bb94..5dcb97eb39 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go index db4e14fdfb..6e161e6aa1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go new file mode 100644 index 0000000000..ce70676789 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go @@ -0,0 +1 @@ +package hcserror diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go index 921c2c8556..bad2705416 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go @@ -1,3 +1,5 @@ +//go:build windows + package hcserror import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go index 058530aac1..6df67ee876 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go @@ -132,7 +132,6 @@ func verifyCloneContainerSpecs(templateSpec, cloneSpec *specs.Spec) error { } func validateContainerConfig(ctx context.Context, coi *createOptionsInternal) error { - if coi.HostingSystem != nil && coi.HostingSystem.IsTemplate && !coi.isTemplate { return fmt.Errorf("only a template container can be created inside a template pod. Any other combination is not valid") } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go index 4f17a715d6..ccc19d4af8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( @@ -117,7 +119,6 @@ func handleAssignedDevicesWindows( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure @@ -175,7 +176,6 @@ func handleAssignedDevicesLCOW( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go new file mode 100644 index 0000000000..b4b2ac611b --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go @@ -0,0 +1 @@ +package hcsoci diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go index b3080399a6..1d25b44438 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go @@ -42,7 +42,6 @@ func createMountsConfig(ctx context.Context, coi *createOptionsInternal) (*mount // TODO: Mapped pipes to add in v2 schema. var config mountsConfig for _, mount := range coi.Spec.Mounts { - if uvm.IsPipe(mount.Source) { src, dst := uvm.GetContainerPipeMapping(coi.HostingSystem, mount) config.mpsv1 = append(config.mpsv1, schema1.MappedPipe{HostPath: src, ContainerPipeName: dst}) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go index daa4e46d00..27bf2669d2 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go new file mode 100644 index 0000000000..f6d35df0e5 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go @@ -0,0 +1 @@ +package hns diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go index 7cf954c7b2..83b683bd90 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( @@ -146,7 +148,6 @@ func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) { } return false, nil - } // Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods @@ -281,7 +282,6 @@ func (endpoint *HNSEndpoint) HostAttach(compartmentID uint16) error { return err } return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response) - } // HostDetach detaches a nic on the host diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go index 2df4a57f56..0a8f36d832 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go index a8d8cc56ae..464bb8954f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hns type HNSGlobals struct { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go index f12d3ab041..8861faee7a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go @@ -1,13 +1,16 @@ +//go:build windows + package hns import ( "encoding/json" "errors" - "github.com/sirupsen/logrus" "net" + + "github.com/sirupsen/logrus" ) -// Subnet is assoicated with a network and represents a list +// Subnet is associated with a network and represents a list // of subnets available to the network type Subnet struct { AddressPrefix string `json:",omitempty"` @@ -15,7 +18,7 @@ type Subnet struct { Policies []json.RawMessage `json:",omitempty"` } -// MacPool is assoicated with a network and represents a list +// MacPool is associated with a network and represents a list // of macaddresses available to the network type MacPool struct { StartMacAddress string `json:",omitempty"` diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go index 31322a6816..b98db40e8d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go index d5efba7f28..b9c30b9019 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go index d3b04eefe0..749588ad39 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go new file mode 100644 index 0000000000..cb554867fe --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go @@ -0,0 +1 @@ +package interop diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go index 922f7c679e..137dc3990a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go @@ -1,3 +1,5 @@ +//go:build windows + package interop import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go new file mode 100644 index 0000000000..747ac49a97 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go @@ -0,0 +1,2 @@ +// Package layers deals with container layer mounting/unmounting for LCOW and WCOW +package layers diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go index 0334076365..e0fa566b63 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go @@ -1,7 +1,6 @@ //go:build windows // +build windows -// Package layers deals with container layer mounting/unmounting for LCOW and WCOW package layers import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go index 32938641e8..fa78a8ecb6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go index c7af7cf6ce..937b8deafa 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go new file mode 100644 index 0000000000..6105d5b57d --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go @@ -0,0 +1 @@ +package lcow diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go index ae385a1c1b..001f3347cd 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go index 569b035654..3b9064d671 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go @@ -2,6 +2,7 @@ package oci import ( "fmt" + "github.com/Microsoft/hcsshim/pkg/annotations" ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go index b0876465f0..4a624639f8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -285,7 +287,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, lopts) // SecurityPolicy is very sensitive to other settings and will silently change those that are incompatible. - // Eg VMPem device count, overriden kernel option cannot be respected. + // Eg VMPem device count, overridden kernel option cannot be respected. handleSecurityPolicy(ctx, s.Annotations, lopts) // override the default GuestState filename if specified diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go new file mode 100644 index 0000000000..dd2a53b5c6 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go @@ -0,0 +1 @@ +package processorinfo diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go index f179857a63..0aa766a43e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go index 3f6301ed68..848df8248e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go new file mode 100644 index 0000000000..51bcdf6e98 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go @@ -0,0 +1 @@ +package regstate diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go index dcbc9334d7..184975add8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go new file mode 100644 index 0000000000..878cd99d0c --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go @@ -0,0 +1,3 @@ +// Package resources handles creating, updating, and releasing resources +// on a container +package resources diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go index 89851ae7c3..90fe116ae5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go @@ -1,5 +1,5 @@ -// Package resources handles creating, updating, and releasing resources -// on a container +//go:build windows + package resources import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go index a161c204e2..33c43e6c59 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go index 2c8957b88d..b3e443d600 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go new file mode 100644 index 0000000000..f211d25e72 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go @@ -0,0 +1 @@ +package safefile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go index 66b8d7e035..8770bf5627 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( @@ -156,7 +158,6 @@ func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os. if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 { return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: winapi.RtlNtStatusToDosError(winapi.STATUS_REPARSE_POINT_ENCOUNTERED)} } - } else { parent = newroot } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go new file mode 100644 index 0000000000..c1432114b1 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go @@ -0,0 +1 @@ +package schemaversion diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go index 2d1242da42..6d37c7b411 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package shimdiag import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go index d76bfdbef4..50ac874bce 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import "github.com/Microsoft/hcsshim/internal/hcs/schema1" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go index 4e2f95a148..010bac3145 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go index fe06563488..468139c0f7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go index b87edf2796..44b328ad37 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go index fc08daae2f..fd49be9bfc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go index f4c17fae2c..f93a83ca6e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go index 264da31a28..ea5fccf625 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go index a3d9fcd4e6..1f5d212276 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -74,7 +76,7 @@ type Options struct { // far as the container is concerned and it is only able to view the NICs in the compartment it's assigned to. // This is the compartment setup (and behavior) that is followed for V1 HCS schema containers (docker) so // this change brings parity as well. This behavior is gated behind a registry key currently to avoid any - // unneccessary behavior and once this restriction is removed then we can remove the need for this variable + // unnecessary behavior and once this restriction is removed then we can remove the need for this variable // and the associated annotation as well. DisableCompartmentNamespace bool diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go index 8df0e743e0..5aafd7f7d5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -27,7 +29,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -// General infomation about how this works at a high level. +// General information about how this works at a high level. // // The purpose is to start an LCOW Utility VM or UVM using the Host Compute Service, an API to create and manipulate running virtual machines // HCS takes json descriptions of the work to be done. @@ -181,7 +183,7 @@ func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hc return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -279,7 +281,6 @@ Example JSON document produced once the hcsschema.ComputeSytem returned by makeL // Make a hcsschema.ComputeSytem with the parts that target booting from a VMGS file func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - // Kernel and initrd are combined into a single vmgs file. vmgsFullPath := filepath.Join(opts.BootFilesPath, opts.GuestStateFile) if _, err := os.Stat(vmgsFullPath); os.IsNotExist(err) { @@ -372,7 +373,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ ApplySecureBootTemplate: "Apply", - SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivilent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, + SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, } @@ -392,7 +393,6 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Many details are quite different (see the typical JSON examples), in particular it boots from a VMGS file // which contains both the kernel and initrd as well as kernel boot options. func makeLCOWSecurityDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - doc, vmgsErr := makeLCOWVMGSDoc(ctx, opts, uvm) if vmgsErr != nil { return nil, vmgsErr @@ -488,7 +488,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs } var processor *hcsschema.Processor2 - processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existance tests above. + processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existence tests above. if err != nil { return nil, err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go index 1d083ffda2..cd12bfd02a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -86,7 +88,7 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -277,10 +279,10 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error } // TODO: BUGBUG Remove this. @jhowardmsft - // It should be the responsiblity of the caller to do the creation and population. + // It should be the responsibility of the caller to do the creation and population. // - Update runhcs too (vm.go). // - Remove comment in function header - // - Update tests that rely on this current behaviour. + // - Update tests that rely on this current behavior. // Create the RW scratch in the top-most layer folder, creating the folder if it doesn't already exist. scratchFolder := opts.LayerFolders[len(opts.LayerFolders)-1] diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go index 5ef5c73cbd..46bef7b163 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go new file mode 100644 index 0000000000..c4e25cc15c --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go @@ -0,0 +1,2 @@ +// This package describes the external interface for utility VMs. +package uvm diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go index d4ad56d7ec..ed39fd282d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go index 5459859453..f097c4f33c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go index 03c1855796..4e439c7894 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go index 058ffff013..7a06f283dd 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go index 009806e683..5a57dce9a6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go index dca3ad5ab9..03509ad882 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -41,7 +43,7 @@ var ( // In this function we take the namespace ID of the namespace that was created for this // UVM. We hot add the namespace (with the default ID if this is a template). We get the // endpoints associated with this namespace and then hot add those endpoints (by changing -// their namespace IDs by the deafult IDs if it is a template). +// their namespace IDs by the default IDs if it is a template). func (uvm *UtilityVM) SetupNetworkNamespace(ctx context.Context, nsid string) error { nsidInsideUVM := nsid if uvm.IsTemplate || uvm.IsClone { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go index c4fcd34e82..cc67f9a798 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go index 475a9dbc1d..d8fce975f8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go index 5cac727387..072dbab116 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -521,7 +523,6 @@ func (uvm *UtilityVM) allocateSCSIMount( log.G(ctx).WithFields(uvm.scsiLocations[controller][lun].logFormat()).Debug("allocated SCSI mount") return uvm.scsiLocations[controller][lun], false, nil - } // GetScsiUvmPath returns the guest mounted path of a SCSI drive. diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go index 89278acb6b..6570928ea7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go index db05448c68..41ecda3a3a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go index 702815ed6a..412717aca6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go index d6a27b67a3..2cd5c24ce0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go index 18c191cf4a..3ce7b9764f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go index b87fe45f7f..020eb7099b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go @@ -1,6 +1,6 @@ -package uvm +//go:build windows -// This package describes the external interface for utility VMs. +package uvm import ( "net" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go index 1e1e07f274..b8fcddac6e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go index 0a729ecde5..3bd6e187a9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go index b41ed27aa6..cde51aa014 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go index b98948ecfd..510e9ed4c4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go index b2ccf5be4f..348058c7ef 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go index 552ee5fad7..d052be533a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go new file mode 100644 index 0000000000..9e2b205da0 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go @@ -0,0 +1 @@ +package uvmfolder diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go new file mode 100644 index 0000000000..9dd00c8128 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go @@ -0,0 +1 @@ +package vmcompute diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go index 8ca01f8247..ef2e3708b8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go @@ -1,3 +1,5 @@ +//go:build windows + package vmcompute import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go index 5debe974d4..98a79ef4c5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go index 3ec708d1ed..aea8b421ef 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -48,7 +50,6 @@ func reapplyDirectoryTimes(root *os.File, dis []dirInfo) error { if err != nil { return err } - } return nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go index 480aee8725..4e81298514 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go index 131aa94f14..5750d53e91 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go index d5bf2f5bdc..724af6223d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go index 424467ac33..20c5afea7f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go new file mode 100644 index 0000000000..dd1d555804 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go @@ -0,0 +1,4 @@ +// Package wclayer provides bindings to HCS's legacy layer management API and +// provides a higher level interface around these calls for container layer +// management. +package wclayer diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go index 035c9041e6..38071322b7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go index 97b27eb7d6..3c388ef4bc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go index 8d213f5871..761b5bbd1d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go index ae1fff8403..1da329c7a4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go index 4b282fef9d..b0da3e71df 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go index 687550f0be..cd4e470837 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go index 01e6723393..5ee3379cfb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go index 0ce34a30f8..ea459d2d42 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go index 1ec893c6af..86f0549ef6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer // This file contains utility functions to support storage (graph) related diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go index b7f3064f26..f012d51104 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -262,7 +264,6 @@ func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.Fil // The creation time and access time get reset for files outside of the Files path. fileInfo.CreationTime = fileInfo.LastWriteTime fileInfo.LastAccessTime = fileInfo.LastWriteTime - } else { // The file attributes are written before the backup stream. var attr uint32 diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go index 09950297ce..30938e3d66 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go index 90129faefb..2f128ab153 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go index 30bcdff5f5..aaf55d887b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go index 71b130c525..c53a06ea2c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go index 9b1e06d50c..8aeab8d24e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go @@ -1,6 +1,5 @@ -// Package wclayer provides bindings to HCS's legacy layer management API and -// provides a higher level interface around these calls for container layer -// management. +//go:build windows + package wclayer import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go new file mode 100644 index 0000000000..b02b2ddcf2 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go @@ -0,0 +1 @@ +package wcow diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go index 940ccbf7f6..992ac0edda 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package wcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go index def9525417..4547cdd8e8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go index df28ea2421..7875466cad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go new file mode 100644 index 0000000000..9acc0bfc17 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go @@ -0,0 +1,3 @@ +// Package winapi contains various low-level bindings to Windows APIs. It can +// be thought of as an extension to golang.org/x/sys/windows. +package winapi diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go index 4e80ef68c9..49ce924cbe 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "syscall" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go index 7ce52afd5e..0d78c051ba 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi //sys NtCreateFile(handle *uintptr, accessMask uint32, oa *ObjectAttributes, iosb *IOStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) = ntdll.NtCreateFile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go index b2ca47c02b..5eac5a3729 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go index 9e4009d873..f5b1868e48 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "golang.org/x/sys/windows" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go index 47aa63e34a..8abc095d60 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go index 859b753c24..7b93974846 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go index d2cc9d9fba..9310bb7546 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go @@ -1,5 +1,3 @@ -// Package winapi contains various low-level bindings to Windows APIs. It can -// be thought of as an extension to golang.org/x/sys/windows. package winapi //go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/test/vendor/github.com/Microsoft/hcsshim/layer.go b/test/vendor/github.com/Microsoft/hcsshim/layer.go index 8916163706..e323c8308d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/layer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/layer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go b/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go index 3ab3bcd89a..ecb0766164 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go +++ b/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go @@ -1,3 +1,5 @@ +//go:build windows + package osversion import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go new file mode 100644 index 0000000000..f2523af44a --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go @@ -0,0 +1 @@ +package runhcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go index 64491a70cc..1d82f72c6f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -20,7 +22,7 @@ type Format string const ( none Format = "" - // Text is the default text log ouput. + // Text is the default text log output. Text Format = "text" // JSON is the JSON formatted log output. JSON Format = "json" @@ -140,7 +142,7 @@ func (r *Runhcs) runOrError(cmd *exec.Cmd) error { } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } @@ -166,7 +168,7 @@ func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) { status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return b.Bytes(), err diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go index 720386c273..956e4c1f77 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go index 20d5d402ec..f908de4e29 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -95,7 +97,7 @@ func (r *Runhcs) Create(context context.Context, id, bundle string, opts *Create } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go index 08b82bbd9a..307a1de5c1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go index 090a0a31f8..a85ee66f7a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -82,7 +84,7 @@ func (r *Runhcs) Exec(context context.Context, id, processFile string, opts *Exe } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go index 021e5b16fe..8480c64929 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go index 3b9208017f..d7e88a2f05 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go index 56392fa43e..93ec1e8770 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go index 4dc9f144fe..b60dabe8f5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go index b9f90491d3..016b948056 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go index 1fdeb87d9b..0116d0a2de 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go index ad3df746a8..98de529de7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go index b22bb079cc..cc18801ec1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go new file mode 100644 index 0000000000..0ec1aa05c4 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go @@ -0,0 +1,3 @@ +// Package ociwclayer provides functions for importing and exporting Windows +// container layers from and to their OCI tar representation. +package ociwclayer diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go index e3f1be333d..feea29080e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go @@ -1,5 +1,5 @@ -// Package ociwclayer provides functions for importing and exporting Windows -// container layers from and to their OCI tar representation. +//go:build windows + package ociwclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go index e74a6b5946..863329c1ba 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package ociwclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go index b435080e9e..97145d819b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go @@ -85,7 +85,7 @@ type StandardSecurityPolicyEnforcer struct { // // Most of the work that this security policy enforcer does it around managing // state needed to map from a container definition in the SecurityPolicy to - // a specfic container ID as we bring up each container. See + // a specific container ID as we bring up each container. See // enforceCommandPolicy where most of the functionality is handling the case // were policy containers share an overlay and have to try to distinguish them // based on the command line arguments. enforceEnvironmentVariablePolicy can diff --git a/test/vendor/github.com/Microsoft/hcsshim/process.go b/test/vendor/github.com/Microsoft/hcsshim/process.go index 3362c68335..44df91cde2 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import (