Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions internal/cmd/cli/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ func pruneBundlesNotFoundInRepo(
) error {
filter := labels.SelectorFromSet(labels.Set{fleet.RepoLabel: repoName})
bundleList := &fleet.BundleList{}
err := c.List(ctx, bundleList, &client.ListOptions{LabelSelector: filter, Namespace: ns})
if err := c.List(ctx, bundleList, &client.ListOptions{LabelSelector: filter, Namespace: ns}); err != nil {
return err
}
Comment thread
0xavi0 marked this conversation as resolved.

for _, bundle := range bundleList.Items {
if _, ok := gitRepoBundlesMap[bundle.Name]; !ok {
Expand Down Expand Up @@ -404,13 +406,12 @@ func pruneBundlesNotFoundInRepo(
}
}
}
err = c.Delete(ctx, &bundle)
if err != nil {
if err := c.Delete(ctx, &bundle); err != nil {
return err
}
}
}
return err
return nil
}

// newBundle reads bundle data from a source and returns a bundle with the
Expand Down
Loading