Skip to content

chore: Add validation webhook#6

Merged
TeddyAndrieux merged 2 commits intomainfrom
improvement/add-validation-webhook
Nov 12, 2025
Merged

chore: Add validation webhook#6
TeddyAndrieux merged 2 commits intomainfrom
improvement/add-validation-webhook

Conversation

@TeddyAndrieux
Copy link
Contributor

No description provided.

```shell
operator-sdk create webhook --group crl-operator --version v1alpha1 --kind ManagedCRL --programmatic-validation
```

Signed-off-by: Teddy Andrieux <teddy.andrieux@scality.com>
@TeddyAndrieux TeddyAndrieux requested a review from a team as a code owner November 7, 2025 10:55
Signed-off-by: Teddy Andrieux <teddy.andrieux@scality.com>
@TeddyAndrieux TeddyAndrieux force-pushed the improvement/add-validation-webhook branch from 9f90cd0 to 195d371 Compare November 7, 2025 10:57
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one comment, but it is ok for me

Comment on lines +93 to +99
managedcrl, ok := obj.(*crloperatorv1alpha1.ManagedCRL)
if !ok {
return nil, fmt.Errorf("expected a ManagedCRL object but got %T", obj)
}
managedcrllog.Info("Validation for ManagedCRL upon deletion", "name", managedcrl.GetName())

// TODO(user): fill in your validation logic upon object deletion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any interest of keeping all this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it just to "remind" that today ValidateDelete is not implemented, but I could have updated it as well

@TeddyAndrieux TeddyAndrieux merged commit 1eab025 into main Nov 12, 2025
5 checks passed
@TeddyAndrieux TeddyAndrieux deleted the improvement/add-validation-webhook branch November 12, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants