-
Notifications
You must be signed in to change notification settings - Fork 68
/
datastore.go
36 lines (32 loc) 路 988 Bytes
/
datastore.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package yamlconvert
import (
"github.com/fluidtruck/deepcopy"
"github.com/kubeshop/tracetest/server/model"
"github.com/kubeshop/tracetest/server/model/yaml"
)
func DataStore(in model.DataStore) yaml.File {
out := yaml.DataStore{}
deepcopy.DeepCopy(in, &out)
if in.Values.Jaeger != nil {
deepcopy.DeepCopy(in.Values.Jaeger, &out.Jaeger)
deepcopy.DeepCopy(in.Values.Jaeger.TLSSetting, &out.Jaeger.Tls)
}
if in.Values.Tempo != nil {
deepcopy.DeepCopy(in.Values.Tempo, &out.Tempo)
deepcopy.DeepCopy(in.Values.Tempo.Grpc.TLSSetting, &out.Tempo.Grpc.Tls)
deepcopy.DeepCopy(in.Values.Tempo.Http.TLSSetting, &out.Tempo.Http.Tls)
}
if in.Values.OpenSearch != nil {
deepcopy.DeepCopy(in.Values.OpenSearch, &out.OpenSearch)
}
if in.Values.SignalFx != nil {
deepcopy.DeepCopy(in.Values.SignalFx, &out.SignalFx)
}
if in.Values.AwsXRay != nil {
deepcopy.DeepCopy(in.Values.AwsXRay, &out.AwsXRay)
}
return yaml.File{
Type: yaml.FileTypeDataStore,
Spec: out,
}
}