Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7897ea8c
Commit
7897ea8c
authored
Jan 27, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove httpstream dependency on pkg/api
parent
674d78b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
httpstream_test.go
...8s.io/apimachinery/pkg/util/httpstream/httpstream_test.go
+1
-3
roundtripper.go
....io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go
+15
-2
BUILD
vendor/BUILD
+2
-2
No files found.
staging/src/k8s.io/apimachinery/pkg/util/httpstream/httpstream_test.go
View file @
7897ea8c
...
@@ -20,8 +20,6 @@ import (
...
@@ -20,8 +20,6 @@ import (
"net/http"
"net/http"
"reflect"
"reflect"
"testing"
"testing"
"k8s.io/kubernetes/pkg/api"
)
)
type
responseWriter
struct
{
type
responseWriter
struct
{
...
@@ -120,7 +118,7 @@ func TestHandshake(t *testing.T) {
...
@@ -120,7 +118,7 @@ func TestHandshake(t *testing.T) {
}
}
// verify response headers
// verify response headers
if
e
,
a
:=
[]
string
{
test
.
expectedProtocol
},
w
.
Header
()[
HeaderProtocolVersion
];
!
api
.
Semantic
.
DeepEqual
(
e
,
a
)
{
if
e
,
a
:=
[]
string
{
test
.
expectedProtocol
},
w
.
Header
()[
HeaderProtocolVersion
];
!
reflect
.
DeepEqual
(
e
,
a
)
{
t
.
Errorf
(
"%s: protocol response header: expected %v, got %v"
,
name
,
e
,
a
)
t
.
Errorf
(
"%s: protocol response header: expected %v, got %v"
,
name
,
e
,
a
)
}
}
}
}
...
...
staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go
View file @
7897ea8c
...
@@ -30,9 +30,10 @@ import (
...
@@ -30,9 +30,10 @@ import (
apierrors
"k8s.io/apimachinery/pkg/api/errors"
apierrors
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/httpstream"
"k8s.io/apimachinery/pkg/util/httpstream"
"k8s.io/apimachinery/third_party/forked/golang/netutil"
"k8s.io/apimachinery/third_party/forked/golang/netutil"
"k8s.io/kubernetes/pkg/api"
)
)
// SpdyRoundTripper knows how to upgrade an HTTP request to one that supports
// SpdyRoundTripper knows how to upgrade an HTTP request to one that supports
...
@@ -251,7 +252,7 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec
...
@@ -251,7 +252,7 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec
responseError
=
"unable to read error from server response"
responseError
=
"unable to read error from server response"
}
else
{
}
else
{
// TODO: I don't belong here, I should be abstracted from this class
// TODO: I don't belong here, I should be abstracted from this class
if
obj
,
_
,
err
:=
api
.
Codecs
.
UniversalDecoder
()
.
Decode
(
responseErrorBytes
,
nil
,
&
metav1
.
Status
{});
err
==
nil
{
if
obj
,
_
,
err
:=
status
Codecs
.
UniversalDecoder
()
.
Decode
(
responseErrorBytes
,
nil
,
&
metav1
.
Status
{});
err
==
nil
{
if
status
,
ok
:=
obj
.
(
*
metav1
.
Status
);
ok
{
if
status
,
ok
:=
obj
.
(
*
metav1
.
Status
);
ok
{
return
nil
,
&
apierrors
.
StatusError
{
ErrStatus
:
*
status
}
return
nil
,
&
apierrors
.
StatusError
{
ErrStatus
:
*
status
}
}
}
...
@@ -265,3 +266,15 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec
...
@@ -265,3 +266,15 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec
return
NewClientConnection
(
s
.
conn
)
return
NewClientConnection
(
s
.
conn
)
}
}
// statusScheme is private scheme for the decoding here until someone fixes the TODO in NewConnection
var
statusScheme
=
runtime
.
NewScheme
()
// ParameterCodec knows about query parameters used with the meta v1 API spec.
var
statusCodecs
=
serializer
.
NewCodecFactory
(
statusScheme
)
func
init
()
{
statusScheme
.
AddUnversionedTypes
(
metav1
.
SchemeGroupVersion
,
&
metav1
.
Status
{},
)
}
vendor/BUILD
View file @
7897ea8c
...
@@ -13827,7 +13827,6 @@ go_test(
...
@@ -13827,7 +13827,6 @@ go_test(
srcs = ["k8s.io/apimachinery/pkg/util/httpstream/httpstream_test.go"],
srcs = ["k8s.io/apimachinery/pkg/util/httpstream/httpstream_test.go"],
library = ":k8s.io/apimachinery/pkg/util/httpstream",
library = ":k8s.io/apimachinery/pkg/util/httpstream",
tags = ["automanaged"],
tags = ["automanaged"],
deps = ["//pkg/api:go_default_library"],
)
)
go_library(
go_library(
...
@@ -13863,11 +13862,12 @@ go_library(
...
@@ -13863,11 +13862,12 @@ go_library(
],
],
tags = ["automanaged"],
tags = ["automanaged"],
deps = [
deps = [
"//pkg/api:go_default_library",
"//vendor:github.com/docker/spdystream",
"//vendor:github.com/docker/spdystream",
"//vendor:github.com/golang/glog",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/serializer",
"//vendor:k8s.io/apimachinery/pkg/util/httpstream",
"//vendor:k8s.io/apimachinery/pkg/util/httpstream",
"//vendor:k8s.io/apimachinery/pkg/util/runtime",
"//vendor:k8s.io/apimachinery/pkg/util/runtime",
"//vendor:k8s.io/apimachinery/third_party/forked/golang/netutil",
"//vendor:k8s.io/apimachinery/third_party/forked/golang/netutil",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment