From dfc61a7783c5180492ab26af907b7f0b2c154592 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 18 Nov 2024 11:55:46 +0800 Subject: [PATCH] fix: fix typo Signed-off-by: zongz --- pkg/client/add_test.go | 8 ++++---- pkg/client/client.go | 14 +++++++------- pkg/client/deperated.go | 4 ++-- pkg/downloader/downloader.go | 2 +- pkg/oci/oci.go | 2 +- pkg/visitor/visitor.go | 2 +- .../kpm_pull_with_oci_url/test_suite.stdout | 2 +- .../kpm_pull_with_pkg_name/test_suite.stdout | 2 +- .../pull_private_pkg/test_suite.stdout | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pkg/client/add_test.go b/pkg/client/add_test.go index 4ac36139..fa6c5ff2 100644 --- a/pkg/client/add_test.go +++ b/pkg/client/add_test.go @@ -95,7 +95,7 @@ func TestAddWithModSpec(t *testing.T) { name: "TestAddOciWithNoTag", pkgSubPath: "no_oci_ref", sourceUrl: "oci://ghcr.io/kcl-lang/helloworld", - msg: "the lastest version '0.1.4' will be downloaded" + + msg: "the latest version '0.1.4' will be downloaded" + "downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'" + "adding dependency 'helloworld'" + "add dependency 'helloworld:0.1.4' successfully", @@ -104,7 +104,7 @@ func TestAddWithModSpec(t *testing.T) { name: "TestAddGitWithNoTag", pkgSubPath: "no_git_ref", sourceUrl: "git://github.com/kcl-lang/flask-demo-kcl-manifests.git", - msg: "the lastest version 'ade147b' will be downloaded" + + msg: "the latest version 'ade147b' will be downloaded" + "cloning 'https://github.com/kcl-lang/flask-demo-kcl-manifests.git' with commit 'ade147b'" + "adding dependency 'flask_manifests'" + "add dependency 'flask_manifests:0.0.1' successfully", @@ -306,7 +306,7 @@ func TestAddWithOnlyModSpec(t *testing.T) { name: "TestAddWithOnlyModSpecButNoVersion", testDir: "add_with_mod_spec", pkgSubDir: "spec_only_no_ver", - msg: "the lastest version '0.1.4' will be downloaded" + + msg: "the latest version '0.1.4' will be downloaded" + "downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'" + "adding dependency 'helloworld'" + "add dependency 'helloworld:0.1.4' successfully", @@ -461,7 +461,7 @@ func TestAddRenameWithNoSpec(t *testing.T) { ) assert.Equal(t, - "the lastest version '0.1.4' will be downloaded"+ + "the latest version '0.1.4' will be downloaded"+ "downloading 'kcl-lang/helloworld:0.1.4' from 'ghcr.io/kcl-lang/helloworld:0.1.4'"+ "adding dependency 'helloworld'"+ "add dependency 'helloworld:0.1.4' successfully", diff --git a/pkg/client/client.go b/pkg/client/client.go index cbedfb4b..1454ec3d 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -282,7 +282,7 @@ func (c *KpmClient) resolvePkgDeps(kclPkg *pkg.KclPkg, lockDeps *pkg.Dependencie // If not under the mode of '--no_sum_check', // all the dependencies in kcl.mod.lock are the dependencies of the current package. // - // alian the dependencies between kcl.mod and kcl.mod.lock + // align the dependencies between kcl.mod and kcl.mod.lock // clean the dependencies in kcl.mod.lock which not in kcl.mod // clean the dependencies in kcl.mod.lock and kcl.mod which have different version for _, name := range kclPkg.Dependencies.Deps.Keys() { @@ -845,7 +845,7 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (* if dep.Source.Oci != nil { ociSource = dep.Source.Oci } - // Select the latest tag, if the tag, the user inputed, is empty. + // Select the latest tag, if the tag, the user inputted, is empty. if ociSource.Tag == "" || ociSource.Tag == constants.LATEST { latestTag, err := c.AcquireTheLatestOciVersion(*ociSource) if err != nil { @@ -1044,7 +1044,7 @@ func (c *KpmClient) DownloadPkgFromOci(dep *downloader.Oci, localPath string) (* } ociClient.SetLogWriter(c.logWriter) - // Select the latest tag, if the tag, the user inputed, is empty. + // Select the latest tag, if the tag, the user inputted, is empty. var tagSelected string if len(dep.Tag) == 0 { tagSelected, err = ociClient.TheLatestTag() @@ -1053,7 +1053,7 @@ func (c *KpmClient) DownloadPkgFromOci(dep *downloader.Oci, localPath string) (* } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be added", tagSelected), + fmt.Sprintf("the latest version '%s' will be added", tagSelected), c.logWriter, ) @@ -1241,7 +1241,7 @@ func (c *KpmClient) LogoutOci(hostname string) error { return nil } -// ParseOciRef will parser ':' into an 'OciOptions'. +// ParseOciRef will parse ':' into an 'OciOptions'. func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error) { oci_address := strings.Split(ociRef, constants.OCI_SEPARATOR) if len(oci_address) == 1 { @@ -1260,7 +1260,7 @@ func (c *KpmClient) ParseOciRef(ociRef string) (*opt.OciOptions, error) { } } -// ParseOciOptionFromString will parser ':' into an 'OciOptions' with an OCI registry. +// ParseOciOptionFromString will parse ':' into an 'OciOptions' with an OCI registry. // the default OCI registry is 'docker.io'. // if the 'ociUrl' is only '', ParseOciOptionFromString will take 'latest' as the default tag. func (c *KpmClient) ParseOciOptionFromString(oci string, tag string) (*opt.OciOptions, error) { @@ -1522,7 +1522,7 @@ func (c *KpmClient) pullTarFromOci(localPath string, ociOpts *opt.OciOptions) er return err } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected), + fmt.Sprintf("the latest version '%s' will be pulled", tagSelected), c.logWriter, ) } else { diff --git a/pkg/client/deperated.go b/pkg/client/deperated.go index 01c89d52..20b4ba26 100644 --- a/pkg/client/deperated.go +++ b/pkg/client/deperated.go @@ -187,7 +187,7 @@ func (c *KpmClient) DownloadFromOci(dep *downloader.Oci, localPath string) (stri return "", err } ociClient.SetLogWriter(c.logWriter) - // Select the latest tag, if the tag, the user inputed, is empty. + // Select the latest tag, if the tag, the user inputted, is empty. var tagSelected string if len(dep.Tag) == 0 { tagSelected, err = ociClient.TheLatestTag() @@ -196,7 +196,7 @@ func (c *KpmClient) DownloadFromOci(dep *downloader.Oci, localPath string) (stri } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be added", tagSelected), + fmt.Sprintf("the latest version '%s' will be added", tagSelected), c.logWriter, ) diff --git a/pkg/downloader/downloader.go b/pkg/downloader/downloader.go index 76d4bad0..64016bfc 100644 --- a/pkg/downloader/downloader.go +++ b/pkg/downloader/downloader.go @@ -400,7 +400,7 @@ func (d *OciDownloader) Download(opts *DownloadOptions) error { } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be downloaded", tagSelected), + fmt.Sprintf("the latest version '%s' will be downloaded", tagSelected), opts.LogWriter, ) diff --git a/pkg/oci/oci.go b/pkg/oci/oci.go index 80c76a7d..e7e6dd0e 100644 --- a/pkg/oci/oci.go +++ b/pkg/oci/oci.go @@ -435,7 +435,7 @@ func Pull(localPath, hostName, repoName, tag string, settings *settings.Settings return err } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected), + fmt.Sprintf("the latest version '%s' will be pulled", tagSelected), os.Stdout, ) } else { diff --git a/pkg/visitor/visitor.go b/pkg/visitor/visitor.go index 1083a101..7b005f97 100644 --- a/pkg/visitor/visitor.go +++ b/pkg/visitor/visitor.go @@ -179,7 +179,7 @@ func (rv *RemoteVisitor) Visit(s *downloader.Source, v visitFunc) error { } reporter.ReportMsgTo( - fmt.Sprintf("the lastest version '%s' will be downloaded", latest), + fmt.Sprintf("the latest version '%s' will be downloaded", latest), rv.LogWriter, ) diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout index 88624647..2ba91f02 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout @@ -1,4 +1,4 @@ start to pull 'oci://localhost:5001/test/k8s' -the lastest version '1.31.2' will be pulled +the latest version '1.31.2' will be pulled pulling '/test/k8s:1.31.2' from 'localhost:5001/test/k8s' pulled 'oci://localhost:5001/test/k8s' in '/localhost:5001/test/k8s' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout index 0a80e702..e0d56638 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout @@ -1,4 +1,4 @@ start to pull 'k8s' -the lastest version '1.31.2' will be pulled +the latest version '1.31.2' will be pulled pulling 'test/k8s:1.31.2' from 'localhost:5001/test/k8s' pulled 'k8s' in '/localhost:5001/test/k8s' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/pull_private_pkg/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/pull_private_pkg/test_suite.stdout index 6233a536..e4629312 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/pull_private_pkg/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/pull_private_pkg/test_suite.stdout @@ -1,4 +1,4 @@ start to pull 'oci://localhost:5001/test/helloworld' -the lastest version '0.1.2' will be pulled +the latest version '0.1.2' will be pulled pulling '/test/helloworld:0.1.2' from 'localhost:5001/test/helloworld' pulled 'oci://localhost:5001/test/helloworld' in '/localhost:5001/test/helloworld' successfully \ No newline at end of file