What is missing?
We have a lot of OpenAPI validation checks for the K8ssandraCluster CRD. For checks that have to be applied dynamically at runtime we have a validating webhook. There are also some validation checks performed during the reconciliation loop.
Several things are needed:
There needs to be a Valid status condition that is set to false when there are validation errors
The condition should include specific details about what the errors are
The validation checks performed in the webhook should also be performed during reconciliation (and vice versa)
Validation checks should be performed as early as possible during reconciliation
Why do we need it?
First, let's address why we need validation checks during reconciliation if we have a validating webhook. It's because the operator can be deployed without the webhook.
We need a Valid condition to better surface validation errors. When there is a validation error during reconciliation, the user won't find out until he looks at the operator logs. The status condition will let him know right away and can be easily monitored.
Validation checks should be performed as early as possible during reconciliation. We should fail fast and avoid doing unnecessary work if the desired state is invalid. That's not the case today. Furthermore, we have validation checks scattered in different places. Ideally, those checks should happen in a single place.
Environment
K8ssandra Operator version:
v1.1.1
**Anything else we need to know?**:
┆Issue is synchronized with this Jira Story by Unito
┆Issue Number: K8OP-191
What is missing? We have a lot of OpenAPI validation checks for the K8ssandraCluster CRD. For checks that have to be applied dynamically at runtime we have a validating webhook. There are also some validation checks performed during the reconciliation loop.
Several things are needed:
Valid
status condition that is set to false when there are validation errorsWhy do we need it? First, let's address why we need validation checks during reconciliation if we have a validating webhook. It's because the operator can be deployed without the webhook.
We need a
Valid
condition to better surface validation errors. When there is a validation error during reconciliation, the user won't find out until he looks at the operator logs. The status condition will let him know right away and can be easily monitored.Validation checks should be performed as early as possible during reconciliation. We should fail fast and avoid doing unnecessary work if the desired state is invalid. That's not the case today. Furthermore, we have validation checks scattered in different places. Ideally, those checks should happen in a single place.
Environment
K8ssandra Operator version:
**Anything else we need to know?**:v1.1.1
┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: K8OP-191