Fix some typos

Signed-off-by: Pan Yibo <mstmdev@gmail.com>
This commit is contained in:
mstmdev 2023-05-10 02:45:57 +08:00
parent 43bbffba37
commit cdaa4025e9
16 changed files with 20 additions and 20 deletions

View File

@ -36,7 +36,7 @@ const (
CtrCniMetadataExtension = "ctr.cni-containerd.metadata" 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 { type NetworkMetaData struct {
EnableCni bool EnableCni bool
} }

View File

@ -90,7 +90,7 @@ const (
VolumeCopyUp VolumeCopyUp
// VolumeOwnership image // VolumeOwnership image
VolumeOwnership VolumeOwnership
// Test image for ArgsEscaped windows bug // ArgsEscaped tests image for ArgsEscaped windows bug
ArgsEscaped ArgsEscaped
) )

View File

@ -72,7 +72,7 @@ var (
// function and optimize other functions for running fast during garbage // function and optimize other functions for running fast during garbage
// collection write locks. // collection write locks.
type CollectionContext interface { type CollectionContext interface {
// Sends all known resources // All sends all known resources
All(func(gc.Node)) All(func(gc.Node))
// Active sends all active resources // Active sends all active resources

View File

@ -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 // 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. // that matches multiple CIDRs counts against all limits.
Limit(cidr string, egress, ingress *resource.Quantity) error 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 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 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 ReconcileCIDR(cidr string, egress, ingress *resource.Quantity) error
// GetCIDRs returns the set of CIDRs that are being managed by this shaper // GetCIDRs returns the set of CIDRs that are being managed by this shaper
GetCIDRs() ([]string, error) GetCIDRs() ([]string, error)

View File

@ -45,7 +45,7 @@ import (
// PortForwarder knows how to forward content from a data stream to/from a port // PortForwarder knows how to forward content from a data stream to/from a port
// in a pod. // in a pod.
type PortForwarder interface { 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 PortForward(name string, uid types.UID, port int32, stream io.ReadWriteCloser) error
} }

View File

@ -136,7 +136,7 @@ func (fp *Failpoint) DelegatedEval() EvalFn {
return target.evaluate 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 { func (fp *Failpoint) Marshal() string {
fp.Lock() fp.Lock()
defer fp.Unlock() defer fp.Unlock()

View File

@ -40,7 +40,7 @@ func NewNetNS(baseDir string) (*NetNS, error) {
return &NetNS{path: hcnNamespace.Id}, nil 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) { func NewNetNSFromPID(baseDir string, pid uint32) (*NetNS, error) {
return nil, errNotImplementedOnWindows return nil, errNotImplementedOnWindows
} }

View File

@ -31,13 +31,13 @@ import (
// Domain implements the functions the generic NRI interface needs to // Domain implements the functions the generic NRI interface needs to
// deal with pods and containers from a particular containerd namespace. // deal with pods and containers from a particular containerd namespace.
type Domain interface { type Domain interface {
// GetName() returns the containerd namespace for this domain. // GetName returns the containerd namespace for this domain.
GetName() string GetName() string
// ListPodSandboxes list all pods in this namespace. // ListPodSandboxes lists all pods in this namespace.
ListPodSandboxes() []PodSandbox ListPodSandboxes() []PodSandbox
// ListContainer list all containers in this namespace. // ListContainers lists all containers in this namespace.
ListContainers() []Container ListContainers() []Container
// GetPodSandbox returns the pod for the given ID. // GetPodSandbox returns the pod for the given ID.

View File

@ -80,7 +80,7 @@ type API interface {
// NotifyContainerExit handles the exit event of a container. // NotifyContainerExit handles the exit event of a container.
NotifyContainerExit(context.Context, PodSandbox, 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 RemoveContainer(context.Context, PodSandbox, Container) error
} }

View File

@ -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 // reference in the annotation or check full references annotations against and
// additionally may add a digest reference. Images with no references resolved // additionally may add a digest reference. Images with no references resolved
// from matching annotations may be stored by digest. // from matching annotations may be stored by digest.

View File

@ -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) { func (j *ProgressTracker) AddChildren(desc ocispec.Descriptor, children []ocispec.Descriptor) {
if j == nil || len(children) == 0 { if j == nil || len(children) == 0 {
return return

View File

@ -42,7 +42,7 @@ func init() {
plugins.Register(&transfertypes.OCIRegistry{}, &OCIRegistry{}) 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 { func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry {
// Create an authorizer // Create an authorizer
var aopts []docker.AuthorizerOpt var aopts []docker.AuthorizerOpt

View File

@ -78,7 +78,7 @@ const (
EventPlugin Type = "io.containerd.event.v1" EventPlugin Type = "io.containerd.event.v1"
// LeasePlugin implements lease manager // LeasePlugin implements lease manager
LeasePlugin Type = "io.containerd.lease.v1" LeasePlugin Type = "io.containerd.lease.v1"
// Streaming implements a stream manager // StreamingPlugin implements a stream manager
StreamingPlugin Type = "io.containerd.streaming.v1" StreamingPlugin Type = "io.containerd.streaming.v1"
// TracingProcessorPlugin implements a open telemetry span processor // TracingProcessorPlugin implements a open telemetry span processor
TracingProcessorPlugin Type = "io.containerd.tracing.processor.v1" TracingProcessorPlugin Type = "io.containerd.tracing.processor.v1"

View File

@ -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) { func MarshalAnyToProto(from interface{}) (*anypb.Any, error) {
any, err := typeurl.MarshalAny(from) any, err := typeurl.MarshalAny(from)
if err != nil { if err != nil {

View File

@ -49,7 +49,7 @@ type byScheme []Challenge
func (bs byScheme) Len() int { return len(bs) } func (bs byScheme) Len() int { return len(bs) }
func (bs byScheme) Swap(i, j int) { bs[i], bs[j] = bs[j], bs[i] } 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 } func (bs byScheme) Less(i, j int) bool { return bs[i].Scheme > bs[j].Scheme }
// Octet types from RFC 2616. // Octet types from RFC 2616.

View File

@ -33,6 +33,6 @@ const (
DiffService = "diff-service" DiffService = "diff-service"
// IntrospectionService is the id of introspection service // IntrospectionService is the id of introspection service
IntrospectionService = "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" StreamingService = "streaming-service"
) )