Skip to content

Commit

Permalink
fix: correct some typos in Nydusify
Browse files Browse the repository at this point in the history
Signed-off-by: BruceAko <chongzhi@hust.edu.cn>
  • Loading branch information
BruceAko authored and imeoer committed Jul 9, 2024
1 parent 455c856 commit da5d423
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contrib/nydusify/cmd/nydusify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestGetTargetReference(t *testing.T) {
require.Equal(t, "testTarget", target)
}

func TestGetCacheReferencet(t *testing.T) {
func TestGetCacheReference(t *testing.T) {
app := &cli.App{
Flags: []cli.Flag{
&cli.StringFlag{
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
// Backend transfers artifacts generated during image conversion to a backend storage such as:
// 1. registry: complying to OCI distribution specification, push blob file
// to registry and use the registry as a storage.
// 2. oss: A object storage backend, which uses its SDK to transer blob file.
// 2. oss: A object storage backend, which uses its SDK to transfer blob file.
type Backend interface {
// TODO: Hopefully, we can pass `Layer` struct in, thus to be able to cook both
// file handle and file path.
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/build/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (workflow *Workflow) Build(

// Rename the newly generated blob to its sha256 digest.
// Because the flow will use the basename as the blob object to be pushed to registry.
// When `digestedBlobPath` is void, this layer's bootsrap can be pushed meanwhile not for blob
// When `digestedBlobPath` is void, this layer's bootstrap can be pushed meanwhile not for blob
if digestedBlobPath != "" {
err = os.Rename(blobPath, digestedBlobPath)
// It's possible that two blobs that are built with the same digest.
Expand Down
6 changes: 3 additions & 3 deletions contrib/nydusify/pkg/committer/diff/archive/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
)

// ChangeWriter provides tar stream from filesystem change information.
// The privided tar stream is styled as an OCI layer. Change information
// The provided tar stream is styled as an OCI layer. Change information
// (add/modify/delete/unmodified) for each file needs to be passed to this
// writer through HandleChange method.
//
Expand All @@ -71,7 +71,7 @@ type ChangeWriter struct {
type ChangeWriterOpt func(cw *ChangeWriter)

// NewChangeWriter returns ChangeWriter that writes tar stream of the source directory
// to the privided writer. Change information (add/modify/delete/unmodified) for each
// to the provided writer. Change information (add/modify/delete/unmodified) for each
// file needs to be passed through HandleChange method.
func NewChangeWriter(w io.Writer, source string, opts ...ChangeWriterOpt) *ChangeWriter {
cw := &ChangeWriter{
Expand Down Expand Up @@ -211,7 +211,7 @@ func (cw *ChangeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e
}
defer file.Close()

// HACK (imeoer): disply file path in error message.
// HACK (imeoer): display file path in error message.
n, err := copyBuffered(context.TODO(), cw.tw, file)
if err != nil {
return fmt.Errorf("failed to copy file %s: %w", p, err)
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/committer/diff/overlay_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func checkOpaque(upperdir string, path string, base string, f os.FileInfo) (isOp
if !os.IsNotExist(err) {
return false, errors.Wrapf(err, "failed to lstat")
}
// This file doesn't exist even in the base dir. We don't need treat this as an opaque.
// This file doesn't exist even in the base dir. We don't need to treat this as an opaque.
return false, nil
}
return true, nil
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/committer/nsenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Config struct {
WorkingDirectory string // Set the working directory, default to target process working directory
}

// Execute executs the givne command with a default background context
// Execute executes the given command with a default background context
func (c *Config) Execute(writer io.Writer, program string, args ...string) (string, error) {
return c.ExecuteContext(context.Background(), writer, program, args...)
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/packer/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (p *Packer) Pack(_ context.Context, req PackRequest) (PackResult, error) {
}, nil
}

// ensureNydusImagePath ensure nydus-image binary exists, the Precedence for nydus-image is as follow
// ensureNydusImagePath ensure nydus-image binary exists, the Precedence for nydus-image is as follows
// 1. if nydusImagePath is specified try nydusImagePath first
// 2. if nydusImagePath not exists, try to find nydus-image from $PATH
// 3. return ErrNydusImageBinaryNotFound
Expand Down
6 changes: 3 additions & 3 deletions contrib/nydusify/pkg/provider/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newDefaultClient(skipTLSVerify bool) *http.Client {
// username, password and error.
type withCredentialFunc = func(string) (string, string, error)

// withRemote creates an remote instance, it uses the implemention of containerd
// withRemote creates a remote instance, it uses the implementation of containerd
// docker remote to access image from remote registry.
func withRemote(ref string, insecure bool, credFunc withCredentialFunc) (*remote.Remote, error) {
resolverFunc := func(retryWithHTTP bool) remotes.Resolver {
Expand All @@ -72,7 +72,7 @@ func withRemote(ref string, insecure bool, credFunc withCredentialFunc) (*remote
return remote.New(ref, resolverFunc)
}

// DefaultRemote creates an remote instance, it attempts to read docker auth config
// DefaultRemote creates a remote instance, it attempts to read docker auth config
// file `$DOCKER_CONFIG/config.json` to communicate with remote registry, `$DOCKER_CONFIG`
// defaults to `~/.docker`.
func DefaultRemote(ref string, insecure bool) (*remote.Remote, error) {
Expand All @@ -94,7 +94,7 @@ func DefaultRemote(ref string, insecure bool) (*remote.Remote, error) {
})
}

// DefaultRemoteWithAuth creates an remote instance, it parses base64 encoded auth string
// DefaultRemoteWithAuth creates a remote instance, it parses base64 encoded auth string
// to communicate with remote registry.
func DefaultRemoteWithAuth(ref string, insecure bool, auth string) (*remote.Remote, error) {
return withRemote(ref, insecure, func(_ string) (string, string, error) {
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func addToArchive(tw *tar.Writer, filename string) error {
return err
}
// Use full path as name (FileInfoHeader only takes the basename)
// If we don't do this the directory strucuture would
// If we don't do this the directory structure would
// not be preserved
// https://golang.org/src/archive/tar/common.go?#L626
header.Name = filename
Expand Down
2 changes: 1 addition & 1 deletion contrib/nydusify/pkg/viewer/viewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (fsViewer *FsViewer) view(ctx context.Context) error {
return errors.Wrap(err, "failed to pull Nydus image bootstrap")
}

// Adjust nydused parameters(DigestValidate) according to rafs format
// Adjust nydusd parameters(DigestValidate) according to rafs format
nydusManifest := parser.FindNydusBootstrapDesc(&targetParsed.NydusImage.Manifest)
if nydusManifest != nil {
v := utils.GetNydusFsVersionOrDefault(nydusManifest.Annotations, utils.V5)
Expand Down

0 comments on commit da5d423

Please sign in to comment.