Skip to content

Commit

Permalink
Fixup #2 review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bipuladh committed Jan 10, 2023
1 parent cb5d928 commit 1e0ceaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/syncer/upsync/upsync_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ func (c *Controller) processDownstreamResource(ctx context.Context, gvr schema.G
// Namespace scoped resource
if downstreamNamespace != "" {
var nsObj runtime.Object
if nsObj, err = c.downstreamNamespaceLister.Get(downstreamNamespace); err != nil {
nsObj, err = c.downstreamNamespaceLister.Get(downstreamNamespace)
if err != nil && k8serror.IsNotFound(err) {
// Since the namespace is already deleted downstream we can delete the resource upstream as well
c.pruneUpstreamResource(ctx, gvr, key)
}
if err != nil && !k8serror.IsNotFound(err) {
logger.Error(err, "Error getting downstream Namespace from downstream namespace lister", "ns", downstreamNamespace)
return err
}
Expand Down

0 comments on commit 1e0ceaa

Please sign in to comment.