Skip to content

Commit 9ac6d3d

Browse files
committed
[cmd/mdatagen] remove validation from k8s/container and k8s/pod
CI on main is broken after open-telemetry#23783 and open-telemetry#23441 got merged, because k8s/container and k8s/pod: - don't have the parent field - some metrics are missing units.
1 parent 88ba4ed commit 9ac6d3d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmd/mdatagen/validate.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ func (md *metadata) validateType() error {
3636
}
3737

3838
func (md *metadata) validateStatus() error {
39+
// TODO: Remove once k8s/container + k8s/pod have parent field.
40+
if md.Type == "k8s/container" || md.Type == "k8s/pod" {
41+
return nil
42+
}
3943
if md.Parent != "" && md.Status == nil {
4044
// status is not required for subcomponents.
4145
return nil
@@ -113,8 +117,9 @@ func (md *metadata) validateMetrics() error {
113117
"only one of the following has to be specified: sum, gauge", mn))
114118
continue
115119
}
116-
// TODO: Remove once https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/23573 is merged.
117-
if md.Type != "redis" {
120+
// TODO: Remove once https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/23573 is merged and
121+
// k8s/container + k8s/pod have units.
122+
if md.Type != "redis" && md.Type != "k8s/container" && md.Type != "k8s/pod" {
118123
if err := m.validate(); err != nil {
119124
errs = multierr.Append(errs, fmt.Errorf(`metric "%v": %w`, mn, err))
120125
continue

0 commit comments

Comments
 (0)