Conversation
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/utils/ptr" | ||
|
|
||
| "github.com/VictoriaMetrics/operator/internal/config" |
There was a problem hiding this comment.
let's avoid adding any github.com/VictoriaMetrics/operator/internal/* package in api. probably it can be done in defaults.go instead
There was a problem hiding this comment.
1 issue found across 34 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/config/config.go">
<violation number="1" location="internal/config/config.go:630">
P2: Use the documented `envKeyValSeparator` tag; `envKeyValueSeparator` is ignored, so the new label/annotation env vars won't parse as `key=value` pairs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
This ensures HTTPRoutes and PVCs include ManagedMetadata labels and annotations
…separated by equals sign)
bdb8758 to
07658b7
Compare
Unlike other resources we need to apply defaults before retries
|
|
||
| scheme.AddTypeDefaultingFunc(&appsv1.DaemonSet{}, addDefaultMetadata) | ||
| scheme.AddTypeDefaultingFunc(&corev1.ConfigMap{}, addDefaultMetadata) | ||
| scheme.AddTypeDefaultingFunc(&corev1.Namespace{}, addDefaultMetadata) |
There was a problem hiding this comment.
not sure this is needed, we don't manage namespaces
There was a problem hiding this comment.
also don't understand why this function should be applied to all core k8s resources? isn't it enough to extend addDefaultMetadata to patch ManagedMetadata? also not sure if this should be applied to pods as well
There was a problem hiding this comment.
I'd rather add those preemptively, as some feature may start managing those resources later.
also don't understand why this function should be applied to all core k8s resources?
My understanding is that if the object (VMAgent) creates a deployment and the service, we should make sure both have propagated labels and annotations. I'm not sure that omitting pods / child resources is sufficient for OPA.
also not sure if this should be applied to pods as well
I think so, yeah
This ensures HTTPRoutes and PVCs include ManagedMetadata labels and annotations.
Fixes #2094
TODO: