Update k8s client version to 4.0.0 (#351)
Move to client-go v4.0.0 from 1.5.
This commit is contained in:
committed by
Soam Vasani
parent
e4d42797e6
commit
a25c167d23
@@ -20,7 +20,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"k8s.io/client-go/1.5/pkg/api"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
"github.com/fission/fission"
|
||||
"github.com/fission/fission/cache"
|
||||
@@ -38,10 +38,10 @@ const (
|
||||
|
||||
type (
|
||||
funcSvc struct {
|
||||
function *api.ObjectMeta // function this pod/service is for
|
||||
environment *tpr.Environment // function's environment
|
||||
address string // Host:Port or IP:Port that the function's service can be reached at.
|
||||
podName string // pod name (within the function namespace)
|
||||
function *metav1.ObjectMeta // function this pod/service is for
|
||||
environment *tpr.Environment // function's environment
|
||||
address string // Host:Port or IP:Port that the function's service can be reached at.
|
||||
podName string // pod name (within the function namespace)
|
||||
|
||||
ctime time.Time
|
||||
atime time.Time
|
||||
@@ -49,8 +49,8 @@ type (
|
||||
|
||||
functionServiceCache struct {
|
||||
byFunction *cache.Cache // function-key -> funcSvc : map[string]*funcSvc
|
||||
byAddress *cache.Cache // address -> function : map[string]api.ObjectMeta
|
||||
byPod *cache.Cache // podname -> function : map[string]api.ObjectMeta
|
||||
byAddress *cache.Cache // address -> function : map[string]metav1.ObjectMeta
|
||||
byPod *cache.Cache // podname -> function : map[string]metav1.ObjectMeta
|
||||
|
||||
requestChannel chan *fscRequest
|
||||
}
|
||||
@@ -59,7 +59,7 @@ type (
|
||||
address string
|
||||
podName string
|
||||
age time.Duration
|
||||
env *api.ObjectMeta // used for ListOld
|
||||
env *metav1.ObjectMeta // used for ListOld
|
||||
responseChannel chan *fscResponse
|
||||
}
|
||||
fscResponse struct {
|
||||
@@ -93,7 +93,7 @@ func (fsc *functionServiceCache) service() {
|
||||
byPodCopy := fsc.byPod.Copy()
|
||||
pods := make([]string, 0)
|
||||
for podNameI, mI := range byPodCopy {
|
||||
m := mI.(api.ObjectMeta)
|
||||
m := mI.(metav1.ObjectMeta)
|
||||
fsvcI, err := fsc.byFunction.Get(tpr.CacheKey(&m))
|
||||
if err != nil {
|
||||
resp.error = err
|
||||
@@ -122,7 +122,7 @@ func (fsc *functionServiceCache) service() {
|
||||
}
|
||||
}
|
||||
|
||||
func (fsc *functionServiceCache) GetByFunction(m *api.ObjectMeta) (*funcSvc, error) {
|
||||
func (fsc *functionServiceCache) GetByFunction(m *metav1.ObjectMeta) (*funcSvc, error) {
|
||||
key := tpr.CacheKey(m)
|
||||
|
||||
fsvcI, err := fsc.byFunction.Get(key)
|
||||
@@ -198,7 +198,7 @@ func (fsc *functionServiceCache) _touchByAddress(address string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m := mI.(api.ObjectMeta)
|
||||
m := mI.(metav1.ObjectMeta)
|
||||
fsvcI, err := fsc.byFunction.Get(tpr.CacheKey(&m))
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -227,7 +227,7 @@ func (fsc *functionServiceCache) _deleteByPod(podName string, minAge time.Durati
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
m := mI.(api.ObjectMeta)
|
||||
m := mI.(metav1.ObjectMeta)
|
||||
fsvcI, err := fsc.byFunction.Get(tpr.CacheKey(&m))
|
||||
if err != nil {
|
||||
return false, err
|
||||
@@ -244,7 +244,7 @@ func (fsc *functionServiceCache) _deleteByPod(podName string, minAge time.Durati
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (fsc *functionServiceCache) ListOld(env *api.ObjectMeta, age time.Duration) ([]string, error) {
|
||||
func (fsc *functionServiceCache) ListOld(env *metav1.ObjectMeta, age time.Duration) ([]string, error) {
|
||||
responseChannel := make(chan *fscResponse)
|
||||
fsc.requestChannel <- &fscRequest{
|
||||
requestType: LISTOLD,
|
||||
|
||||
Reference in New Issue
Block a user