@@ -10,7 +10,7 @@ import (
10
10
11
11
"github.com/alecthomas/units"
12
12
"github.com/ipfs/kubo/config"
13
- "github.com/libp2p/go-libp2p- core/peer"
13
+ "github.com/libp2p/go-libp2p/ core/peer"
14
14
ma "github.com/multiformats/go-multiaddr"
15
15
clusterv1alpha1 "github.com/redhat-et/ipfs-operator/api/v1alpha1"
16
16
"github.com/redhat-et/ipfs-operator/controllers/scripts"
@@ -101,6 +101,17 @@ func (r *IpfsClusterReconciler) ConfigMapScripts(
101
101
string (reproviderStrategy ),
102
102
)
103
103
104
+ serviceConfig := GetDefaultServiceConfig ()
105
+ if m .Spec .Stats {
106
+ EnableMetrics (serviceConfig .Configs ())
107
+ }
108
+
109
+ serviceConfigFile , err := serviceConfig .Manager ().ToJSON ()
110
+ if err != nil {
111
+ log .Error (err , "could not marshal service config file" )
112
+ return utils .ErrFunc (fmt .Errorf ("error converting serviceConfig to JSON: %w" , err )), ""
113
+ }
114
+
104
115
expected := & corev1.ConfigMap {
105
116
ObjectMeta : metav1.ObjectMeta {
106
117
Name : cmName ,
@@ -109,6 +120,7 @@ func (r *IpfsClusterReconciler) ConfigMapScripts(
109
120
Data : map [string ]string {
110
121
"entrypoint.sh" : scripts .IPFSClusterEntrypoint ,
111
122
"configure-ipfs.sh" : configScript ,
123
+ "service.json" : string (serviceConfigFile ),
112
124
},
113
125
}
114
126
expected .DeepCopyInto (cm )
0 commit comments