Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] use distributions.yaml in mdatagen #29851

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions cmd/mdatagen/.distributions.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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 (
Expand Down
38 changes: 24 additions & 14 deletions cmd/mdatagen/statusdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down