Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Fix customResourceDiscoverySet controller (#514)
Browse files Browse the repository at this point in the history
* Fix customResourceDiscoverySet controller

* minor fix

* Another assination down
  • Loading branch information
nmiculinic committed Jul 24, 2020
1 parent 8458e38 commit 65349f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Expand Up @@ -117,7 +117,7 @@ func (r *CatalogEntrySetReconciler) Reconcile(req ctrl.Request) (ctrl.Result, er
catalogEntryList := &catalogv1alpha1.CatalogEntryList{}
if err := r.List(ctx, catalogEntryList, client.MatchingLabels{
catalogEntriesLabel: catalogEntrySet.Name,
}); err != nil {
}, client.InNamespace(catalogEntrySet.Namespace)); err != nil {
return ctrl.Result{}, fmt.Errorf(
"listing all CatalogEntry for this CatalogEntrySet: %w", err)
}
Expand Down
Expand Up @@ -116,8 +116,10 @@ func (r *CustomResourceDiscoverySetReconciler) Reconcile(req ctrl.Request) (ctrl
// Cleanup uncontrolled CRDiscoveries
crDiscoveryList := &corev1alpha1.CustomResourceDiscoveryList{}
if err := r.List(ctx, crDiscoveryList, client.MatchingLabels{
crDiscoveriesLabel: crDiscoverySet.Name,
}); err != nil {
crDiscoveriesLabel: crDiscoverySet.Namespace + "." + crDiscoverySet.Name,
},
client.InNamespace(crDiscoverySet.Namespace),
); err != nil {
return result, fmt.Errorf(
"listing all CustomResourceDiscovery for this Set: %w", err)
}
Expand Down Expand Up @@ -170,7 +172,7 @@ func (r *CustomResourceDiscoverySetReconciler) reconcileCRDiscovery(
Name: crDiscoverySet.Name + "." + serviceCluster.Name,
Namespace: crDiscoverySet.Namespace,
Labels: map[string]string{
crDiscoveriesLabel: crDiscoverySet.Name,
crDiscoveriesLabel: crDiscoverySet.Namespace + "." + crDiscoverySet.Name,
},
},
Spec: corev1alpha1.CustomResourceDiscoverySpec{
Expand Down
Expand Up @@ -69,7 +69,7 @@ func TestCustomResourceDiscoverySetReconciler(t *testing.T) {
Name: "couchdb.us-east-1",
Namespace: "hans",
Labels: map[string]string{
crDiscoveriesLabel: crDiscoveries.Name,
crDiscoveriesLabel: crDiscoveries.Namespace + "." + crDiscoveries.Name,
},
},
}
Expand Down

0 comments on commit 65349f7

Please sign in to comment.