Follow kubernetes APIs directory structure (#1497)
This commit is contained in:
@@ -39,7 +39,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/fission.io/v1"
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
ferror "github.com/fission/fission/pkg/error"
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@ func (a *API) FunctionApiList(w http.ResponseWriter, r *http.Request) {
|
||||
ns = metav1.NamespaceAll
|
||||
}
|
||||
|
||||
funcs, err := a.fissionClient.V1().Functions(ns).List(metav1.ListOptions{})
|
||||
funcs, err := a.fissionClient.CoreV1().Functions(ns).List(metav1.ListOptions{})
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
@@ -152,7 +152,7 @@ func (a *API) FunctionApiCreate(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
fnew, err := a.fissionClient.V1().Functions(f.ObjectMeta.Namespace).Create(&f)
|
||||
fnew, err := a.fissionClient.CoreV1().Functions(f.ObjectMeta.Namespace).Create(&f)
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
@@ -176,7 +176,7 @@ func (a *API) FunctionApiGet(w http.ResponseWriter, r *http.Request) {
|
||||
ns = metav1.NamespaceDefault
|
||||
}
|
||||
|
||||
f, err := a.fissionClient.V1().Functions(ns).Get(name, metav1.GetOptions{})
|
||||
f, err := a.fissionClient.CoreV1().Functions(ns).Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
@@ -213,7 +213,7 @@ func (a *API) FunctionApiUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
fnew, err := a.fissionClient.V1().Functions(f.ObjectMeta.Namespace).Update(&f)
|
||||
fnew, err := a.fissionClient.CoreV1().Functions(f.ObjectMeta.Namespace).Update(&f)
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
@@ -235,7 +235,7 @@ func (a *API) FunctionApiDelete(w http.ResponseWriter, r *http.Request) {
|
||||
ns = metav1.NamespaceDefault
|
||||
}
|
||||
|
||||
err := a.fissionClient.V1().Functions(ns).Delete(name, &metav1.DeleteOptions{})
|
||||
err := a.fissionClient.CoreV1().Functions(ns).Delete(name, &metav1.DeleteOptions{})
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
@@ -298,7 +298,7 @@ func (a *API) FunctionPodLogs(w http.ResponseWriter, r *http.Request) {
|
||||
podNs = ns
|
||||
}
|
||||
|
||||
f, err := a.fissionClient.V1().Functions(ns).Get(fnName, metav1.GetOptions{})
|
||||
f, err := a.fissionClient.CoreV1().Functions(ns).Get(fnName, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
a.respondWithError(w, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user