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:
Prateek Pandey 2020-04-01 17:54:20 +05:30 committed by GitHub
parent 8a9ac43ab5
commit 6033789c17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 509 additions and 82 deletions

View file

@ -52,11 +52,11 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=openebs.io, Version=v1alpha1
// Group=zfs.openebs.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("zfssnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Openebs().V1alpha1().ZFSSnapshots().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1alpha1().ZFSSnapshots().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("zfsvolumes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Openebs().V1alpha1().ZFSVolumes().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1alpha1().ZFSVolumes().Informer()}, nil
}