-
Notifications
You must be signed in to change notification settings - Fork 19
feat(chart): Plugins #1750
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
base: main
Are you sure you want to change the base?
feat(chart): Plugins #1750
Conversation
WalkthroughAdds two Helm templates that render ScrapePlugin resources for AWS and Kubernetes locations when plugin flags are enabled, and introduces a top-level Changes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
2150ba2 to
0fcff97
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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
chart/templates/plugins/aws-locations.yaml (1)
1-1: Minor: Fix inconsistent spacing in template condition.Double space between
.Values.plugins.enabledand.Values.plugins.locations.awsshould be single space for consistency with best practices.Note: YAMLlint's error about
{{-is a false positive—YAMLlint doesn't natively understand Helm template syntax. If the pipeline rejects this, consider adding YAMLlint configuration to exclude template files or add a directive to skip Helm files.Apply this diff:
-{{- if and .Values.plugins.enabled .Values.plugins.locations.aws }} +{{- if and .Values.plugins.enabled .Values.plugins.locations.aws }}chart/values.schema.json (2)
3-3: Stricter validation withadditionalProperties: falseapplied broadly.Root-level and nested
additionalProperties: falseconstraints (e.g., line 416 for image) enforce stricter schema validation. This is good for maintainability but verify that image being added to required (line 809) does not break existing deployments or CI pipelines that may not explicitly define the image block (relying on defaults instead).If image was previously optional, consider whether making it required is necessary or if it should remain optional with a schema-provided default. Run through deployment scenarios to confirm backward compatibility.
Also applies to: 416-416, 809-809
3-3: Extensive schema tightening viaadditionalProperties: false.Many nested objects now enforce
additionalProperties: false, restricting custom/unknown properties. While this improves schema rigor and prevents configuration drift, the scope is broad. Ensure that:
- Existing production Helm values do not contain unexpected properties that would now be rejected
- CI/CD validation tests cover the new stricter schema
- Teams are aware of the validation changes to prevent deployment surprises
Add integration tests or validation checks to confirm that the stricter schema does not break existing or expected chart usage patterns. Consider documenting breaking schema changes in release notes if this is a patch/minor version bump.
Also applies to: 6-6, 12-12, 21-21, 79-79, 82-82, 103-103, 150-150, 276-276, 284-284, 350-350, 369-369, 387-387, 461-461, 551-551, 661-661, 733-733, 759-759, 774-774
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
chart/templates/plugins/aws-locations.yaml(1 hunks)chart/templates/plugins/k8s.yaml(1 hunks)chart/values.schema.json(14 hunks)chart/values.yaml(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
chart/templates/plugins/aws-locations.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
chart/templates/plugins/k8s.yaml
[error] 2-2: syntax error: expected '', but found ''
(syntax)
🔇 Additional comments (5)
chart/values.yaml (2)
148-167: Image block addition looks good.The new top-level
imageblock with template-based name and enum-validated pullPolicy aligns well with the schema.
608-631: Plugins block properly structured.Schema annotations are comprehensive, defaults enable both plugins by default for out-of-box functionality, and the structure aligns with template conditionals.
chart/templates/plugins/k8s.yaml (1)
8-90: ScrapePlugin structure and filters are well-designed.Aliases and locations properly map Kubernetes resource types to discovery schemes. Filter logic (including parent relationships and AWS provider ID detection) is clear and semantically correct.
chart/templates/plugins/aws-locations.yaml (1)
9-9: Verify unusual type syntax for AWS Account alias.Line 9 defines the type as
AWS::::Account(with four colons). This appears inconsistent with other aliases which useAWS::ResourceTypepattern (e.g.,AWS::AvailabilityZoneon line 13). Confirm whether the four-colon syntax is intentional or a typo.chart/values.schema.json (1)
542-575: Plugins schema properly structured with sensible defaults.New plugins configuration requires
locationsobject (which contains aws/kubernetes toggles) and enables both by default. Structure aligns with values.yaml and template conditionals. The constraint thatenabledis not required is acceptable since the schema provides a default (true), so the field will apply even if omitted.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
chart/templates/plugins/aws-locations.yaml(1 hunks)chart/templates/plugins/k8s.yaml(1 hunks)chart/values.schema.json(14 hunks)chart/values.yaml(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
chart/templates/plugins/k8s.yaml
[error] 2-2: syntax error: expected '', but found ''
(syntax)
chart/templates/plugins/aws-locations.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (5)
chart/templates/plugins/k8s.yaml (1)
1-1: The YAMLlint error is a known false positive with Helm templates—verify viahelm lintinstead.YAMLlint doesn't handle Helm template syntax correctly; render templates first before linting them. Use
helm lintto check for potential issues in Helm charts, which performs checks on structure, syntax, and best practices. The conditional syntax itself is valid Helm: conditional blocks are a standard pattern in Helm for gating resource creation based on values.Minor style nit: normalize the double space between
.Values.plugins.enabledand.Values.plugins.locations.kubernetesto a single space for consistency.chart/templates/plugins/aws-locations.yaml (1)
1-1: The YAMLlint error is a known false positive with Helm templates—verify viahelm lintinstead.YAMLlint doesn't handle Helm template syntax correctly; render templates first before linting. The
{{-syntax for whitespace control is valid Helm pattern. Usehelm lintto validate that templates can be rendered successfully.Minor style nit: normalize the double space between
.Values.plugins.enabledand.Values.plugins.locations.awsto a single space for consistency across both plugin templates.chart/values.schema.json (3)
542-575: Plugin schema structure is sound and aligns with template conditionals.The new
pluginsobject correctly mirrors the template conditions in bothk8s.yamlandaws-locations.yaml. Both feature flags (plugins.locations.awsandplugins.locations.kubernetes) default totrueand are optional, allowing users to disable specific location plugins while the overall feature is enabled. Therequired: ["locations"]ensures the nested structure exists while making individual toggles optional.
415-445: New top-levelimageblock schema looks correct; verify chart/values.yaml has matching defaults.The image schema defines name, pullPolicy, and tag with reasonable defaults. Note that the name default contains a Helm template expression (
{{.Values.global.imagePrefix}}/config-db), which is valid but worth verifying works correctly with your schema validation tools at deployment time.
807-811: Verify template rendering and schema validation against chart/values.yaml.The schema changes are comprehensive but the critical file
chart/values.yamlisn't included in this review. Before merging, ensure:
- The values file contains defaults matching this schema (especially the new
pluginsandimageblocks).- The schema validates successfully with
helm lint.helm templaterenders the new plugin templates without errors when plugins are enabled/disabled.
0fcff97 to
7f1bcb1
Compare
7f1bcb1 to
38c374c
Compare
compatibility. Eventually, each field's additionalProperties: true must be carefully set.
47e7e9a to
865a01d
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
chart/values.schema.json (1)
529-560: Plugins schema section lacksadditionalProperties: falsefor consistency.Most section objects in the schema (e.g.,
ingress,otel,serviceAccount) include"additionalProperties": false, but the newpluginssection does not. If the intent is to enforce strict validation, add this constraint for consistency."plugins": { + "additionalProperties": false, "properties": { "enabled": { "default": true, "title": "enabled", "type": "boolean" },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Makefile(1 hunks)chart/templates/plugins/aws-locations.yaml(1 hunks)chart/templates/plugins/k8s.yaml(1 hunks)chart/values.schema.json(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
chart/templates/plugins/aws-locations.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
chart/templates/plugins/k8s.yaml
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (2)
Makefile (1)
228-229: LGTM on Makefile change.The added
-rand-f values.yamlflags align with standalone schema generation from the values file. This complements the helm-schema invocation in thecharttarget.chart/values.schema.json (1)
556-557: Verify therequired: ["locations"]constraint aligns with intended defaults.The plugins section declares
locationsas required, meaning it must always be present in values. Given that individual location toggles (aws, kubernetes) already have defaults, verify this enforces the expected validation behavior and doesn't break existing deployments that omit the plugins section entirely.
resolves: flanksource/mission-control-chart#268
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.