Skip to content

Commit ee1cafd

Browse files
add econcoder/json
1 parent ed5db3d commit ee1cafd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/namespaces.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/gorilla/mux"
77
v1 "k8s.io/api/core/v1"
88
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9-
"log"
109
"main/configkub"
1110
"net/http"
1211
)
@@ -29,7 +28,7 @@ func GetNs(w http.ResponseWriter, r *http.Request) {
2928
}
3029
ns, err := api.Namespaces().List(listOptions)
3130
if err != nil {
32-
log.Fatal(err)
31+
json.NewEncoder(w).Encode(err)
3332
}
3433

3534
json.NewEncoder(w).Encode(ns)

0 commit comments

Comments
 (0)