Skip to content

Commit

Permalink
add statefulset
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Jan 3, 2024
1 parent 0eaf1fb commit 3101557
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/controller/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cache

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"
Expand All @@ -25,12 +24,12 @@ func applySelectors(options cache.Options) cache.Options {

// Apply the label selector to all relevant objects.
options.ByObject = map[client.Object]cache.ByObject{
&autoscalingv1.HorizontalPodAutoscaler{}: managedByNATS,
&appsv1.Deployment{}: managedByNATS,
&corev1.ServiceAccount{}: managedByNATS,
&policyv1.PodDisruptionBudget{}: managedByNATS,
&rbacv1.ClusterRole{}: managedByNATS,
&rbacv1.ClusterRoleBinding{}: managedByNATS,
&appsv1.Deployment{}: managedByNATS,
&appsv1.StatefulSet{}: managedByNATS,
&corev1.ServiceAccount{}: managedByNATS,
&rbacv1.ClusterRole{}: managedByNATS,
&rbacv1.ClusterRoleBinding{}: managedByNATS,
&policyv1.PodDisruptionBudget{}: managedByNATS,
}
return options
}
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func Test_applySelectors(t *testing.T) {
want: cache.Options{
ByObject: map[client.Object]cache.ByObject{
&appsv1.Deployment{}: selector,
&appsv1.StatefulSet{}: selector,
&corev1.ServiceAccount{}: selector,
&rbacv1.ClusterRole{}: selector,
&rbacv1.ClusterRoleBinding{}: selector,
Expand All @@ -64,6 +65,7 @@ func Test_applySelectors(t *testing.T) {
SyncPeriod: &syncPeriod,
ByObject: map[client.Object]cache.ByObject{
&appsv1.Deployment{}: selector,
&appsv1.StatefulSet{}: selector,
&corev1.ServiceAccount{}: selector,
&rbacv1.ClusterRole{}: selector,
&rbacv1.ClusterRoleBinding{}: selector,
Expand Down

0 comments on commit 3101557

Please sign in to comment.