-
Notifications
You must be signed in to change notification settings - Fork 24
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
Document webhook logic reuse pattern #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this is a good pattern. But there are some stylistic issues that should be resolved.
3. Validation has multiple types, validation during create, update, or even | ||
delete. The update validation has access to both the old and the new struct | ||
value to be able to detect the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would focus on this a bit more. Specifically, it would be a good idea to elaborate on requirements, that is MUST and MUST NOT, of each validation type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what kind of requirements you are after. Do you have an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I was thinking along the lines of:
Create Validation MUST return error of the NewInvalid type, if it encounters any invalid section of the created data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified it in the doc
Also, linking to an existing implementation of the pattern could be useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback I was able to fix most of it
3. Validation has multiple types, validation during create, update, or even | ||
delete. The update validation has access to both the old and the new struct | ||
value to be able to detect the change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what kind of requirements you are after. Do you have an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
d31737a
to
ec3a794
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The pattern is documented in openstack-k8s-operators/dev-docs#47
The pattern is documented in openstack-k8s-operators/dev-docs#47
* split up the validation calls towards the service CRDs to have a separate ValidateCreate and ValidateUpdate call * make sure that the service operators ValidateUpdate call gets the old version of the Spec struct so that they can compare The pattern is documented in openstack-k8s-operators/dev-docs#47
The pattern is documented in openstack-k8s-operators/dev-docs#47
* split up the validation calls towards the service CRDs to have a separate ValidateCreate and ValidateUpdate call * make sure that the service operators ValidateUpdate call gets the old version of the Spec struct so that they can compare The pattern is documented in openstack-k8s-operators/dev-docs#47
* split up the validation calls towards the service CRDs to have a separate ValidateCreate and ValidateUpdate call * make sure that the service operators ValidateUpdate call gets the old version of the Spec struct so that they can compare The pattern is documented in openstack-k8s-operators/dev-docs#47
The openstack-, ironic-, and nova-operator now aligned to this pattern. See openstack-k8s-operators/openstack-operator#383 for details. So I think we can merge this doc now |
No description provided.