diff --git a/cmd/mirror.go b/cmd/mirror.go index c4f7ac1e62..2616fce9f1 100644 --- a/cmd/mirror.go +++ b/cmd/mirror.go @@ -489,41 +489,6 @@ func newMirrorPublishCmd() *cobra.Command { return cmd } -func doPublish( - component, version, entry, desc string, - publishInfo *model.PublishInfo, - hashes map[string]string, length int64, - standalone, hidden bool, - privPath, goos, goarch string, - flagSet set.StringSet, -) error { - env := environment.GlobalEnv() - m, err := env.V1Repository().FetchComponentManifest(component, true) - if err != nil { - if errors.Cause(err) == repository.ErrUnknownComponent { - fmt.Printf("Creating component %s\n", component) - publishInfo.Stand = &standalone - publishInfo.Hide = &hidden - } else { - return err - } - } else if flagSet.Exist("standalone") || flagSet.Exist("hide") { - fmt.Println("This is not a new component, --standalone and --hide flag will be omitted") - } - - m = repository.UpdateManifestForPublish(m, component, version, entry, goos, goarch, desc, v1manifest.FileHash{ - Hashes: hashes, - Length: uint(length), - }) - - manifest, err := sign(privPath, m) - if err != nil { - return err - } - - return env.V1Repository().Mirror().Publish(manifest, publishInfo) -} - func validatePlatform(goos, goarch string) error { // Only support any/any, don't support linux/any, any/amd64 .etc. if goos == "any" && goarch == "any" { diff --git a/components/playground/instance/proc_attr_default.go b/components/playground/instance/proc_attr_default.go index 01d4a34878..6c22e6e928 100644 --- a/components/playground/instance/proc_attr_default.go +++ b/components/playground/instance/proc_attr_default.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +//go:build !linux // +build !linux package instance diff --git a/components/playground/instance/proc_attr_linux.go b/components/playground/instance/proc_attr_linux.go index 2ba53e8362..660ab968b7 100644 --- a/components/playground/instance/proc_attr_linux.go +++ b/components/playground/instance/proc_attr_linux.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +//go:build linux // +build linux package instance diff --git a/pkg/cluster/embed/pkged.go b/pkg/cluster/embed/pkged.go index 99b965d231..31ef418502 100644 --- a/pkg/cluster/embed/pkged.go +++ b/pkg/cluster/embed/pkged.go @@ -1,5 +1,6 @@ // Code generated by pkger; DO NOT EDIT. +//go:build !skippkger // +build !skippkger package embed diff --git a/pkg/environment/env.go b/pkg/environment/env.go index 96c99ae45d..dde59594ce 100644 --- a/pkg/environment/env.go +++ b/pkg/environment/env.go @@ -24,7 +24,6 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/tiup/pkg/localdata" "github.com/pingcap/tiup/pkg/repository" - "github.com/pingcap/tiup/pkg/repository/v0manifest" "github.com/pingcap/tiup/pkg/repository/v1manifest" pkgver "github.com/pingcap/tiup/pkg/repository/version" "github.com/pingcap/tiup/pkg/verbose" @@ -301,18 +300,6 @@ func (env *Environment) DownloadComponentIfMissing(component string, ver pkgver. return ver, nil } -// latestManifest returns the latest v0 component manifest and refresh the local cache -func (env *Environment) latestManifest() (*v0manifest.ComponentManifest, error) { - manifest, err := env.repo.Manifest() - if err != nil { - return nil, err - } - if err := env.profile.SaveManifest(manifest); err != nil { - return nil, err - } - return manifest, err -} - // GetComponentInstalledVersion return the installed version of component. func (env *Environment) GetComponentInstalledVersion(component string, version pkgver.Version) (pkgver.Version, error) { return env.profile.GetComponentInstalledVersion(component, version) diff --git a/pkg/repository/clone_mirror.go b/pkg/repository/clone_mirror.go index c2fcf3fbc2..f5bf7e6a64 100644 --- a/pkg/repository/clone_mirror.go +++ b/pkg/repository/clone_mirror.go @@ -304,8 +304,8 @@ func cloneComponents(repo *V1Repository, continue } } - if _, err := repo.FetchComponentManifest(name, false); err != nil || versionItem.Yanked { - // The component or the version is yanked, skip download binary + if _, err := repo.FetchComponentManifest(name, false); err != nil || versionItem.Yanked { + // The component or the version is yanked, skip download binary continue } if err := download(targetDir, tmpDir, repo, &versionItem); err != nil {