Skip to content

Commit a113818

Browse files
authored
Merge pull request #5180 from dmcgowan/lint-enforce-comments
Fix exported comments enforcer in CI
2 parents fad66f9 + 8cf669c commit a113818

32 files changed

Lines changed: 148 additions & 46 deletions

File tree

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ linters:
1414
disable:
1515
- errcheck
1616

17+
issues:
18+
include:
19+
- EXC0002
20+
1721
run:
1822
timeout: 3m
1923
skip-dirs:

client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,12 @@ func (c *Client) Version(ctx context.Context) (Version, error) {
720720
}, nil
721721
}
722722

723+
// ServerInfo represents the introspected server information
723724
type ServerInfo struct {
724725
UUID string
725726
}
726727

728+
// Server returns server information from the introspection service
727729
func (c *Client) Server(ctx context.Context) (ServerInfo, error) {
728730
c.connMu.Lock()
729731
if c.conn == nil {
@@ -789,6 +791,8 @@ func CheckRuntime(current, expected string) bool {
789791
return true
790792
}
791793

794+
// GetSnapshotterSupportedPlatforms returns a platform matchers which represents the
795+
// supported platforms for the given snapshotters
792796
func (c *Client) GetSnapshotterSupportedPlatforms(ctx context.Context, snapshotterName string) (platforms.MatchComparer, error) {
793797
filters := []string{fmt.Sprintf("type==%s, id==%s", plugin.SnapshotPlugin, snapshotterName)}
794798
in := c.IntrospectionService()

cmd/ctr/commands/content/fetch.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ func Fetch(ctx context.Context, client *containerd.Client, ref string, config *F
198198
return img, nil
199199
}
200200

201+
// ShowProgress continuously updates the output with job progress
202+
// by checking status in the content store.
201203
func ShowProgress(ctx context.Context, ongoing *Jobs, cs content.Store, out io.Writer) {
202204
var (
203205
ticker = time.NewTicker(100 * time.Millisecond)
@@ -328,13 +330,15 @@ type Jobs struct {
328330
resolved bool
329331
}
330332

333+
// NewJobs creates a new instance of the job status tracker
331334
func NewJobs(name string) *Jobs {
332335
return &Jobs{
333336
name: name,
334337
added: map[digest.Digest]struct{}{},
335338
}
336339
}
337340

341+
// Add adds a descriptor to be tracked
338342
func (j *Jobs) Add(desc ocispec.Descriptor) {
339343
j.mu.Lock()
340344
defer j.mu.Unlock()
@@ -347,6 +351,7 @@ func (j *Jobs) Add(desc ocispec.Descriptor) {
347351
j.added[desc.Digest] = struct{}{}
348352
}
349353

354+
// Jobs returns a list of all tracked descriptors
350355
func (j *Jobs) Jobs() []ocispec.Descriptor {
351356
j.mu.Lock()
352357
defer j.mu.Unlock()
@@ -355,6 +360,7 @@ func (j *Jobs) Jobs() []ocispec.Descriptor {
355360
return append(descs, j.descs...)
356361
}
357362

363+
// IsResolved checks whether a descriptor has been resolved
358364
func (j *Jobs) IsResolved() bool {
359365
j.mu.Lock()
360366
defer j.mu.Unlock()

cmd/ctr/commands/oci/oci.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/containerd/containerd/oci"
2626
)
2727

28+
// Command is the parent for all OCI related tools under 'oci'
2829
var Command = cli.Command{
2930
Name: "oci",
3031
Usage: "OCI tools",

content/adaptor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/containerd/containerd/filters"
2323
)
2424

25-
// AdoptInfo returns `filters.Adaptor` that handles `content.Info`.
25+
// AdaptInfo returns `filters.Adaptor` that handles `content.Info`.
2626
func AdaptInfo(info Info) filters.Adaptor {
2727
return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
2828
if len(fieldpath) == 0 {

contrib/apparmor/apparmor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func LoadDefaultProfile(name string) error {
8181
return nil
8282
}
8383

84-
// DumpDefaultProfiles dumps the default profile with the given name.
84+
// DumpDefaultProfile dumps the default profile with the given name.
8585
func DumpDefaultProfile(name string) (string, error) {
8686
p, err := loadData(name)
8787
if err != nil {

diff/stream.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ func (c *compressedProcessor) Close() error {
168168
return c.rc.Close()
169169
}
170170

171+
// BinaryHandler creates a new stream processor handler which calls out to the given binary.
172+
// The id is used to identify the stream processor and allows the caller to send
173+
// payloads specific for that stream processor (i.e. decryption keys for decrypt stream processor).
174+
// The binary will be called for the provided mediaTypes and return the given media type.
171175
func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string, args, env []string) Handler {
172176
set := make(map[string]struct{}, len(mediaTypes))
173177
for _, m := range mediaTypes {

images/converter/default.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ func clearDockerV1DummyID(cfg DualConfig) (bool, error) {
348348
return modified, nil
349349
}
350350

351+
// ObjectWithMediaType represents an object with a MediaType field
351352
type ObjectWithMediaType struct {
352353
// MediaType appears on Docker manifests and manifest lists.
353354
// MediaType does not appear on OCI manifests and index

images/converter/uncompress/uncompress.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ func LayerConvertFunc(ctx context.Context, cs content.Store, desc ocispec.Descri
9191
return &newDesc, nil
9292
}
9393

94+
// IsUncompressedType returns whether the provided media type is considered
95+
// an uncompressed layer type
9496
func IsUncompressedType(mt string) bool {
9597
switch mt {
9698
case

integration/remote/remote_runtime.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ func (r *RuntimeService) ContainerStats(containerID string) (*runtimeapi.Contain
551551
return resp.GetStats(), nil
552552
}
553553

554+
// ListContainerStats lists all container stats given the provided filter
554555
func (r *RuntimeService) ListContainerStats(filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error) {
555556
klog.V(10).Infof("[RuntimeService] ListContainerStats (filter=%v)", filter)
556557
// Do not set timeout, because writable layer stats collection takes time.
@@ -570,6 +571,7 @@ func (r *RuntimeService) ListContainerStats(filter *runtimeapi.ContainerStatsFil
570571
return resp.GetStats(), nil
571572
}
572573

574+
// ReopenContainerLog reopens the container log for the given container ID
573575
func (r *RuntimeService) ReopenContainerLog(containerID string) error {
574576
klog.V(10).Infof("[RuntimeService] ReopenContainerLog (containerID=%v, timeout=%v)", containerID, r.timeout)
575577
ctx, cancel := getContextWithTimeout(r.timeout)

0 commit comments

Comments
 (0)