[platform] delete extra dependencies for piraeus operator - #856
Conversation
WalkthroughThe changes modify Helm chart templates and bundle configuration files to add conditional rendering based on the presence of specific Kubernetes API versions. The Changes
Sequence Diagram(s)sequenceDiagram
participant Helm Chart
participant Kubernetes Cluster
Helm Chart->>Kubernetes Cluster: Check for API version "operator.victoriametrics.com/v1beta1"
alt API version present
Helm Chart->>Kubernetes Cluster: Render VMPodScrape resource
else API version absent
Helm Chart-->>Kubernetes Cluster: Skip VMPodScrape resource
end
Helm Chart->>Kubernetes Cluster: Check for API version "monitoring.coreos.com/v1"
alt API version present
Helm Chart->>Kubernetes Cluster: Render alert YAML files
else API version absent
Helm Chart-->>Kubernetes Cluster: Skip alert YAML files
end
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🪛 YAMLlint (1.35.1)packages/system/linstor/templates/podscrape.yaml[error] 1-1: syntax error: expected the node content, but found '-' (syntax) ⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
1475335 to
d6fb13f
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/system/piraeus-operator/alerts/piraeus-datastore.yaml (1)
2-2: Move document separator inside Helm conditional to avoid empty YAML docs
Placing the---before theifwill emit an empty document when the condition is false.- --- - {{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }} + {{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }} + ---🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 2-2: syntax error: expected the node content, but found '-'
(syntax)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/core/platform/bundles/distro-full.yaml(1 hunks)packages/system/linstor/templates/podscrape.yaml(2 hunks)packages/system/piraeus-operator/alerts/piraeus-datastore.yaml(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/core/platform/bundles/distro-full.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/system/linstor/templates/podscrape.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
packages/system/piraeus-operator/alerts/piraeus-datastore.yaml
[error] 2-2: syntax error: expected the node content, but found '-'
(syntax)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Test
🔇 Additional comments (3)
packages/system/piraeus-operator/alerts/piraeus-datastore.yaml (1)
118-118: Closing Helm conditional
The{{- end }}correctly closes the block.packages/system/linstor/templates/podscrape.yaml (2)
1-1: Gate VMPodScrape resources on API version availability
Using.Capabilities.APIVersions.Has "operator.victoriametrics.com/v1beta1"is the correct approach to conditionally render these resources.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
46-46: Closing Helm conditional
The{{- end }}correctly terminates the conditional block.
d6fb13f to
e9c5d14
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/system/piraeus-operator/alerts/piraeus-datastore.yaml (1)
2-118: Wrap PrometheusRule in Helm conditional and consider adjusting document separator
The newif .Capabilities.APIVersions.Has "monitoring.coreos.com/v1"guard ensures thePrometheusRuleis only rendered when supported. To prevent emitting an empty YAML document when the condition is false, consider moving the leading---inside the conditional block. Also, ignore the YAMLlint syntax error caused by the Helm whitespace control.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 2-2: syntax error: expected the node content, but found '-'
(syntax)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/core/platform/bundles/distro-full.yaml(1 hunks)packages/system/linstor/templates/podscrape.yaml(2 hunks)packages/system/piraeus-operator/alerts/piraeus-datastore.yaml(2 hunks)packages/system/piraeus-operator/templates/alerts.yaml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/core/platform/bundles/distro-full.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/system/piraeus-operator/templates/alerts.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
packages/system/linstor/templates/podscrape.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
packages/system/piraeus-operator/alerts/piraeus-datastore.yaml
[error] 2-2: syntax error: expected the node content, but found '-'
(syntax)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Test
🔇 Additional comments (2)
packages/system/piraeus-operator/templates/alerts.yaml (1)
1-9: Approve conditional gating and ignore YAMLlint warning
The Helm whitespace control{{- ... }}is correctly used to strip whitespace, and this block appropriately gates the inclusion of alert YAML snippets to clusters with themonitoring.coreos.com/v1API. The YAMLlint syntax error is a false positive in Helm templates.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
packages/system/linstor/templates/podscrape.yaml (1)
1-46: Approve conditional gating and ignore YAMLlint warning
Wrapping bothVMPodScraperesources inside{{- if .Capabilities.APIVersions.Has "operator.victoriametrics.com/v1beta1" }}correctly prevents rendering in clusters lacking that API. The Helm whitespace control is valid; the YAMLlint syntax error can be safely ignored.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
e9c5d14 to
e79ee94
Compare
Signed-off-by: kklinch0 <kklinch0@gmail.com>
e79ee94 to
3c27192
Compare
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated dependency configuration so that piraeus-operator no longer depends on victoria-metrics-operator. - **Refactor** - Improved compatibility by ensuring certain resources (VMPodScrape and alert definitions) are only rendered if the required API versions are available in the Kubernetes cluster. <!-- end of auto-generated comment: release notes by coderabbit.ai --> (cherry picked from commit 29b4949) Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Summary by CodeRabbit