Skip to content

feat: index all resources when no conditions are configured#84

Merged
JoseSzycho merged 2 commits intomainfrom
feat/allow-indexing-when-no-conditions
Apr 27, 2026
Merged

feat: index all resources when no conditions are configured#84
JoseSzycho merged 2 commits intomainfrom
feat/allow-indexing-when-no-conditions

Conversation

@JoseSzycho
Copy link
Copy Markdown
Contributor

@JoseSzycho JoseSzycho commented Apr 27, 2026

Summary

  • Removes +kubebuilder:validation:MinItems=1 from Conditions field, making it optional
  • Short-circuits the evaluator to set Matched=true when no conditions are present, so all resources of the target type are indexed unconditionally
  • Updates doc comment on Conditions to clarify the no-conditions behavior
  • Removes duplicate comment in evaluator.go

Test plan

  • Deploy a ResourceIndexPolicy with no conditions field and verify resources of the target type are indexed
  • Deploy a ResourceIndexPolicy with conditions and verify existing OR-semantics still apply
  • Verify kubectl apply accepts a policy with an empty/absent conditions field (validation no longer requires MinItems=1)

🤖 Generated with Claude Code

Related to: datum-cloud/datum#216 (comment)

JoseSzycho and others added 2 commits April 27, 2026 20:34
When a ResourceIndexPolicy has no conditions, resources of the target
type are now indexed unconditionally rather than silently skipped.
Removes the MinItems=1 validation constraint on conditions and
short-circuits the evaluator to set Matched=true when the conditions
map is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JoseSzycho JoseSzycho merged commit 59f0c46 into main Apr 27, 2026
6 checks passed
@JoseSzycho JoseSzycho deleted the feat/allow-indexing-when-no-conditions branch April 27, 2026 23:37
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Searching Resources in Milo Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants