Enable more linters, and remove mal-functioned milestoned issue action.

Signed-off-by: Xun Jiang <blackpiglet@gmail.com>
This commit is contained in:
Xun Jiang
2023-04-25 23:31:51 +08:00
parent a0b0b7cd9b
commit 443f732e51
19 changed files with 49 additions and 65 deletions
+1 -1
View File
@@ -617,7 +617,7 @@ func (s *server) getCSIVolumeSnapshotListers() (vsLister snapshotv1listers.Volum
s.logger.Errorf("fail to find snapshot v1 schema: %s", err)
}
return
return vsLister, err
}
func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string) error {
+14 -14
View File
@@ -149,71 +149,71 @@ func printTable(cmd *cobra.Command, obj runtime.Object) (bool, error) {
// 1. generate table
var table *metav1.Table
switch obj.(type) {
switch objType := obj.(type) {
case *velerov1api.Backup:
table = &metav1.Table{
ColumnDefinitions: backupColumns,
Rows: printBackup(obj.(*velerov1api.Backup)),
Rows: printBackup(objType),
}
case *velerov1api.BackupList:
table = &metav1.Table{
ColumnDefinitions: backupColumns,
Rows: printBackupList(obj.(*velerov1api.BackupList)),
Rows: printBackupList(objType),
}
case *velerov1api.Restore:
table = &metav1.Table{
ColumnDefinitions: restoreColumns,
Rows: printRestore(obj.(*velerov1api.Restore)),
Rows: printRestore(objType),
}
case *velerov1api.RestoreList:
table = &metav1.Table{
ColumnDefinitions: restoreColumns,
Rows: printRestoreList(obj.(*velerov1api.RestoreList)),
Rows: printRestoreList(objType),
}
case *velerov1api.Schedule:
table = &metav1.Table{
ColumnDefinitions: scheduleColumns,
Rows: printSchedule(obj.(*velerov1api.Schedule)),
Rows: printSchedule(objType),
}
case *velerov1api.ScheduleList:
table = &metav1.Table{
ColumnDefinitions: scheduleColumns,
Rows: printScheduleList(obj.(*velerov1api.ScheduleList)),
Rows: printScheduleList(objType),
}
case *velerov1api.BackupRepository:
table = &metav1.Table{
ColumnDefinitions: backupRepoColumns,
Rows: printBackupRepo(obj.(*velerov1api.BackupRepository)),
Rows: printBackupRepo(objType),
}
case *velerov1api.BackupRepositoryList:
table = &metav1.Table{
ColumnDefinitions: backupRepoColumns,
Rows: printBackupRepoList(obj.(*velerov1api.BackupRepositoryList)),
Rows: printBackupRepoList(objType),
}
case *velerov1api.BackupStorageLocation:
table = &metav1.Table{
ColumnDefinitions: backupStorageLocationColumns,
Rows: printBackupStorageLocation(obj.(*velerov1api.BackupStorageLocation)),
Rows: printBackupStorageLocation(objType),
}
case *velerov1api.BackupStorageLocationList:
table = &metav1.Table{
ColumnDefinitions: backupStorageLocationColumns,
Rows: printBackupStorageLocationList(obj.(*velerov1api.BackupStorageLocationList)),
Rows: printBackupStorageLocationList(objType),
}
case *velerov1api.VolumeSnapshotLocation:
table = &metav1.Table{
ColumnDefinitions: volumeSnapshotLocationColumns,
Rows: printVolumeSnapshotLocation(obj.(*velerov1api.VolumeSnapshotLocation)),
Rows: printVolumeSnapshotLocation(objType),
}
case *velerov1api.VolumeSnapshotLocationList:
table = &metav1.Table{
ColumnDefinitions: volumeSnapshotLocationColumns,
Rows: printVolumeSnapshotLocationList(obj.(*velerov1api.VolumeSnapshotLocationList)),
Rows: printVolumeSnapshotLocationList(objType),
}
case *velerov1api.ServerStatusRequest:
table = &metav1.Table{
ColumnDefinitions: pluginColumns,
Rows: printPluginList(obj.(*velerov1api.ServerStatusRequest)),
Rows: printPluginList(objType),
}
default:
return false, errors.Errorf("type %T is not supported", obj)