Change groupName to groupsnapshot.storage.k8s.io

This commit is contained in:
Raunak Pradip Shah
2023-03-01 11:20:20 +05:30
parent db21ddde42
commit 9ce31d0bf8
23 changed files with 78 additions and 115 deletions

View File

@@ -244,11 +244,11 @@ type SharedInformerFactory interface {
// client.
InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer
GroupSnapshot() volumegroupsnapshot.Interface
Groupsnapshot() volumegroupsnapshot.Interface
Snapshot() volumesnapshot.Interface
}
func (f *sharedInformerFactory) GroupSnapshot() volumegroupsnapshot.Interface {
func (f *sharedInformerFactory) Groupsnapshot() volumegroupsnapshot.Interface {
return volumegroupsnapshot.New(f, f.namespace, f.tweakListOptions)
}

View File

@@ -53,7 +53,15 @@ 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=snapshot.storage.k8s.io, Version=v1
// Group=groupsnapshot.storage.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshots().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshotClasses().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshotContents().Informer()}, nil
// Group=snapshot.storage.k8s.io, Version=v1
case v1.SchemeGroupVersion.WithResource("volumesnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshots().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("volumesnapshotclasses"):
@@ -61,14 +69,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case v1.SchemeGroupVersion.WithResource("volumesnapshotcontents"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshotContents().Informer()}, nil
// Group=snapshot.storage.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshots().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshotClasses().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents"):
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshotContents().Informer()}, nil
}
return nil, fmt.Errorf("no informer found for %v", resource)

View File

@@ -62,13 +62,13 @@ func NewFilteredVolumeGroupSnapshotInformer(client versioned.Interface, namespac
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshots(namespace).List(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshots(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshots(namespace).Watch(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshots(namespace).Watch(context.TODO(), options)
},
},
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshot{},

View File

@@ -61,13 +61,13 @@ func NewFilteredVolumeGroupSnapshotClassInformer(client versioned.Interface, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshotClasses().List(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotClasses().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshotClasses().Watch(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotClasses().Watch(context.TODO(), options)
},
},
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotClass{},

View File

@@ -61,13 +61,13 @@ func NewFilteredVolumeGroupSnapshotContentInformer(client versioned.Interface, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshotContents().List(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotContents().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.SnapshotV1alpha1().VolumeGroupSnapshotContents().Watch(context.TODO(), options)
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotContents().Watch(context.TODO(), options)
},
},
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotContent{},