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

Define components more clearly in v1beta1 #2915

Closed
wants to merge 14 commits into from

Conversation

jaronoff97
Copy link
Contributor

Description:
Defines components as a map from component name to an AnyConfig

Link to tracking Issue(s):

Part of #2603

Testing: unit tests

Documentation: n/a

@jaronoff97 jaronoff97 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 30, 2024
@@ -121,16 +136,16 @@ func (c *Config) GetEnabledComponents() map[ComponentType]map[string]interface{}
// Config encapsulates collector config.
type Config struct {
// +kubebuilder:pruning:PreserveUnknownFields
Receivers AnyConfig `json:"receivers" yaml:"receivers"`
Receivers map[string]*AnyConfig `json:"receivers" yaml:"receivers"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why this change is needed? AnyConfig is already a map

type AnyConfig struct {
	Object map[string]interface{} `json:"-" yaml:",inline"`
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is because we know that any component definition is also an AnyConfig, therefore receivers is really a map from component name to an AnyConfig.

After trying to futz with the types, though, I don't i'm able to make this serialization work.

@jaronoff97
Copy link
Contributor Author

I cannot make this work for the life of me. Closing and will try a different approach 😭

@jaronoff97 jaronoff97 closed this May 2, 2024
@jaronoff97 jaronoff97 deleted the cleanup-part-2 branch May 2, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants