@@ -15,6 +15,10 @@ import (
15
15
"go.opentelemetry.io/collector/pdata/pmetric"
16
16
)
17
17
18
+ func boolPtr (b bool ) * bool {
19
+ return & b
20
+ }
21
+
18
22
func TestTwoPackagesInDirectory (t * testing.T ) {
19
23
contents , err := os .ReadFile ("testdata/twopackages.yaml" )
20
24
require .NoError (t , err )
@@ -70,15 +74,15 @@ func TestLoadMetadata(t *testing.T) {
70
74
ResourceAttributes : map [AttributeName ]Attribute {
71
75
"string.resource.attr" : {
72
76
Description : "Resource attribute with any string value." ,
73
- Enabled : true ,
77
+ EnabledPtr : boolPtr ( true ) ,
74
78
Type : ValueType {
75
79
ValueType : pcommon .ValueTypeStr ,
76
80
},
77
81
FullName : "string.resource.attr" ,
78
82
},
79
83
"string.enum.resource.attr" : {
80
84
Description : "Resource attribute with a known set of string values." ,
81
- Enabled : true ,
85
+ EnabledPtr : boolPtr ( true ) ,
82
86
Enum : []string {"one" , "two" },
83
87
Type : ValueType {
84
88
ValueType : pcommon .ValueTypeStr ,
@@ -87,23 +91,23 @@ func TestLoadMetadata(t *testing.T) {
87
91
},
88
92
"optional.resource.attr" : {
89
93
Description : "Explicitly disabled ResourceAttribute." ,
90
- Enabled : false ,
94
+ EnabledPtr : boolPtr ( false ) ,
91
95
Type : ValueType {
92
96
ValueType : pcommon .ValueTypeStr ,
93
97
},
94
98
FullName : "optional.resource.attr" ,
95
99
},
96
100
"slice.resource.attr" : {
97
101
Description : "Resource attribute with a slice value." ,
98
- Enabled : true ,
102
+ EnabledPtr : boolPtr ( true ) ,
99
103
Type : ValueType {
100
104
ValueType : pcommon .ValueTypeSlice ,
101
105
},
102
106
FullName : "slice.resource.attr" ,
103
107
},
104
108
"map.resource.attr" : {
105
109
Description : "Resource attribute with a map value." ,
106
- Enabled : true ,
110
+ EnabledPtr : boolPtr ( true ) ,
107
111
Type : ValueType {
108
112
ValueType : pcommon .ValueTypeMap ,
109
113
},
@@ -114,7 +118,7 @@ func TestLoadMetadata(t *testing.T) {
114
118
Warnings : Warnings {
115
119
IfEnabledNotSet : "This resource_attribute will be disabled by default soon." ,
116
120
},
117
- Enabled : true ,
121
+ EnabledPtr : boolPtr ( true ) ,
118
122
Type : ValueType {
119
123
ValueType : pcommon .ValueTypeStr ,
120
124
},
@@ -125,7 +129,7 @@ func TestLoadMetadata(t *testing.T) {
125
129
Warnings : Warnings {
126
130
IfConfigured : "This resource_attribute is deprecated and will be removed soon." ,
127
131
},
128
- Enabled : false ,
132
+ EnabledPtr : boolPtr ( false ) ,
129
133
Type : ValueType {
130
134
ValueType : pcommon .ValueTypeStr ,
131
135
},
@@ -136,7 +140,7 @@ func TestLoadMetadata(t *testing.T) {
136
140
Warnings : Warnings {
137
141
IfEnabled : "This resource_attribute is deprecated and will be removed soon." ,
138
142
},
139
- Enabled : true ,
143
+ EnabledPtr : boolPtr ( true ) ,
140
144
Type : ValueType {
141
145
ValueType : pcommon .ValueTypeStr ,
142
146
},
0 commit comments