update: business logic respected for skipping object missing name

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
(cherry picked from commit b357bcae86)
pull/31940/head
Mujib Ahasan 8 months ago committed by Scott Rigby
parent f289d1605c
commit 5e093136f4
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155

@ -46,6 +46,10 @@ func requireAdoption(resources kube.ResourceList) (kube.ResourceList, error) {
return err
}
if info.Name == "" {
return nil
}
helper := resource.NewHelper(info.Client, info.Mapping)
_, err = helper.Get(info.Namespace, info.Name)
if err != nil {
@ -71,6 +75,10 @@ func existingResourceConflict(resources kube.ResourceList, releaseName, releaseN
return err
}
if info.Name == "" {
return nil
}
helper := resource.NewHelper(info.Client, info.Mapping)
existing, err := helper.Get(info.Namespace, info.Name)
if err != nil {

@ -29,9 +29,6 @@ func (r *ResourceList) Append(val *resource.Info) {
// Visit implements resource.Visitor. The visitor stops if fn returns an error.
func (r ResourceList) Visit(fn resource.VisitorFunc) error {
for _, i := range r {
if i.Name == "" {
continue
}
if err := fn(i, nil); err != nil {
return err
}

Loading…
Cancel
Save