vsantwana commented on PR #1144:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1144#issuecomment-4770602556
@gyfora I think we can expand it.
I just added single-field constraints that map cleanly to the CRD schema
with zero behavior change for already-valid resources. The same approach can be
extended incrementally:
**More single-field constraints**: additional @Min/@Max/@Pattern/@Size
annotations, like
- FlinkDeploymentSpec.imagePullPolicy →
@Pattern("Always|Never|IfNotPresent") (currently unvalidated free-form string;
net-new constraint).
- FlinkSessionJobSpec.deploymentName →
@Pattern("[a-z]([-a-z\\d]{0,43}[a-z\\d])?") — the regex already exists in
DefaultValidator.validateDeploymentName; this would move
the session-job call to the schema (the metadata.name call stays, since
metadata can't be annotated).
**@Required on always-mandatory fields**: e.g. serviceAccount and
deploymentName. These are already mandatory in DefaultValidator, so the only
change is moving rejection to admission time but I am not sure about this
because it is a user-visible UX change
**Cross-field rules via CEL**:
@ValidationRule (x-kubernetes-validations, K8s 1.25+) can express
constraints like the snapshot "exactly one of checkpoint or savepoint" XOR, or
immutability rules using transition rules (oldSelf). But this is very stretch
goal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]