update dependencies

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-12-22 16:48:26 +08:00
parent 4a11a50544
commit fe6c5de00f
2857 changed files with 252134 additions and 115656 deletions

View File

@@ -17,24 +17,22 @@ limitations under the License.
package application
import (
"k8s.io/apimachinery/pkg/labels"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha2"
"kubesphere.io/kubesphere/pkg/server/params"
"sigs.k8s.io/application/pkg/apis/app/v1beta1"
"sigs.k8s.io/application/pkg/client/informers/externalversions"
"sort"
"sigs.k8s.io/application/api/v1beta1"
)
type appSearcher struct {
informer externalversions.SharedInformerFactory
//informer externalversions.SharedInformerFactory
}
func NewApplicationSearcher(informers externalversions.SharedInformerFactory) v1alpha2.Interface {
return &appSearcher{informer: informers}
func NewApplicationSearcher(informers interface{}) v1alpha2.Interface {
return &appSearcher{}
}
func (s *appSearcher) Get(namespace, name string) (interface{}, error) {
return s.informer.App().V1beta1().Applications().Lister().Applications(namespace).Get(name)
//return s.informer.App().V1beta1().Applications().Lister().Applications(namespace).Get(name)
panic("")
}
func (s *appSearcher) match(match map[string]string, item *v1beta1.Application) bool {
@@ -56,33 +54,34 @@ func (s *appSearcher) fuzzy(fuzzy map[string]string, item *v1beta1.Application)
}
func (s *appSearcher) Search(namespace string, conditions *params.Conditions, orderBy string, reverse bool) ([]interface{}, error) {
apps, err := s.informer.App().V1beta1().Applications().Lister().Applications(namespace).List(labels.Everything())
if err != nil {
return nil, err
}
result := make([]*v1beta1.Application, 0)
if len(conditions.Match) == 0 && len(conditions.Fuzzy) == 0 {
result = apps
} else {
for _, item := range apps {
if s.match(conditions.Match, item) && s.fuzzy(conditions.Fuzzy, item) {
result = append(result, item)
}
}
}
sort.Slice(result, func(i, j int) bool {
if reverse {
i, j = j, i
}
return v1alpha2.ObjectMetaCompare(result[i].ObjectMeta, result[j].ObjectMeta, orderBy)
})
r := make([]interface{}, 0)
for _, i := range result {
r = append(r, i)
}
return r, nil
//apps, err := s.informer.App().V1beta1().Applications().Lister().Applications(namespace).List(labels.Everything())
//
//if err != nil {
// return nil, err
//}
//
//result := make([]*v1beta1.Application, 0)
//
//if len(conditions.Match) == 0 && len(conditions.Fuzzy) == 0 {
// result = apps
//} else {
// for _, item := range apps {
// if s.match(conditions.Match, item) && s.fuzzy(conditions.Fuzzy, item) {
// result = append(result, item)
// }
// }
//}
//sort.Slice(result, func(i, j int) bool {
// if reverse {
// i, j = j, i
// }
// return v1alpha2.ObjectMetaCompare(result[i].ObjectMeta, result[j].ObjectMeta, orderBy)
//})
//
//r := make([]interface{}, 0)
//for _, i := range result {
// r = append(r, i)
//}
//return r, nil
panic("")
}

View File

@@ -17,7 +17,7 @@ limitations under the License.
package persistentvolumeclaim
import (
snapshotinformer "github.com/kubernetes-csi/external-snapshotter/v2/pkg/client/informers/externalversions"
snapshotinformer "github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions"
"k8s.io/client-go/informers"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha2"
"strconv"

View File

@@ -18,7 +18,7 @@ package resource
import (
"github.com/google/go-cmp/cmp"
fakesnapshot "github.com/kubernetes-csi/external-snapshotter/v2/pkg/client/clientset/versioned/fake"
fakesnapshot "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned/fake"
fakeistio "istio.io/client-go/pkg/clientset/versioned/fake"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
@@ -29,7 +29,7 @@ import (
"kubesphere.io/kubesphere/pkg/models"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha2"
"kubesphere.io/kubesphere/pkg/server/params"
fakeapp "sigs.k8s.io/application/pkg/client/clientset/versioned/fake"
fakeapp "kubesphere.io/kubesphere/pkg/simple/client/app/clientset/versioned/fake"
"testing"
)

View File

@@ -84,7 +84,7 @@ func NewResourceGetter(factory informers.InformerFactory) *ResourceGetter {
resourceGetters[v1alpha2.S2iRuns] = s2irun.NewS2iRunSearcher(factory.KubeSphereSharedInformerFactory())
resourceGetters[v1alpha2.S2iBuilderTemplates] = s2buildertemplate.NewS2iBuidlerTemplateSearcher(factory.KubeSphereSharedInformerFactory())
resourceGetters[v1alpha2.Workspaces] = workspace.NewWorkspaceSearcher(factory.KubeSphereSharedInformerFactory())
resourceGetters[v1alpha2.Applications] = application.NewApplicationSearcher(factory.ApplicationSharedInformerFactory())
resourceGetters[v1alpha2.Applications] = application.NewApplicationSearcher(nil)
return &ResourceGetter{resourcesGetters: resourceGetters}

View File

@@ -17,7 +17,7 @@ limitations under the License.
package storageclass
import (
snapshotinformer "github.com/kubernetes-csi/external-snapshotter/v2/pkg/client/informers/externalversions"
snapshotinformer "github.com/kubernetes-csi/external-snapshotter/client/v3/informers/externalversions"
corev1 "k8s.io/api/core/v1"
"k8s.io/api/storage/v1"
"k8s.io/apimachinery/pkg/labels"