forked from signalfx/splunk-otel-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
discoverybundler: Generate component files from components.go (signal…
…fx#4066) Also adds `make bundle.d` diff check in tests job.
- Loading branch information
1 parent
1666647
commit 82f3a78
Showing
13 changed files
with
267 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright Splunk, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build bundle.d | ||
|
||
// These are the discovery config component generating statements. | ||
// In order to update run go generate -tags bundle.d ./... | ||
|
||
{{- range $ext := .Extensions }} | ||
//go:generate discoverybundler -r -t bundle.d/extensions/{{ $ext }}.discovery.yaml.tmpl | ||
{{- if index $.Linux $ext }} | ||
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/extensions -t bundle.d/extensions/{{ $ext }}.discovery.yaml.tmpl | ||
{{- end }} | ||
{{- end }} | ||
{{ range $rec := .Receivers }} | ||
//go:generate discoverybundler -r -t bundle.d/receivers/{{ $rec }}.discovery.yaml.tmpl | ||
{{- if index $.Linux $rec }} | ||
//go:generate discoverybundler -r -c -d ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/{{ $rec }}.discovery.yaml.tmpl | ||
{{- end }} | ||
{{- end }} | ||
|
||
package bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
internal/confmapprovider/discovery/bundle/bundledfs_others.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright Splunk, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//go:build !windows | ||
|
||
package bundle | ||
|
||
import ( | ||
"embed" | ||
) | ||
|
||
// BundledFS is the in-executable filesystem that contains all bundled discovery config.d components. | ||
|
||
//go:embed bundle.d/extensions/docker-observer.discovery.yaml | ||
//go:embed bundle.d/extensions/host-observer.discovery.yaml | ||
//go:embed bundle.d/extensions/k8s-observer.discovery.yaml | ||
//go:embed bundle.d/receivers/oracledb.discovery.yaml | ||
//go:embed bundle.d/receivers/redis.discovery.yaml | ||
//go:embed bundle.d/receivers/smartagent-collectd-mysql.discovery.yaml | ||
//go:embed bundle.d/receivers/smartagent-collectd-nginx.discovery.yaml | ||
//go:embed bundle.d/receivers/smartagent-postgresql.discovery.yaml | ||
var BundledFS embed.FS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
internal/confmapprovider/discovery/bundle/cmd/discoverybundler/bootstrap.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright Splunk, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// This file will generate bundle_gen.go, bundledfs_others.go, and bundledfs_windows.go for use w/ | ||
// make bundle.d | ||
//go:build bootstrap.bundle.d | ||
|
||
//go:generate discoverybundler --bootstrap | ||
|
||
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.