mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
feat(crd-gen): automate the CRDs generation with validations for APIs (#75)
- To generate the CRD spec `make manifest` generate then under deploy/yamls directory - added a update-crd script to automate the steps to generate CRDs and its validation of each types Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
This commit is contained in:
parent
8a9ac43ab5
commit
6033789c17
26 changed files with 509 additions and 82 deletions
|
|
@ -85,14 +85,14 @@ func (cb *ZVControllerBuilder) withOpenEBSClient(cs clientset.Interface) *ZVCont
|
|||
|
||||
// withZVLister fills zv lister to controller object.
|
||||
func (cb *ZVControllerBuilder) withZVLister(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||
zvInformer := sl.Openebs().V1alpha1().ZFSVolumes()
|
||||
zvInformer := sl.Zfs().V1alpha1().ZFSVolumes()
|
||||
cb.ZVController.zvLister = zvInformer.Lister()
|
||||
return cb
|
||||
}
|
||||
|
||||
// withZVSynced adds object sync information in cache to controller object.
|
||||
func (cb *ZVControllerBuilder) withZVSynced(sl informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||
zvInformer := sl.Openebs().V1alpha1().ZFSVolumes()
|
||||
zvInformer := sl.Zfs().V1alpha1().ZFSVolumes()
|
||||
cb.ZVController.zvSynced = zvInformer.Informer().HasSynced
|
||||
return cb
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ func (cb *ZVControllerBuilder) withRecorder(ks kubernetes.Interface) *ZVControll
|
|||
|
||||
// withEventHandler adds event handlers controller object.
|
||||
func (cb *ZVControllerBuilder) withEventHandler(cvcInformerFactory informers.SharedInformerFactory) *ZVControllerBuilder {
|
||||
cvcInformer := cvcInformerFactory.Openebs().V1alpha1().ZFSVolumes()
|
||||
cvcInformer := cvcInformerFactory.Zfs().V1alpha1().ZFSVolumes()
|
||||
// Set up an event handler for when ZV resources change
|
||||
cvcInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
|
||||
AddFunc: cb.ZVController.addZV,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue