mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Simplify gorepomod manager
This commit is contained in:
@@ -55,15 +55,12 @@ func (mgr *Manager) Pin(
|
||||
|
||||
func (mgr *Manager) UnPin(
|
||||
doIt bool, target misc.LaModule, conditional misc.LaModule) error {
|
||||
if conditional == nil {
|
||||
conditional = target
|
||||
}
|
||||
return mgr.modules.Apply(func(m misc.LaModule) error {
|
||||
if conditional == nil {
|
||||
if yes, oldVersion := m.DependsOn(target); yes {
|
||||
return edit.New(m, doIt).UnPin(target, oldVersion)
|
||||
}
|
||||
} else {
|
||||
if yes, oldVersion := m.DependsOn(conditional); yes {
|
||||
return edit.New(m, doIt).UnPin(target, oldVersion)
|
||||
}
|
||||
if yes, oldVersion := m.DependsOn(conditional); yes {
|
||||
return edit.New(m, doIt).UnPin(target, oldVersion)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user