| @@ -13,6 +13,7 @@ linters: | |||||||
|     - unconvert |     - unconvert | ||||||
|     - unused |     - unused | ||||||
|     - vet |     - vet | ||||||
|  |     - dupword # Checks for duplicate words in the source code | ||||||
|   disable: |   disable: | ||||||
|     - errcheck |     - errcheck | ||||||
|  |  | ||||||
| @@ -34,7 +35,7 @@ linters-settings: | |||||||
|     # The following issues surfaced when `gosec` linter |     # The following issues surfaced when `gosec` linter | ||||||
|     # was enabled. They are temporarily excluded to unblock |     # was enabled. They are temporarily excluded to unblock | ||||||
|     # the existing workflow, but still to be addressed by |     # the existing workflow, but still to be addressed by | ||||||
|     # by future works. |     # future works. | ||||||
|     excludes: |     excludes: | ||||||
|       - G204 |       - G204 | ||||||
|       - G305 |       - G305 | ||||||
|   | |||||||
| @@ -240,7 +240,7 @@ func TestLogURIGenerator(t *testing.T) { | |||||||
| 		{ | 		{ | ||||||
| 			scheme: "binary", | 			scheme: "binary", | ||||||
| 			path:   "C:\\path\\to\\binary", | 			path:   "C:\\path\\to\\binary", | ||||||
| 			// NOTE: Windows paths should not be be parse-able outside of Windows: | 			// NOTE: Windows paths should not be parse-able outside of Windows: | ||||||
| 			err: "must be absolute", | 			err: "must be absolute", | ||||||
| 		}, | 		}, | ||||||
| 	}) | 	}) | ||||||
|   | |||||||
| @@ -204,6 +204,7 @@ type Stat struct { | |||||||
| } | } | ||||||
|  |  | ||||||
| func parseStat(data string) (stat Stat, err error) { | func parseStat(data string) (stat Stat, err error) { | ||||||
|  | 	//nolint:dupword | ||||||
| 	// From proc(5), field 2 could contain space and is inside `(` and `)`. | 	// From proc(5), field 2 could contain space and is inside `(` and `)`. | ||||||
| 	// The following is an example: | 	// The following is an example: | ||||||
| 	// 89653 (gunicorn: maste) S 89630 89653 89653 0 -1 4194560 29689 28896 0 3 146 32 76 19 20 0 1 0 2971844 52965376 3920 18446744073709551615 1 1 0 0 0 0 0 16781312 137447943 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | 	// 89653 (gunicorn: maste) S 89630 89653 89653 0 -1 4194560 29689 28896 0 3 146 32 76 19 20 0 1 0 2971844 52965376 3920 18446744073709551615 1 1 0 0 0 0 0 16781312 137447943 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||||||
|   | |||||||
| @@ -505,6 +505,7 @@ func (s *store) resumeStatus(ref string, total int64, digester digest.Digester) | |||||||
| 		return status, fmt.Errorf("provided total differs from status: %v != %v", total, status.Total) | 		return status, fmt.Errorf("provided total differs from status: %v != %v", total, status.Total) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	//nolint:dupword | ||||||
| 	// TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes | 	// TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes | ||||||
| 	fp, err := os.Open(data) | 	fp, err := os.Open(data) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ func TestGRPCRoundTrip(t *testing.T) { | |||||||
| 			input: ErrNotFound, | 			input: ErrNotFound, | ||||||
| 			cause: ErrNotFound, | 			cause: ErrNotFound, | ||||||
| 		}, | 		}, | ||||||
|  | 		//nolint:dupword | ||||||
| 		{ | 		{ | ||||||
| 			input: fmt.Errorf("test test test: %w", ErrFailedPrecondition), | 			input: fmt.Errorf("test test test: %w", ErrFailedPrecondition), | ||||||
| 			cause: ErrFailedPrecondition, | 			cause: ErrFailedPrecondition, | ||||||
|   | |||||||
| @@ -132,7 +132,7 @@ func copyDesc(desc ocispec.Descriptor) *ocispec.Descriptor { | |||||||
| 	return &descCopy | 	return &descCopy | ||||||
| } | } | ||||||
|  |  | ||||||
| // convertLayer converts image image layers if c.layerConvertFunc is set. | // convertLayer converts image layers if c.layerConvertFunc is set. | ||||||
| // | // | ||||||
| // c.layerConvertFunc can be nil, e.g., for converting Docker media types to OCI ones. | // c.layerConvertFunc can be nil, e.g., for converting Docker media types to OCI ones. | ||||||
| func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) { | func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) { | ||||||
|   | |||||||
| @@ -283,7 +283,7 @@ func (m *DB) RegisterMutationCallback(fn func(bool)) { | |||||||
| // RegisterCollectibleResource registers a resource type which can be | // RegisterCollectibleResource registers a resource type which can be | ||||||
| // referenced by metadata resources and garbage collected. | // referenced by metadata resources and garbage collected. | ||||||
| // Collectible Resources are useful ephemeral resources which need to | // Collectible Resources are useful ephemeral resources which need to | ||||||
| // to be tracked by go away after reboot or process restart. | // be tracked by go away after reboot or process restart. | ||||||
| // | // | ||||||
| // A few limitations to consider: | // A few limitations to consider: | ||||||
| //   - Collectible Resources cannot reference other resources. | //   - Collectible Resources cannot reference other resources. | ||||||
|   | |||||||
| @@ -24,6 +24,7 @@ import ( | |||||||
| 	"github.com/stretchr/testify/assert" | 	"github.com/stretchr/testify/assert" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | //nolint:dupword | ||||||
| const procPIDStatus = `Name:   cat | const procPIDStatus = `Name:   cat | ||||||
| Umask:  0022 | Umask:  0022 | ||||||
| State:  R (running) | State:  R (running) | ||||||
|   | |||||||
| @@ -366,7 +366,7 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe | |||||||
| } | } | ||||||
|  |  | ||||||
| // Overrides the default snapshotter if Snapshotter is set for this runtime. | // Overrides the default snapshotter if Snapshotter is set for this runtime. | ||||||
| // See See https://github.com/containerd/containerd/issues/6657 | // See https://github.com/containerd/containerd/issues/6657 | ||||||
| func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | ||||||
| 	if ociRuntime.Snapshotter == "" { | 	if ociRuntime.Snapshotter == "" { | ||||||
| 		return c.config.ContainerdConfig.Snapshotter | 		return c.config.ContainerdConfig.Snapshotter | ||||||
|   | |||||||
| @@ -1537,7 +1537,7 @@ func (in *instrumentedService) UpdateRuntimeConfig(ctx context.Context, r *runti | |||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | ||||||
| 		} else { | 		} else { | ||||||
| 			log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully") | 			log.G(ctx).Debug("UpdateRuntimeConfig returns successfully") | ||||||
| 		} | 		} | ||||||
| 	}() | 	}() | ||||||
| 	res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r) | 	res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r) | ||||||
| @@ -1553,7 +1553,7 @@ func (in *instrumentedAlphaService) UpdateRuntimeConfig(ctx context.Context, r * | |||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | ||||||
| 		} else { | 		} else { | ||||||
| 			log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully") | 			log.G(ctx).Debug("UpdateRuntimeConfig returns successfully") | ||||||
| 		} | 		} | ||||||
| 	}() | 	}() | ||||||
| 	// converts request and response for earlier CRI version to call and get response from the current version | 	// converts request and response for earlier CRI version to call and get response from the current version | ||||||
|   | |||||||
| @@ -216,7 +216,7 @@ func (c *Controller) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe | |||||||
| } | } | ||||||
|  |  | ||||||
| // Overrides the default snapshotter if Snapshotter is set for this runtime. | // Overrides the default snapshotter if Snapshotter is set for this runtime. | ||||||
| // See See https://github.com/containerd/containerd/issues/6657 | // See https://github.com/containerd/containerd/issues/6657 | ||||||
| func (c *Controller) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | func (c *Controller) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | ||||||
| 	if ociRuntime.Snapshotter == "" { | 	if ociRuntime.Snapshotter == "" { | ||||||
| 		return c.config.ContainerdConfig.Snapshotter | 		return c.config.ContainerdConfig.Snapshotter | ||||||
|   | |||||||
| @@ -377,7 +377,7 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe | |||||||
| } | } | ||||||
|  |  | ||||||
| // Overrides the default snapshotter if Snapshotter is set for this runtime. | // Overrides the default snapshotter if Snapshotter is set for this runtime. | ||||||
| // See See https://github.com/containerd/containerd/issues/6657 | // See https://github.com/containerd/containerd/issues/6657 | ||||||
| func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string { | ||||||
| 	if ociRuntime.Snapshotter == "" { | 	if ociRuntime.Snapshotter == "" { | ||||||
| 		return c.config.ContainerdConfig.Snapshotter | 		return c.config.ContainerdConfig.Snapshotter | ||||||
|   | |||||||
| @@ -1537,7 +1537,7 @@ func (in *instrumentedService) UpdateRuntimeConfig(ctx context.Context, r *runti | |||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | ||||||
| 		} else { | 		} else { | ||||||
| 			log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully") | 			log.G(ctx).Debug("UpdateRuntimeConfig returns successfully") | ||||||
| 		} | 		} | ||||||
| 	}() | 	}() | ||||||
| 	res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r) | 	res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r) | ||||||
| @@ -1553,7 +1553,7 @@ func (in *instrumentedAlphaService) UpdateRuntimeConfig(ctx context.Context, r * | |||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | 			log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed") | ||||||
| 		} else { | 		} else { | ||||||
| 			log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully") | 			log.G(ctx).Debug("UpdateRuntimeConfig returns successfully") | ||||||
| 		} | 		} | ||||||
| 	}() | 	}() | ||||||
| 	// converts request and response for earlier CRI version to call and get response from the current version | 	// converts request and response for earlier CRI version to call and get response from the current version | ||||||
|   | |||||||
| @@ -119,7 +119,7 @@ func splitDockerDomain(name string) (domain, remainder string) { | |||||||
| } | } | ||||||
|  |  | ||||||
| // familiarizeName returns a shortened version of the name familiar | // familiarizeName returns a shortened version of the name familiar | ||||||
| // to to the Docker UI. Familiar names have the default domain | // to the Docker UI. Familiar names have the default domain | ||||||
| // "docker.io" and "library/" repository prefix removed. | // "docker.io" and "library/" repository prefix removed. | ||||||
| // For example, "docker.io/library/redis" will have the familiar | // For example, "docker.io/library/redis" will have the familiar | ||||||
| // name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". | // name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Akihiro Suda
					Akihiro Suda