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