Skip to content

Commit 8bee6e1

Browse files
committed
Set replica count to 1 by default
Signed-off-by: Fred Heinecke <[email protected]>
1 parent 601ff3d commit 8bee6e1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/operator/collector-statefulset.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ var (
1717
)
1818

1919
func MakefbStatefulset(co fluentbitv1alpha2.Collector) *appsv1.StatefulSet {
20+
replicas := int32(1)
21+
if co.Spec.Replicas != nil {
22+
replicas = *co.Spec.Replicas
23+
}
24+
2025
statefulset := appsv1.StatefulSet{
2126
ObjectMeta: metav1.ObjectMeta{
2227
Name: co.Name,
2328
Namespace: co.Namespace,
2429
Labels: co.Labels,
2530
},
2631
Spec: appsv1.StatefulSetSpec{
27-
Replicas: co.Spec.Replicas,
32+
Replicas: &replicas,
2833
Selector: &metav1.LabelSelector{
2934
MatchLabels: co.Labels,
3035
},

0 commit comments

Comments
 (0)