-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmd/mdatagen]: Add feature gates support to metadata-schema.yaml
- Loading branch information
Showing
5 changed files
with
211 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Code generated by mdatagen. DO NOT EDIT. | ||
|
||
package {{ .Package }} | ||
|
||
import ( | ||
"go.opentelemetry.io/collector/featuregate" | ||
) | ||
|
||
func init() { | ||
for _, fg := range {{ .FeatureGates }} { | ||
var opts []featuregate.RegisterOption | ||
if fg.FromVersion != "" { | ||
opts = append(opts, featuregate.WithRegisterFromVersion(fg.FromVersion) | ||
} | ||
if fg.Description != "" { | ||
opts = append(opts, featuregate.WithRegisterDescription(fg.Description) | ||
} | ||
if fg.ReferenceURL != "" { | ||
opts = append(opts, featuregate.WithRegisterReferenceURL(fg.ReferenceURL) | ||
} | ||
if fg.ToVersion != "" { | ||
opts = append(opts, featuregate.WithRegisterToVersion("v0.70.0")) | ||
} | ||
_ = featuregate.GlobalRegistry().MustRegister(fg.ID, fg.Stage, opts...) | ||
} | ||
} |
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