Commit Graph

7 Commits

Author SHA1 Message Date
Antoine Toulme 1912879c19
[component] Remove deprecated `component.UnmarshalConfig` (#10340)
#### Description
Remove deprecated `component.UnmarshalConfig`

#### Link to tracking issue
Fixes #7102

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-06 10:05:26 -07:00
Ankit Patel 65cdb184f3
Add length limit to component (#9901)
Changes component.Type validation regex to only allow a max of 63
characters in a type name.

Fixes #9872

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-04-10 09:22:10 -07:00
Antoine Toulme fbc0ce0748
[confmap] confmap honors `Unmarshal` methods on config embedded structs. (#9635)
**Description:**
This implements support for calling `Unmarshal` on embedded structs of
structs being decoded.

**Link to tracking Issue:**
Fixes #6671

**Testing:**
Unit tests.

Contrib fix is open:
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/31406
2024-03-12 12:31:20 +01:00
Pablo Baeyens b2693620ef
[component] Change component.Type underlying type to a struct (#9472)
**Description:** 

Follow up to #9414 and
open-telemetry/opentelemetry-collector-contrib/pull/31038.

**Link to tracking Issue:** Fixes #9208.
2024-03-06 12:56:32 +01:00
Pablo Baeyens 26c157e3bf
[component] Add MustNewType constructor for component.Type (#9414)
**Description:** 

- Adds `component.MustNewType` to create a type. This function panics if
the type has invalid characters. Add similar functions
`component.MustNewID` and `component.MustNewIDWithName`.
- Adds `component.Type.String` to recover the string
- Use `component.MustNewType`, `component.MustNewID`,
`component.MustNewIDWithName` and `component.Type.String` everywhere in
this codebase. To do this I changed `component.Type` into an opaque
struct and checked for compile-time errors.

Some notes:

1. All components currently on core and contrib follow this rule. This
is still breaking for other components.
2. A future PR will change this into a struct, to actually validate this
(right now you can just do `component.Type("anything")` to bypass
validation). I want to do this in two steps to avoid breaking contrib
tests: we first introduce this function, and after that we change into a
struct.

**Link to tracking Issue:** Updates #9208
2024-02-02 17:33:03 +01:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [chore] use license shortform

To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052

Signed-off-by: Alex Boten <aboten@lightstep.com>

* make goporto

Signed-off-by: Alex Boten <aboten@lightstep.com>

---------

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-05-18 13:11:17 -07:00
Bogdan Drutu 5376db4058
Add recursive validation check for configs (#6545)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-11-22 10:18:38 -08:00