Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 3, 2024
1 parent 5b96aae commit 0eaf1fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ func applySelectors(options cache.Options) cache.Options {

// Apply the label selector to all relevant objects.
options.ByObject = map[client.Object]cache.ByObject{
&appsv1.Deployment{}: managedByNATS,
&autoscalingv1.HorizontalPodAutoscaler{}: managedByNATS,
&appsv1.Deployment{}: managedByNATS,
&corev1.ServiceAccount{}: managedByNATS,
&policyv1.PodDisruptionBudget{}: managedByNATS,
&rbacv1.ClusterRole{}: managedByNATS,
&rbacv1.ClusterRoleBinding{}: managedByNATS,
&policyv1.PodDisruptionBudget{}: managedByNATS,
}
return options
}
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
corev1 "k8s.io/api/core/v1"
policyv1 "k8s.io/api/policy/v1"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/labels"
"sigs.k8s.io/controller-runtime/pkg/cache"
Expand Down Expand Up @@ -48,6 +49,7 @@ func Test_applySelectors(t *testing.T) {
&rbacv1.ClusterRole{}: selector,
&rbacv1.ClusterRoleBinding{}: selector,
&autoscalingv1.HorizontalPodAutoscaler{}: selector,
&policyv1.PodDisruptionBudget{}: selector,
},
},
},
Expand All @@ -66,6 +68,7 @@ func Test_applySelectors(t *testing.T) {
&rbacv1.ClusterRole{}: selector,
&rbacv1.ClusterRoleBinding{}: selector,
&autoscalingv1.HorizontalPodAutoscaler{}: selector,
&policyv1.PodDisruptionBudget{}: selector,
},
},
},
Expand Down

0 comments on commit 0eaf1fb

Please sign in to comment.