cluster_policies: Stop allowing Sequence types for value - #6492
Merged
Conversation
Sankalp-Mittal
marked this pull request as draft
September 2, 2026 17:10
Sankalp-Mittal
marked this pull request as ready for review
September 2, 2026 17:15
Contributor
Can you be more specific how this impacts DABs users? will this fail when the job is deployed? when the job is run? |
janniklasrose
approved these changes
Sep 3, 2026
Sankalp-Mittal
deleted the
sankalp-mittal/clusterpolicies-drop-Sequence
branch
September 3, 2026 09:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Reject inline sequence (list) values for the cluster policy
definitionandpolicy_family_definition_overridesfields. Previously a top-level YAML sequence was marshaled to a JSON array string and sent to the backend as-is; it is now rejected during bundle validation with<field> must be a string or map, got sequence.Why
A cluster policy
definitionmust be a JSON object (a map of attribute paths to constraint objects). A top-level sequence is valid JSON but never a valid policy, and the backend does not validate the definition shape at create time — so without this change the broken policy is accepted and the failure is deferred.Concretely, for:
bundle deploysucceeds — the backend accepts the array definition, returns apolicy_id, and stores it verbatim (it is never marked invalid), and the job is created. The failure only appears when the job runs: launching the job cluster applies the policy, and the backend rejects it withINVALID_PARAMETER_VALUE: Requests for the policy ... cannot be satisfied due to the malformed policy definition. Please contact your administrator to correct the policy definition.— an error far from the bundle config that gives no hint the cause is the list underdefinition.bundle validate/bundle deployfails immediately withdefinition must be a string or map, got sequence, pointing straight at the offending config.(Verified against the Azure backend and confirmed in the backend source: create-time validation only does field-presence
.has(...)checks, which pass for an array; the array only fails later during enforcement inClusterPolicyDefinition.fromJson.)Tests
Unit tests.
This pull request and its description were written by Isaac.