diff --git a/cmd/ctr/commands/cni.go b/cmd/ctr/commands/cni.go index 4c15306a6..c1620cea3 100644 --- a/cmd/ctr/commands/cni.go +++ b/cmd/ctr/commands/cni.go @@ -36,7 +36,7 @@ const ( CtrCniMetadataExtension = "ctr.cni-containerd.metadata" ) -// ctr pass cni network metadata to containerd if ctr run use option of --cni +// NetworkMetaData ctr pass cni network metadata to containerd if ctr run use option of --cni type NetworkMetaData struct { EnableCni bool } diff --git a/integration/images/image_list.go b/integration/images/image_list.go index 0232a787d..d7cce9524 100644 --- a/integration/images/image_list.go +++ b/integration/images/image_list.go @@ -90,7 +90,7 @@ const ( VolumeCopyUp // VolumeOwnership image VolumeOwnership - // Test image for ArgsEscaped windows bug + // ArgsEscaped tests image for ArgsEscaped windows bug ArgsEscaped ) diff --git a/metadata/gc.go b/metadata/gc.go index 5518a4487..1e460eb04 100644 --- a/metadata/gc.go +++ b/metadata/gc.go @@ -72,7 +72,7 @@ var ( // function and optimize other functions for running fast during garbage // collection write locks. type CollectionContext interface { - // Sends all known resources + // All sends all known resources All(func(gc.Node)) // Active sends all active resources diff --git a/pkg/cri/server/bandwidth/interfaces.go b/pkg/cri/server/bandwidth/interfaces.go index 9eb4bfb60..b8f46b1ee 100644 --- a/pkg/cri/server/bandwidth/interfaces.go +++ b/pkg/cri/server/bandwidth/interfaces.go @@ -45,11 +45,11 @@ type Shaper interface { // Limits are aggregate limits for the CIDR, not per IP address. CIDRs must be unique, but can be overlapping, traffic // that matches multiple CIDRs counts against all limits. Limit(cidr string, egress, ingress *resource.Quantity) error - // Remove a bandwidth limit for a particular CIDR on a particular network interface + // Reset removes a bandwidth limit for a particular CIDR on a particular network interface Reset(cidr string) error - // Reconcile the interface managed by this shaper with the state on the ground. + // ReconcileInterface reconciles the interface managed by this shaper with the state on the ground. ReconcileInterface() error - // Reconcile a CIDR managed by this shaper with the state on the ground + // ReconcileCIDR reconciles a CIDR managed by this shaper with the state on the ground ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error // GetCIDRs returns the set of CIDRs that are being managed by this shaper GetCIDRs() ([]string, error) diff --git a/pkg/cri/streaming/portforward/portforward.go b/pkg/cri/streaming/portforward/portforward.go index 89a39ea66..853a0ba0c 100644 --- a/pkg/cri/streaming/portforward/portforward.go +++ b/pkg/cri/streaming/portforward/portforward.go @@ -45,7 +45,7 @@ import ( // PortForwarder knows how to forward content from a data stream to/from a port // in a pod. type PortForwarder interface { - // PortForwarder copies data between a data stream and a port in a pod. + // PortForward copies data between a data stream and a port in a pod. PortForward(name string, uid types.UID, port int32, stream io.ReadWriteCloser) error } diff --git a/pkg/failpoint/fail.go b/pkg/failpoint/fail.go index d616ec97e..7638e330c 100644 --- a/pkg/failpoint/fail.go +++ b/pkg/failpoint/fail.go @@ -136,7 +136,7 @@ func (fp *Failpoint) DelegatedEval() EvalFn { return target.evaluate } -// Failpoint returns the current state of control in string format. +// Marshal returns the current state of control in string format. func (fp *Failpoint) Marshal() string { fp.Lock() defer fp.Unlock() diff --git a/pkg/netns/netns_windows.go b/pkg/netns/netns_windows.go index 2d26d6f71..3d62d1b8c 100644 --- a/pkg/netns/netns_windows.go +++ b/pkg/netns/netns_windows.go @@ -40,7 +40,7 @@ func NewNetNS(baseDir string) (*NetNS, error) { return &NetNS{path: hcnNamespace.Id}, nil } -// NewNetNS returns the netns from pid or a new netns if pid is 0. +// NewNetNSFromPID returns the netns from pid or a new netns if pid is 0. func NewNetNSFromPID(baseDir string, pid uint32) (*NetNS, error) { return nil, errNotImplementedOnWindows } diff --git a/pkg/nri/domain.go b/pkg/nri/domain.go index 186ce13d0..5559a4e41 100644 --- a/pkg/nri/domain.go +++ b/pkg/nri/domain.go @@ -31,13 +31,13 @@ import ( // Domain implements the functions the generic NRI interface needs to // deal with pods and containers from a particular containerd namespace. type Domain interface { - // GetName() returns the containerd namespace for this domain. + // GetName returns the containerd namespace for this domain. GetName() string - // ListPodSandboxes list all pods in this namespace. + // ListPodSandboxes lists all pods in this namespace. ListPodSandboxes() []PodSandbox - // ListContainer list all containers in this namespace. + // ListContainers lists all containers in this namespace. ListContainers() []Container // GetPodSandbox returns the pod for the given ID. diff --git a/pkg/nri/nri.go b/pkg/nri/nri.go index b8a66dcb7..eb9adb878 100644 --- a/pkg/nri/nri.go +++ b/pkg/nri/nri.go @@ -80,7 +80,7 @@ type API interface { // NotifyContainerExit handles the exit event of a container. NotifyContainerExit(context.Context, PodSandbox, Container) - // StopContainer relays container removal events to NRI. + // RemoveContainer relays container removal events to NRI. RemoveContainer(context.Context, PodSandbox, Container) error } diff --git a/pkg/transfer/image/imagestore.go b/pkg/transfer/image/imagestore.go index 46bc03b4d..e18bfb0cf 100644 --- a/pkg/transfer/image/imagestore.go +++ b/pkg/transfer/image/imagestore.go @@ -130,7 +130,7 @@ func WithNamedPrefix(name string, allowOverwrite bool) StoreOpt { } } -// WithNamedPrefix uses a named prefix to references images which only have a tag name +// WithDigestRef uses a named prefix to references images which only have a tag name // reference in the annotation or check full references annotations against and // additionally may add a digest reference. Images with no references resolved // from matching annotations may be stored by digest. diff --git a/pkg/transfer/local/progress.go b/pkg/transfer/local/progress.go index 6762842a8..72c8ad3ec 100644 --- a/pkg/transfer/local/progress.go +++ b/pkg/transfer/local/progress.go @@ -208,7 +208,7 @@ func (j *ProgressTracker) MarkExists(desc ocispec.Descriptor) { } -// Adds hierarchy information +// AddChildren adds hierarchy information func (j *ProgressTracker) AddChildren(desc ocispec.Descriptor, children []ocispec.Descriptor) { if j == nil || len(children) == 0 { return diff --git a/pkg/transfer/registry/registry.go b/pkg/transfer/registry/registry.go index d11af3c92..ee006b167 100644 --- a/pkg/transfer/registry/registry.go +++ b/pkg/transfer/registry/registry.go @@ -42,7 +42,7 @@ func init() { plugins.Register(&transfertypes.OCIRegistry{}, &OCIRegistry{}) } -// Initialize with hosts, authorizer callback, and headers +// NewOCIRegistry initializes with hosts, authorizer callback, and headers func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry { // Create an authorizer var aopts []docker.AuthorizerOpt diff --git a/plugin/plugin.go b/plugin/plugin.go index d1b94ac44..3fba7bb87 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -78,7 +78,7 @@ const ( EventPlugin Type = "io.containerd.event.v1" // LeasePlugin implements lease manager LeasePlugin Type = "io.containerd.lease.v1" - // Streaming implements a stream manager + // StreamingPlugin implements a stream manager StreamingPlugin Type = "io.containerd.streaming.v1" // TracingProcessorPlugin implements a open telemetry span processor TracingProcessorPlugin Type = "io.containerd.tracing.processor.v1" diff --git a/protobuf/any.go b/protobuf/any.go index 84da2a33d..2930f113a 100644 --- a/protobuf/any.go +++ b/protobuf/any.go @@ -37,7 +37,7 @@ func FromAny(from typeurl.Any) *anypb.Any { } } -// FromAny converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any. +// MarshalAnyToProto converts an arbitrary interface to github.com/containerd/containerd/protobuf/types.Any. func MarshalAnyToProto(from interface{}) (*anypb.Any, error) { any, err := typeurl.MarshalAny(from) if err != nil { diff --git a/remotes/docker/auth/parse.go b/remotes/docker/auth/parse.go index e4529a776..6ca935158 100644 --- a/remotes/docker/auth/parse.go +++ b/remotes/docker/auth/parse.go @@ -49,7 +49,7 @@ type byScheme []Challenge func (bs byScheme) Len() int { return len(bs) } func (bs byScheme) Swap(i, j int) { bs[i], bs[j] = bs[j], bs[i] } -// Sort in priority order: token > digest > basic +// Less sorts in priority order: token > digest > basic func (bs byScheme) Less(i, j int) bool { return bs[i].Scheme > bs[j].Scheme } // Octet types from RFC 2616. diff --git a/services/services.go b/services/services.go index d7255169f..a058603b6 100644 --- a/services/services.go +++ b/services/services.go @@ -33,6 +33,6 @@ const ( DiffService = "diff-service" // IntrospectionService is the id of introspection service IntrospectionService = "introspection-service" - // Streaming service is the id of the streaming service + // StreamingService is the id of the streaming service StreamingService = "streaming-service" )