feat: migrate kubebuilder from v2 to v3

1. remove config/crd/v1beta1
2. remove PROJECT file
3. update controller-gen and kubebuilder version
4. generate client and CRD file
5. add changelog and remove v1beta1 CRD generated code.
6. add kubebuilder test bundle setup command.
7. due to apiextensions.k8s.io/v1beta1 is not supported, only k8s after v1.16 is supported, so remove v1.15 check.
8. add CRD and k8s suppored version update in changelog.

Signed-off-by: Xun Jiang <jxun@vmware.com>
This commit is contained in:
Xun Jiang
2021-11-23 19:32:19 +08:00
parent 11abff4e8d
commit 303d3dcad3
46 changed files with 120 additions and 3796 deletions
@@ -74,7 +74,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
return c.tracker
}
var _ clientset.Interface = &Clientset{}
var (
_ clientset.Interface = &Clientset{}
_ testing.FakeClient = &Clientset{}
)
// VeleroV1 retrieves the VeleroV1Client
func (c *Clientset) VeleroV1() velerov1.VeleroV1Interface {
@@ -29,7 +29,7 @@ import (
var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
velerov1.AddToScheme,
}
@@ -26,8 +26,10 @@ import (
)
// BackupLister helps list Backups.
// All objects returned here must be treated as read-only.
type BackupLister interface {
// List lists all Backups in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Backup, err error)
// Backups returns an object that can list and get Backups.
Backups(namespace string) BackupNamespaceLister
@@ -58,10 +60,13 @@ func (s *backupLister) Backups(namespace string) BackupNamespaceLister {
}
// BackupNamespaceLister helps list and get Backups.
// All objects returned here must be treated as read-only.
type BackupNamespaceLister interface {
// List lists all Backups in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Backup, err error)
// Get retrieves the Backup from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.Backup, error)
BackupNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// BackupStorageLocationLister helps list BackupStorageLocations.
// All objects returned here must be treated as read-only.
type BackupStorageLocationLister interface {
// List lists all BackupStorageLocations in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error)
// BackupStorageLocations returns an object that can list and get BackupStorageLocations.
BackupStorageLocations(namespace string) BackupStorageLocationNamespaceLister
@@ -58,10 +60,13 @@ func (s *backupStorageLocationLister) BackupStorageLocations(namespace string) B
}
// BackupStorageLocationNamespaceLister helps list and get BackupStorageLocations.
// All objects returned here must be treated as read-only.
type BackupStorageLocationNamespaceLister interface {
// List lists all BackupStorageLocations in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error)
// Get retrieves the BackupStorageLocation from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.BackupStorageLocation, error)
BackupStorageLocationNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// DeleteBackupRequestLister helps list DeleteBackupRequests.
// All objects returned here must be treated as read-only.
type DeleteBackupRequestLister interface {
// List lists all DeleteBackupRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error)
// DeleteBackupRequests returns an object that can list and get DeleteBackupRequests.
DeleteBackupRequests(namespace string) DeleteBackupRequestNamespaceLister
@@ -58,10 +60,13 @@ func (s *deleteBackupRequestLister) DeleteBackupRequests(namespace string) Delet
}
// DeleteBackupRequestNamespaceLister helps list and get DeleteBackupRequests.
// All objects returned here must be treated as read-only.
type DeleteBackupRequestNamespaceLister interface {
// List lists all DeleteBackupRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error)
// Get retrieves the DeleteBackupRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.DeleteBackupRequest, error)
DeleteBackupRequestNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// DownloadRequestLister helps list DownloadRequests.
// All objects returned here must be treated as read-only.
type DownloadRequestLister interface {
// List lists all DownloadRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
// DownloadRequests returns an object that can list and get DownloadRequests.
DownloadRequests(namespace string) DownloadRequestNamespaceLister
@@ -58,10 +60,13 @@ func (s *downloadRequestLister) DownloadRequests(namespace string) DownloadReque
}
// DownloadRequestNamespaceLister helps list and get DownloadRequests.
// All objects returned here must be treated as read-only.
type DownloadRequestNamespaceLister interface {
// List lists all DownloadRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
// Get retrieves the DownloadRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.DownloadRequest, error)
DownloadRequestNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// PodVolumeBackupLister helps list PodVolumeBackups.
// All objects returned here must be treated as read-only.
type PodVolumeBackupLister interface {
// List lists all PodVolumeBackups in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
// PodVolumeBackups returns an object that can list and get PodVolumeBackups.
PodVolumeBackups(namespace string) PodVolumeBackupNamespaceLister
@@ -58,10 +60,13 @@ func (s *podVolumeBackupLister) PodVolumeBackups(namespace string) PodVolumeBack
}
// PodVolumeBackupNamespaceLister helps list and get PodVolumeBackups.
// All objects returned here must be treated as read-only.
type PodVolumeBackupNamespaceLister interface {
// List lists all PodVolumeBackups in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
// Get retrieves the PodVolumeBackup from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.PodVolumeBackup, error)
PodVolumeBackupNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// PodVolumeRestoreLister helps list PodVolumeRestores.
// All objects returned here must be treated as read-only.
type PodVolumeRestoreLister interface {
// List lists all PodVolumeRestores in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
// PodVolumeRestores returns an object that can list and get PodVolumeRestores.
PodVolumeRestores(namespace string) PodVolumeRestoreNamespaceLister
@@ -58,10 +60,13 @@ func (s *podVolumeRestoreLister) PodVolumeRestores(namespace string) PodVolumeRe
}
// PodVolumeRestoreNamespaceLister helps list and get PodVolumeRestores.
// All objects returned here must be treated as read-only.
type PodVolumeRestoreNamespaceLister interface {
// List lists all PodVolumeRestores in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
// Get retrieves the PodVolumeRestore from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.PodVolumeRestore, error)
PodVolumeRestoreNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// ResticRepositoryLister helps list ResticRepositories.
// All objects returned here must be treated as read-only.
type ResticRepositoryLister interface {
// List lists all ResticRepositories in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ResticRepository, err error)
// ResticRepositories returns an object that can list and get ResticRepositories.
ResticRepositories(namespace string) ResticRepositoryNamespaceLister
@@ -58,10 +60,13 @@ func (s *resticRepositoryLister) ResticRepositories(namespace string) ResticRepo
}
// ResticRepositoryNamespaceLister helps list and get ResticRepositories.
// All objects returned here must be treated as read-only.
type ResticRepositoryNamespaceLister interface {
// List lists all ResticRepositories in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ResticRepository, err error)
// Get retrieves the ResticRepository from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ResticRepository, error)
ResticRepositoryNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// RestoreLister helps list Restores.
// All objects returned here must be treated as read-only.
type RestoreLister interface {
// List lists all Restores in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Restore, err error)
// Restores returns an object that can list and get Restores.
Restores(namespace string) RestoreNamespaceLister
@@ -58,10 +60,13 @@ func (s *restoreLister) Restores(namespace string) RestoreNamespaceLister {
}
// RestoreNamespaceLister helps list and get Restores.
// All objects returned here must be treated as read-only.
type RestoreNamespaceLister interface {
// List lists all Restores in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Restore, err error)
// Get retrieves the Restore from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.Restore, error)
RestoreNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// ScheduleLister helps list Schedules.
// All objects returned here must be treated as read-only.
type ScheduleLister interface {
// List lists all Schedules in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Schedule, err error)
// Schedules returns an object that can list and get Schedules.
Schedules(namespace string) ScheduleNamespaceLister
@@ -58,10 +60,13 @@ func (s *scheduleLister) Schedules(namespace string) ScheduleNamespaceLister {
}
// ScheduleNamespaceLister helps list and get Schedules.
// All objects returned here must be treated as read-only.
type ScheduleNamespaceLister interface {
// List lists all Schedules in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.Schedule, err error)
// Get retrieves the Schedule from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.Schedule, error)
ScheduleNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// ServerStatusRequestLister helps list ServerStatusRequests.
// All objects returned here must be treated as read-only.
type ServerStatusRequestLister interface {
// List lists all ServerStatusRequests in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error)
// ServerStatusRequests returns an object that can list and get ServerStatusRequests.
ServerStatusRequests(namespace string) ServerStatusRequestNamespaceLister
@@ -58,10 +60,13 @@ func (s *serverStatusRequestLister) ServerStatusRequests(namespace string) Serve
}
// ServerStatusRequestNamespaceLister helps list and get ServerStatusRequests.
// All objects returned here must be treated as read-only.
type ServerStatusRequestNamespaceLister interface {
// List lists all ServerStatusRequests in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error)
// Get retrieves the ServerStatusRequest from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.ServerStatusRequest, error)
ServerStatusRequestNamespaceListerExpansion
}
@@ -26,8 +26,10 @@ import (
)
// VolumeSnapshotLocationLister helps list VolumeSnapshotLocations.
// All objects returned here must be treated as read-only.
type VolumeSnapshotLocationLister interface {
// List lists all VolumeSnapshotLocations in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error)
// VolumeSnapshotLocations returns an object that can list and get VolumeSnapshotLocations.
VolumeSnapshotLocations(namespace string) VolumeSnapshotLocationNamespaceLister
@@ -58,10 +60,13 @@ func (s *volumeSnapshotLocationLister) VolumeSnapshotLocations(namespace string)
}
// VolumeSnapshotLocationNamespaceLister helps list and get VolumeSnapshotLocations.
// All objects returned here must be treated as read-only.
type VolumeSnapshotLocationNamespaceLister interface {
// List lists all VolumeSnapshotLocations in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error)
// Get retrieves the VolumeSnapshotLocation from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1.VolumeSnapshotLocation, error)
VolumeSnapshotLocationNamespaceListerExpansion
}