-
Notifications
You must be signed in to change notification settings - Fork 459
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
Conversation
…or into cleanup-part-2
apis/v1beta1/config.go
Outdated
@@ -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"` |
There was a problem hiding this comment.
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"`
}
There was a problem hiding this comment.
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.
I cannot make this work for the life of me. Closing and will try a different approach 😭 |
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