Skip to content

Commit 02dd7af

Browse files
fatsheep9146dmitryax
authored andcommitted
[mdatagen] add unsupported_platforms support and enable several components (open-telemetry#30640)
**Description:** Add `supported_platforms` to enable components to describe which platforms are supported, meanwhile this configuration can also be used to generate the liftcycle test to skip windows when the component does not support windows. **Link to tracking Issue:** fix open-telemetry#30561 --------- Signed-off-by: Ziqi Zhao <[email protected]> Co-authored-by: Dmitrii Anoshin <[email protected]>
1 parent 2326862 commit 02dd7af

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

cmd/mdatagen/metadata-schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ status:
2424
codeowners:
2525
active: [string]
2626
emeritus: [string]
27+
unsupported_platforms: [<linux|windows>]
2728

2829
# Optional: OTel Semantic Conventions version that will be associated with the scraped metrics.
2930
# This attribute should be set for metrics compliant with OTel Semantic Conventions.

cmd/mdatagen/statusdata.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ type Codeowners struct {
3131
}
3232

3333
type Status struct {
34-
Stability map[string][]string `mapstructure:"stability"`
35-
Distributions []string `mapstructure:"distributions"`
36-
Class string `mapstructure:"class"`
37-
Warnings []string `mapstructure:"warnings"`
38-
Codeowners *Codeowners `mapstructure:"codeowners"`
34+
Stability map[string][]string `mapstructure:"stability"`
35+
Distributions []string `mapstructure:"distributions"`
36+
Class string `mapstructure:"class"`
37+
Warnings []string `mapstructure:"warnings"`
38+
Codeowners *Codeowners `mapstructure:"codeowners"`
39+
UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"`
3940
}
4041

4142
func (s *Status) SortedDistributions() []string {

cmd/mdatagen/templates/component_test.go.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// Code generated by mdatagen. DO NOT EDIT.
22

3+
{{ if len .Status.UnsupportedPlatforms -}}
4+
//go:build {{ range $i, $v := .Status.UnsupportedPlatforms }}{{ if $i }} && {{ end }}!{{ . }}{{ end }}
5+
{{- end }}
6+
37
package {{ .Package }}
48

59
import (

receiver/podmanreceiver/generated_component_test.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/podmanreceiver/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ status:
77
distributions: [contrib, observiq, sumo]
88
codeowners:
99
active: [rogercoll]
10+
unsupported_platforms: [windows]
1011

1112
tests:
1213
config:

receiver/sshcheckreceiver/generated_component_test.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/sshcheckreceiver/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ status:
77
distributions: [contrib, sumo]
88
codeowners:
99
active: [nslaughter, codeboten]
10+
unsupported_platforms: [windows]
1011

1112
resource_attributes:
1213
ssh.endpoint:

0 commit comments

Comments
 (0)