Skip to content
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

feat: Add --threshold flag to nomos vet #1580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karlkfi
Copy link
Contributor

@karlkfi karlkfi commented Mar 1, 2025

  • Added a new --threshold[=MAX] option to the nomos vet command that allows specifying a maximum number of objects. If set, it will enable validation that will error if the number of objects exceeds the specified value, after rendering and cluster selectors. By default, this validation is disabled. If you pass the option without a value, the default value of 1000 is used.
  • The value 1000 was chosen as a compromise between scale and safety. Technically we know form e2e tests that the inventory can actually hold at least 5000 objects without needing to disable the status, however, this is unsafe to do in production because each of those objects could error, which adds error conditions to the inventory status, which can significantly increase the size of the inventory.
  • Unlike other options, this option has an optional value and different defaults when specified than when not specified. This requires the flag and value to be sent in the same argument, like --threshold=1000, instead of as two different arguments, like --threshold 1000.
  • If the option is specified with a value of zero or lower, the validation will be disabled, the same as if the option was not specified.

This replaces the PoC PR: #1531

TODO: write some tests

@karlkfi karlkfi requested a review from janetkuo March 1, 2025 00:28
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from karlkfi. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

- Added a new `--threshold[=MAX]` option to the `nomos vet` command
  that allows specifying a maximum number of objects. If set, it will
  enable validation that will error if the number of objects exceeds
  the specified value, after rendering and cluster selectors.
  By default, this validation is disabled. If you pass the option
  without a value, the default value of 1000 is used.
- The value 1000 was chosen as a compromise between scale and safety.
  Technically we know form e2e tests that the inventory can actually
  hold at least 5000 objects without needing to disable the status,
  however, this is unsafe to do in production because each of those
  objects could error, which adds error conditions to the inventory
  status, which can significantly increase the size of the inventory.
- Unlike other options, this option has an optional value and
  different defaults when specified than when not specified. This
  requires the flag and value to be sent in the same argument, like
  `--threshold=1000`, instead of as two different arguments, like
  `--threshold 1000`.
- If the option is specified with a value of zero or lower, the
  validation will be disabled, the same as if the option was not
  specified.
@karlkfi karlkfi force-pushed the karl-nomos-vet-object-count branch from 8eee45e to 89f1605 Compare March 1, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant