mirror of https://github.com/k3s-io/k3s
Merge pull request #355 from brendandburns/kubecfg
Make sync false by default. Works around timeout/retry issues.pull/6/head
commit
9d001564bf
|
@ -46,7 +46,7 @@ func (c *Client) Verb(verb string) *Request {
|
|||
verb: verb,
|
||||
c: c,
|
||||
path: "/api/v1beta1",
|
||||
sync: true,
|
||||
sync: false,
|
||||
timeout: 20 * time.Second,
|
||||
pollPeriod: 20 * time.Second,
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ func TestDoRequestNewWay(t *testing.T) {
|
|||
t.Errorf("Expected: %#v, got %#v", expectedObj, obj)
|
||||
}
|
||||
fakeHandler.ValidateRequest(t, "/api/v1beta1/foo/bar/baz", "POST", &reqBody)
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo&sync=true&timeout=1s" {
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo" {
|
||||
t.Errorf("Unexpected query: %v", fakeHandler.RequestReceived.URL.RawQuery)
|
||||
}
|
||||
if fakeHandler.RequestReceived.Header["Authorization"] == nil {
|
||||
|
@ -138,7 +138,7 @@ func TestDoRequestNewWayObj(t *testing.T) {
|
|||
}
|
||||
tmpStr := string(reqBodyExpected)
|
||||
fakeHandler.ValidateRequest(t, "/api/v1beta1/foo/bar/baz", "POST", &tmpStr)
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo&sync=true&timeout=1s" {
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo" {
|
||||
t.Errorf("Unexpected query: %v", fakeHandler.RequestReceived.URL.RawQuery)
|
||||
}
|
||||
if fakeHandler.RequestReceived.Header["Authorization"] == nil {
|
||||
|
@ -183,7 +183,7 @@ func TestDoRequestNewWayFile(t *testing.T) {
|
|||
}
|
||||
tmpStr := string(reqBodyExpected)
|
||||
fakeHandler.ValidateRequest(t, "/api/v1beta1/foo/bar/baz", "POST", &tmpStr)
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo&sync=true&timeout=1s" {
|
||||
if fakeHandler.RequestReceived.URL.RawQuery != "labels=name%3Dfoo" {
|
||||
t.Errorf("Unexpected query: %v", fakeHandler.RequestReceived.URL.RawQuery)
|
||||
}
|
||||
if fakeHandler.RequestReceived.Header["Authorization"] == nil {
|
||||
|
@ -219,7 +219,7 @@ func TestAbsPath(t *testing.T) {
|
|||
func TestSync(t *testing.T) {
|
||||
c := New("", nil)
|
||||
r := c.Get()
|
||||
if !r.sync {
|
||||
if r.sync {
|
||||
t.Errorf("sync has wrong default")
|
||||
}
|
||||
r.Sync(false)
|
||||
|
|
Loading…
Reference in New Issue