-
Notifications
You must be signed in to change notification settings - Fork 486
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
prometheus.operator.servicemonitors #3487
Conversation
Implements #3384 |
You'd need add that to the description of the PR in order to get the related issue closed |
|
||
// Update implements component.Component. | ||
func (c *Component) Update(args component.Arguments) error { | ||
// TODO(jcreixell): Initialize manager here so we can return errors back early to the caller. |
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.
WDYT to address this TODO in this PR?
component/prometheus/operator/configgen/config_gen_serviceMonitor.go
Outdated
Show resolved
Hide resolved
component/prometheus/operator/servicemonitors/serviceMonitors.go
Outdated
Show resolved
Hide resolved
} | ||
|
||
func NewCRDManager(opts component.Options, logger log.Logger, args *Arguments) *crdManager { | ||
const ( | ||
KindPodMonitor string = "podMonitor" |
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.
we may want to define these constants in component.go (potentially with a type alias) and reference them here to prevent duplication and inconsistencies
func (c *crdManager) configureInformers(ctx context.Context, informers cache.Informers) error { | ||
podMonitor := &promopv1.PodMonitor{} | ||
var proto client.Object |
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.
would object
or k8sObject
be a more descriptive name?
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.
overall LGTM, the refactoring makes sense. Added a few nits like replacing harcoded strings by top level constants with custom types. Not much more to add aside from what @marctc already mentioned
Implements #3384