mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor update for CSI 0.3.0
This commit is contained in:
4
vendor/k8s.io/kubernetes/pkg/util/configz/configz.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/util/configz/configz.go
generated
vendored
@ -19,7 +19,6 @@ package configz
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"sync"
|
||||
)
|
||||
@ -74,7 +73,7 @@ func handle(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func write(w io.Writer) error {
|
||||
func write(w http.ResponseWriter) error {
|
||||
var b []byte
|
||||
var err error
|
||||
func() {
|
||||
@ -85,6 +84,7 @@ func write(w io.Writer) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("error marshaling json: %v", err)
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, err = w.Write(b)
|
||||
return err
|
||||
}
|
||||
|
9
vendor/k8s.io/kubernetes/pkg/util/configz/configz_test.go
generated
vendored
9
vendor/k8s.io/kubernetes/pkg/util/configz/configz_test.go
generated
vendored
@ -44,7 +44,7 @@ func TestConfigz(t *testing.T) {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if string(body) != `{"testing":"blah"}` {
|
||||
t.Fatalf("unexpected output: %v", err)
|
||||
t.Fatalf("unexpected output: %s", body)
|
||||
}
|
||||
|
||||
v.Set("bing")
|
||||
@ -58,7 +58,7 @@ func TestConfigz(t *testing.T) {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if string(body) != `{"testing":"bing"}` {
|
||||
t.Fatalf("unexpected output: %v", err)
|
||||
t.Fatalf("unexpected output: %s", body)
|
||||
}
|
||||
|
||||
Delete("testing")
|
||||
@ -72,6 +72,9 @@ func TestConfigz(t *testing.T) {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if string(body) != `{}` {
|
||||
t.Fatalf("unexpected output: %v", err)
|
||||
t.Fatalf("unexpected output: %s", body)
|
||||
}
|
||||
if resp.Header.Get("Content-Type") != "application/json" {
|
||||
t.Fatalf("unexpected Content-Type: %s", resp.Header.Get("Content-Type"))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user