mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Feature/dependency pinning and update automation (#5451)
* * handle local flag * add managerfactory handling for local flag * add shortName handling for local flag * add dot git file handling for local flag * add tests * fix normal listing * add ParseGitRepository function, add viper, add testing for utils * add latest tag logic, add auto pinning and auto fetching * makke gorepomod list works with --local * make pinning works with local flag, enable auto update on fork and non-fork repo * fix: refactor to pass linter * refactor code and fix comments * edit README * refactor code to pass linting * refactor code * refactor code and enable patch branch label * ru add license * fbackward compatibility for unpin
This commit is contained in:
committed by
GitHub
parent
f3fedac429
commit
ab519fdc13
@@ -57,19 +57,19 @@ func (e *Editor) Tidy() error {
|
||||
func (e *Editor) Pin(target misc.LaModule, oldV, newV semver.SemVer) error {
|
||||
err := e.run(
|
||||
"edit",
|
||||
"-dropreplace="+target.ImportPath(),
|
||||
"-dropreplace="+target.ImportPath()+"@"+oldV.String(),
|
||||
"-require="+target.ImportPath()+"@"+newV.String(),
|
||||
"-dropreplace=sigs.k8s.io/kustomize/"+string(target.ShortName()),
|
||||
"-dropreplace=sigs.k8s.io/kustomize/"+string(target.ShortName())+"@"+oldV.String(),
|
||||
"-require=sigs.k8s.io/kustomize/"+string(target.ShortName())+"@"+newV.String(),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("%w", err)
|
||||
}
|
||||
return e.run("tidy")
|
||||
}
|
||||
|
||||
func (e *Editor) UnPin(target misc.LaModule, oldV semver.SemVer) error {
|
||||
var r strings.Builder
|
||||
r.WriteString(target.ImportPath())
|
||||
r.WriteString("sigs.k8s.io/kustomize/" + string(target.ShortName()))
|
||||
// Don't specify the old version.
|
||||
// r.WriteString("@")
|
||||
// r.WriteString(oldV.String())
|
||||
@@ -81,7 +81,7 @@ func (e *Editor) UnPin(target misc.LaModule, oldV semver.SemVer) error {
|
||||
"-replace="+r.String(),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("%w", err)
|
||||
}
|
||||
return e.run("tidy")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user