Skip to content

Commit

Permalink
fix cm reconcile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AmaliMatharaarachchi committed Jan 18, 2024
1 parent ca52747 commit 94f0241
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ func (apiReconciler *APIReconciler) getAPIsForConfigMap(ctx context.Context, obj
err := apiReconciler.client.List(ctx, backendList, &k8client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(configMapBackend, utils.NamespacedName(configMap).String()),
})
if err == nil {
if err == nil && len(backendList.Items) > 0 {
requests := []reconcile.Request{}
for item := range backendList.Items {
backend := backendList.Items[item]
Expand Down Expand Up @@ -1544,6 +1544,7 @@ func addIndexes(ctx context.Context, mgr manager.Manager) error {

if err := mgr.GetFieldIndexer().IndexField(ctx, &dpv1alpha2.API{}, configMapAPIDefinition,
func(rawObj k8client.Object) []string {
loggers.LoggerAPI.Error("AMALIII configMapAPIDefinition: ", configMapAPIDefinition)
api := rawObj.(*dpv1alpha2.API)
var configMaps []string
if api.Spec.DefinitionFileRef != "" {
Expand All @@ -1553,6 +1554,7 @@ func addIndexes(ctx context.Context, mgr manager.Manager) error {
Namespace: api.Namespace,
}.String())
}
loggers.LoggerAPI.Error("AMALIII configMaps: ", configMaps)
return configMaps
}); err != nil {
return err
Expand Down

0 comments on commit 94f0241

Please sign in to comment.