-
Notifications
You must be signed in to change notification settings - Fork 58
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
MON-1955: apis: add thanos querier CRD #52
Conversation
// Selector to select Monitoring stacks to unify | ||
Selector metav1.LabelSelector `json:"selector"` | ||
// Selector to select which namespaces the Monitoring Stack objects are discovered from. | ||
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"` |
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.
I wonder if it is better to user *metav1.LabelSelector
for selecting namespaces like the rest of the k8s api ?
So we can run label query for over the namespaces and allows for a new namespace can be added without changing the spec.
nit: same as above *NamespaceSelector
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.
I guess a *metav1.LabelSelector
cannot select all namespaces, but we could embed it into a NamespaceSelector like
type NamespaceSelector struct {
*metav1.LabelSelector
Any bool `json:"any,omitempty"`
}
or something along those lines
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.
Sure though I wonder if we actually want that.
If we just observe labels on a namespace, doesn't that mean that an owner of a namespace can add themselves to any thanos query instance, if they know the label to set?
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.
That's a good point. I think that addon namespaces just have a special redhat-
prefix and don't have any labels on them, so having a label selector will not be useful for us. Let's stick with the simpler approach and we can change things later
I think this looks good as a first iteration and we can even merge it. Would you mind running |
Sounds good, not sure what's up with the CI jobs. locally they all succeed. |
The CI implicitly assumes things are run with go1.16, I have 1.17 installed which creates the lint error here. Do we really want to lint (and track) generated files? The |
We have to have the |
On second thought, we shouldn't be ignoring that file because it is part of the codebase. Let me see how we handle this in other projects. |
I'd say let's bump go to 1.17 in the CI and we can make it a requirement for local development too. The problem seems to be caused when controller-gen is |
That's my favorite solution. |
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
578e64f
to
d221607
Compare
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.
lgtm
lgtm, feel free to merge it when you wish |
This only contains a CRD proposal yet. I'd like to discuss it before adding the operator code