diff --git a/.golangci.yml b/.golangci.yml index a8b88ab06..dd9f3b191 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,9 +37,6 @@ issues: - linters: - govet text: "copylocks" - - linters: - - revive - text: package-comments - linters: - staticcheck text: "Do not rely on the global seed" diff --git a/client/client.go b/client/client.go index 5afe4b985..6654be9a6 100644 --- a/client/client.go +++ b/client/client.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package client provides utilities for clients of firecracker-containerd. package client import "github.com/firecracker-microvm/firecracker-containerd/internal/bundle" diff --git a/docker-credential-mmds/mmds/client.go b/docker-credential-mmds/mmds/client.go index 7df1d1f4a..1e6fb0023 100644 --- a/docker-credential-mmds/mmds/client.go +++ b/docker-credential-mmds/mmds/client.go @@ -10,6 +10,8 @@ // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. + +// Package mmds provides a docker credential helper backed by Firecracker's MMDS. package mmds import ( diff --git a/docker-credential-mmds/mmds/helper.go b/docker-credential-mmds/mmds/helper.go index 806fe8c72..17e97dcab 100644 --- a/docker-credential-mmds/mmds/helper.go +++ b/docker-credential-mmds/mmds/helper.go @@ -10,6 +10,8 @@ // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. + +// Package mmds provides a docker credential helper backed by Firecracker's MMDS. package mmds import ( diff --git a/eventbridge/eventbridge.go b/eventbridge/eventbridge.go index e3acd56fa..dbfa24636 100644 --- a/eventbridge/eventbridge.go +++ b/eventbridge/eventbridge.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package eventbridge provides utilities for bridging containerd event streams. package eventbridge import ( diff --git a/firecracker-control/client/client.go b/firecracker-control/client/client.go index c28e87231..12d7177ae 100644 --- a/firecracker-control/client/client.go +++ b/firecracker-control/client/client.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package client provides a client for the firecracker-control service. package client import ( diff --git a/firecracker-control/common.go b/firecracker-control/common.go index 84ee76c5f..7cc91fd21 100644 --- a/firecracker-control/common.go +++ b/firecracker-control/common.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package service implements the firecracker-control service. package service const ( diff --git a/firecracker-control/local.go b/firecracker-control/local.go index a02cbd4a9..8d45d2362 100644 --- a/firecracker-control/local.go +++ b/firecracker-control/local.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package service implements the firecracker-control service. package service import ( diff --git a/firecracker-control/service.go b/firecracker-control/service.go index fa57e250b..0e14aa474 100644 --- a/firecracker-control/service.go +++ b/firecracker-control/service.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package service implements the firecracker-control service. package service import ( diff --git a/internal/bundle/bundle.go b/internal/bundle/bundle.go index a140c6858..e4f8d3688 100644 --- a/internal/bundle/bundle.go +++ b/internal/bundle/bundle.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package bundle provides utilities for working with container bundles. package bundle import ( diff --git a/internal/common.go b/internal/common.go index 9e7a78b48..8cf9c02db 100644 --- a/internal/common.go +++ b/internal/common.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/common_test.go b/internal/common_test.go index 14be1d744..f16e0e8b8 100644 --- a/internal/common_test.go +++ b/internal/common_test.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/cpu_template.go b/internal/cpu_template.go index dc4e76386..b9d2c2359 100644 --- a/internal/cpu_template.go +++ b/internal/cpu_template.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/cpu_template_test.go b/internal/cpu_template_test.go index cbc3be0c0..e6642ad25 100644 --- a/internal/cpu_template_test.go +++ b/internal/cpu_template_test.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/debug/debug.go b/internal/debug/debug.go index 2f22871ce..56e025640 100644 --- a/internal/debug/debug.go +++ b/internal/debug/debug.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package debug provides utilities for handling multi-level logging. package debug import ( diff --git a/internal/debug/error.go b/internal/debug/error.go index ee3bc67e6..3773a165d 100644 --- a/internal/debug/error.go +++ b/internal/debug/error.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package debug provides utilities for handling multi-level logging. package debug import ( diff --git a/internal/event/exchange.go b/internal/event/exchange.go index 248253fe2..09096dc65 100644 --- a/internal/event/exchange.go +++ b/internal/event/exchange.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package event provides event-related utilities. package event import ( diff --git a/internal/fsutil.go b/internal/fsutil.go index 46cc4b57f..06c036372 100644 --- a/internal/fsutil.go +++ b/internal/fsutil.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/integtest/config.go b/internal/integtest/config.go index 1316226eb..72a006284 100644 --- a/internal/integtest/config.go +++ b/internal/integtest/config.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import ( diff --git a/internal/integtest/containerd.go b/internal/integtest/containerd.go index 8b28a7d46..c59d6b877 100644 --- a/internal/integtest/containerd.go +++ b/internal/integtest/containerd.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import ( diff --git a/internal/integtest/firecracker.go b/internal/integtest/firecracker.go index 6c9f045bc..db9f26a46 100644 --- a/internal/integtest/firecracker.go +++ b/internal/integtest/firecracker.go @@ -11,9 +11,12 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest -import "github.com/firecracker-microvm/firecracker-containerd/firecracker-control/client" +import ( + "github.com/firecracker-microvm/firecracker-containerd/firecracker-control/client" +) // NewFCControlClient returns a Firecracker control client for the given socket. func NewFCControlClient(socket string) (*client.Client, error) { diff --git a/internal/integtest/network.go b/internal/integtest/network.go index ee7fb7633..2b25bfe67 100644 --- a/internal/integtest/network.go +++ b/internal/integtest/network.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import ( diff --git a/internal/integtest/prepare.go b/internal/integtest/prepare.go index 82a437e41..737c3115a 100644 --- a/internal/integtest/prepare.go +++ b/internal/integtest/prepare.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import ( diff --git a/internal/integtest/runtime.go b/internal/integtest/runtime.go index 58b505a7a..264fdc113 100644 --- a/internal/integtest/runtime.go +++ b/internal/integtest/runtime.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import ( diff --git a/internal/integtest/shim.go b/internal/integtest/shim.go index 576f193c6..540e4378a 100644 --- a/internal/integtest/shim.go +++ b/internal/integtest/shim.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package integtest provides integration testing utilities. package integtest import "os" diff --git a/internal/network_test_utils.go b/internal/network_test_utils.go index 200e24384..7eaf66dd8 100644 --- a/internal/network_test_utils.go +++ b/internal/network_test_utils.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/psutil.go b/internal/psutil.go index 5baf9b706..cbca17676 100644 --- a/internal/psutil.go +++ b/internal/psutil.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/shim/shim.go b/internal/shim/shim.go index 0f863fd96..4d8e0688a 100644 --- a/internal/shim/shim.go +++ b/internal/shim/shim.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package shim provides firecracker-containerd specific shim utilities. package shim import ( diff --git a/internal/testutils.go b/internal/testutils.go index d311a84c3..26b88be9f 100644 --- a/internal/testutils.go +++ b/internal/testutils.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package internal contains internal utilities. package internal import ( diff --git a/internal/vm/agent.go b/internal/vm/agent.go index 8c9ab8b03..76fcacd7a 100644 --- a/internal/vm/agent.go +++ b/internal/vm/agent.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/fifo.go b/internal/vm/fifo.go index 5078a02f1..b2efa5c34 100644 --- a/internal/vm/fifo.go +++ b/internal/vm/fifo.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/mount.go b/internal/vm/mount.go index 291dadbc6..84ab01290 100644 --- a/internal/vm/mount.go +++ b/internal/vm/mount.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/oci.go b/internal/vm/oci.go index a23d3fbc3..774553d54 100644 --- a/internal/vm/oci.go +++ b/internal/vm/oci.go @@ -24,6 +24,7 @@ limitations under the License. */ +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/task.go b/internal/vm/task.go index 2ffcaeab6..2a84aa932 100644 --- a/internal/vm/task.go +++ b/internal/vm/task.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/task_test.go b/internal/vm/task_test.go index 689c6266d..5401211d2 100644 --- a/internal/vm/task_test.go +++ b/internal/vm/task_test.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/internal/vm/vsock.go b/internal/vm/vsock.go index 516230955..7bda16935 100644 --- a/internal/vm/vsock.go +++ b/internal/vm/vsock.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/runtime/cpuset/cpuset_builder.go b/runtime/cpuset/cpuset_builder.go index 23f1421f9..1420097c2 100644 --- a/runtime/cpuset/cpuset_builder.go +++ b/runtime/cpuset/cpuset_builder.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package cpuset provides a builder for creating cpuset configurations. package cpuset import ( diff --git a/runtime/firecrackeroci/annotation.go b/runtime/firecrackeroci/annotation.go index 7356c6f71..218f6e26b 100644 --- a/runtime/firecrackeroci/annotation.go +++ b/runtime/firecrackeroci/annotation.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package firecrackeroci provides OCI utilities specific to firecracker-containerd. package firecrackeroci import ( diff --git a/runtime/firecrackeroci/network.go b/runtime/firecrackeroci/network.go index af5f3d333..cb73a656f 100644 --- a/runtime/firecrackeroci/network.go +++ b/runtime/firecrackeroci/network.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package firecrackeroci provides OCI utilities specific to firecracker-containerd. package firecrackeroci import ( diff --git a/runtime/firecrackeroci/vm.go b/runtime/firecrackeroci/vm.go index bed4a5c87..ee9f1b5ea 100644 --- a/runtime/firecrackeroci/vm.go +++ b/runtime/firecrackeroci/vm.go @@ -11,19 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. -/* - Copyright The containerd Authors. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - +// Package firecrackeroci provides OCI utilities specific to firecracker-containerd. package firecrackeroci import ( diff --git a/runtime/vm/mount.go b/runtime/vm/mount.go index 12ac48c49..d0ae559d1 100644 --- a/runtime/vm/mount.go +++ b/runtime/vm/mount.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package vm provides utilities for managing the VM. package vm import ( diff --git a/snapshotter/app/service.go b/snapshotter/app/service.go index c76f58275..9dd59422d 100644 --- a/snapshotter/app/service.go +++ b/snapshotter/app/service.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package app provides the entrypoint for the demux snapshotter. package app import ( diff --git a/snapshotter/config/config.go b/snapshotter/config/config.go index 42fe84f90..7a0a822a5 100644 --- a/snapshotter/config/config.go +++ b/snapshotter/config/config.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package config defines the configuration for the demux snapshotter. package config import ( diff --git a/snapshotter/internal/integtest/stargz/fs/config/config.go b/snapshotter/internal/integtest/stargz/fs/config/config.go index e8a06713b..b81131e95 100644 --- a/snapshotter/internal/integtest/stargz/fs/config/config.go +++ b/snapshotter/internal/integtest/stargz/fs/config/config.go @@ -38,6 +38,7 @@ license that can be found in the NOTICE.md file. */ +// Package config provides constants for stargz snapshotter integration tests. package config const ( diff --git a/snapshotter/internal/mount/collection.go b/snapshotter/internal/mount/collection.go index f0ecffb1d..8340cf1ca 100644 --- a/snapshotter/internal/mount/collection.go +++ b/snapshotter/internal/mount/collection.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package mount provides utilities for mount points. package mount import "github.com/containerd/containerd/mount" diff --git a/volume/guest_image.go b/volume/guest_image.go index e1cda2e3e..6fd4d4bd1 100644 --- a/volume/guest_image.go +++ b/volume/guest_image.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package volume provides functionality for volume management. package volume import ( diff --git a/volume/image.go b/volume/image.go index 41cb80b77..55edf8403 100644 --- a/volume/image.go +++ b/volume/image.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package volume provides functionality for volume management. package volume import ( diff --git a/volume/set.go b/volume/set.go index 26a4ae0d2..4539b569a 100644 --- a/volume/set.go +++ b/volume/set.go @@ -11,6 +11,7 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package volume provides functionality for volume management. package volume import ( diff --git a/volume/volume_test.go b/volume/volume_test.go index 58a250b88..24ecdf528 100644 --- a/volume/volume_test.go +++ b/volume/volume_test.go @@ -11,6 +11,10 @@ // express or implied. See the License for the specific language governing // permissions and limitations under the License. +// Package volume provides volumes like Docker and Amazon ECS. +// Volumes are specicial directories that could be shared by multiple containers. +// +// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#volumes package volume import (