Skip to content

Commit

Permalink
Fixing empty reconcile loop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
navidsh committed May 13, 2020
1 parent f7e3bf0 commit fac5ea0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/controller/runtimecomponent/enqueue_with_matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package runtimecomponent

import (
"context"
"fmt"

appstacksv1beta1 "github.com/application-stacks/runtime-component-operator/pkg/apis/appstacks/v1beta1"
appstacksutils "github.com/application-stacks/runtime-component-operator/pkg/utils"
Expand Down Expand Up @@ -95,6 +96,7 @@ func (i *ImageStreamMatcher) Match(imageStreamTag metav1.Object) ([]appstacksv1b
}
apps = append(apps, appList.Items...)
}
fmt.Printf("ImageStreamMatcher: %v", apps)
return apps, nil
}

Expand Down Expand Up @@ -122,11 +124,10 @@ func (b *BindingSecretMatcher) Match(secret metav1.Object) ([]appstacksv1beta1.R
// If we are able to find an app with the secret name, add the app. This is to cover the autoDetect scenario
app := &appstacksv1beta1.RuntimeComponent{}
err = b.klient.Get(context.Background(), types.NamespacedName{Name: secret.GetName(), Namespace: secret.GetNamespace()}, app)
if err != nil {
if !kerrors.IsNotFound(err) {
return nil, err
}
if err == nil {
apps = append(apps, *app)
} else if !kerrors.IsNotFound(err) {
return nil, err
}
apps = append(apps, *app)
return apps, nil
}

0 comments on commit fac5ea0

Please sign in to comment.