Skip to content

Commit dae1d8e

Browse files
authored
[builder] Remove deprecated OtelColVersion, already an error if used (open-telemetry#12757)
As titled said, this is not a breaking change, since we only are going to return a different error. Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 38fe4db commit dae1d8e

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

cmd/builder/internal/builder/config.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ type ConfResolver struct {
6565

6666
// Distribution holds the parameters for the final binary
6767
type Distribution struct {
68-
Module string `mapstructure:"module"`
69-
Name string `mapstructure:"name"`
70-
Go string `mapstructure:"go"`
71-
Description string `mapstructure:"description"`
72-
// Deprecated: [v0.113.0] only here to return a detailed error and not failing during unmarshalling.
73-
OtelColVersion string `mapstructure:"otelcol_version"`
68+
Module string `mapstructure:"module"`
69+
Name string `mapstructure:"name"`
70+
Go string `mapstructure:"go"`
71+
Description string `mapstructure:"description"`
7472
OutputPath string `mapstructure:"output_path"`
7573
Version string `mapstructure:"version"`
7674
BuildTags string `mapstructure:"build_tags"`
@@ -137,9 +135,6 @@ func NewDefaultConfig() (*Config, error) {
137135

138136
// Validate checks whether the current configuration is valid
139137
func (c *Config) Validate() error {
140-
if c.Distribution.OtelColVersion != "" {
141-
return errors.New("`otelcol_version` has been removed. To build with an older Collector API, use an older (aligned) builder version instead")
142-
}
143138
return multierr.Combine(
144139
validateModules("extension", c.Extensions),
145140
validateModules("receiver", c.Receivers),

cmd/builder/internal/builder/config_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,3 @@ func TestSkipsNilFieldValidation(t *testing.T) {
378378
cfg.ConfmapConverters = nil
379379
assert.NoError(t, cfg.Validate())
380380
}
381-
382-
func TestValidateDeprecatedOtelColVersion(t *testing.T) {
383-
cfg, err := NewDefaultConfig()
384-
require.NoError(t, err)
385-
cfg.Distribution.OtelColVersion = "test"
386-
assert.Error(t, cfg.Validate())
387-
}

0 commit comments

Comments
 (0)