diff --git a/cmd/mdatagen/.distributions.yaml b/cmd/mdatagen/.distributions.yaml new file mode 100644 index 000000000000..d6c9cfb0824d --- /dev/null +++ b/cmd/mdatagen/.distributions.yaml @@ -0,0 +1,42 @@ +# A collection of distributions that can be referenced in the metadata.yaml files. +# The rules below apply to every distribution added to this list: +# - The distribution must be open source. +# - The link must point to a publicly accessible repository. + - name: core + url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol + - name: contrib + url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + - name: aws + url: https://github.com/aws-observability/aws-otel-collector + - name: grafana + url: https://github.com/grafana/agent + - name: observiq + url: https://github.com/observIQ/observiq-otel-collector + - name: redhat + url: https://github.com/os-observability/redhat-opentelemetry-collector + - name: splunk + url: https://github.com/signalfx/splunk-otel-collector + maintainers: + - atoulme + - crobert-1 + - dmitryax + - hughesjj + - jeffreyc-splunk + - jinja2 + - jvoravong + - panotti + - rmfitzpatrick + - samiura + - name: sumo + url: https://github.com/SumoLogic/sumologic-otel-collector + maintainers: + - aboguszewski-sumo + - astencel-sumo + - kkujawa-sumo + - rnishtala-sumo + - sumo-drosiek + - swiatekm-sumo + - name: liatrio + url: https://github.com/liatrio/liatrio-otel-collector + maintainers: + - adrielp diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 6c9ec4e77d1f..ee538916999c 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -15,6 +15,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/text v0.14.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -41,7 +42,6 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) retract ( diff --git a/cmd/mdatagen/statusdata.go b/cmd/mdatagen/statusdata.go index 9ecf63d4257d..95f2c9fdd493 100644 --- a/cmd/mdatagen/statusdata.go +++ b/cmd/mdatagen/statusdata.go @@ -4,25 +4,35 @@ package main import ( + _ "embed" "sort" + + "gopkg.in/yaml.v3" ) -// distros is a collection of distributions that can be referenced in the metadata.yaml files. -// The rules below apply to every distribution added to this list: -// - The distribution must be open source. -// - The link must point to a publicly accessible repository. -var distros = map[string]string{ - "core": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol", - "contrib": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib", - "aws": "https://github.com/aws-observability/aws-otel-collector", - "grafana": "https://github.com/grafana/agent", - "observiq": "https://github.com/observIQ/observiq-otel-collector", - "redhat": "https://github.com/os-observability/redhat-opentelemetry-collector", - "splunk": "https://github.com/signalfx/splunk-otel-collector", - "sumo": "https://github.com/SumoLogic/sumologic-otel-collector", - "liatrio": "https://github.com/liatrio/liatrio-otel-collector", +//go:generate cp -r ../../distributions.yaml .distributions.yaml +//go:embed .distributions.yaml +var distrosBytes []byte + +func init() { + var dd []distroData + err := yaml.Unmarshal(distrosBytes, &dd) + if err != nil { + panic(err) + } + for _, d := range dd { + distros[d.Name] = d.URL + } } +type distroData struct { + Name string `yaml:"name"` + URL string `yaml:"url"` +} + +// distros is a collection of distributions that can be referenced in the metadata.yaml files. +var distros = map[string]string{} + type Codeowners struct { // Active codeowners Active []string `mapstructure:"active"`