Skip to content

Commit

Permalink
Check for empty list of binding
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <pvala@redhat.com>
  • Loading branch information
valaparthvi committed Dec 6, 2022
1 parent 9cda1a3 commit c332ad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/binding/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (o *BindingClient) RemoveBinding(servicebindingName string, obj parser.Devf
var unstructuredObjs []unstructured.Unstructured
// Parse the K8s manifest
unstructuredObjs, err = libdevfile.GetK8sComponentAsUnstructuredList(obj, component.Name, filepath.Dir(obj.Ctx.GetAbsPath()), devfilefs.DefaultFs{})
if err != nil {
if err != nil || len(unstructuredObjs) == 0 {
continue
}
// We default to the first object in the list because as far as ServiceBinding is concerned,
Expand Down

0 comments on commit c332ad5

Please sign in to comment.