Skip to content

Commit

Permalink
Support the subresource of node proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
feihujiang committed Feb 16, 2016
1 parent f7be2cd commit e852539
Show file tree
Hide file tree
Showing 24 changed files with 2,488 additions and 456 deletions.
420 changes: 420 additions & 0 deletions api/swagger-spec/v1.json

Large diffs are not rendered by default.

1,704 changes: 1,288 additions & 416 deletions docs/api-reference/v1/operations.html

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions pkg/api/deep_copy_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func init() {
DeepCopy_api_NodeCondition,
DeepCopy_api_NodeDaemonEndpoints,
DeepCopy_api_NodeList,
DeepCopy_api_NodeProxyOptions,
DeepCopy_api_NodeResources,
DeepCopy_api_NodeSelector,
DeepCopy_api_NodeSelectorRequirement,
Expand Down Expand Up @@ -1401,6 +1402,14 @@ func DeepCopy_api_NodeList(in NodeList, out *NodeList, c *conversion.Cloner) err
return nil
}

func DeepCopy_api_NodeProxyOptions(in NodeProxyOptions, out *NodeProxyOptions, c *conversion.Cloner) error {
if err := DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
return err
}
out.Path = in.Path
return nil
}

func DeepCopy_api_NodeResources(in NodeResources, out *NodeResources, c *conversion.Cloner) error {
if in.Capacity != nil {
in, out := in.Capacity, &out.Capacity
Expand Down
1 change: 1 addition & 0 deletions pkg/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper
"PodExecOptions",
"PodAttachOptions",
"PodProxyOptions",
"NodeProxyOptions",
"ThirdPartyResource",
"ThirdPartyResourceData",
"ThirdPartyResourceList")
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func AddToScheme(scheme *runtime.Scheme) {
&Service{},
&NodeList{},
&Node{},
&NodeProxyOptions{},
&Endpoints{},
&EndpointsList{},
&Binding{},
Expand Down Expand Up @@ -133,6 +134,7 @@ func (obj *EndpointsList) GetObjectKind() unversioned.ObjectKind { r
func (obj *Node) GetObjectMeta() meta.Object { return &obj.ObjectMeta }
func (obj *Node) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *NodeList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *NodeProxyOptions) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *Binding) GetObjectMeta() meta.Object { return &obj.ObjectMeta }
func (obj *Binding) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
func (obj *Event) GetObjectMeta() meta.Object { return &obj.ObjectMeta }
Expand Down
258 changes: 258 additions & 0 deletions pkg/api/types.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -39935,6 +39935,264 @@ func (x *PodProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder)
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

func (x *NodeProxyOptions) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r
if x == nil {
r.EncodeNil()
} else {
yym1 := z.EncBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.EncExt(x) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [3]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[1] = x.Kind != ""
yyq2[2] = x.APIVersion != ""
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(3)
} else {
yynn2 = 1
for _, b := range yyq2 {
if b {
yynn2++
}
}
r.EncodeMapStart(yynn2)
yynn2 = 0
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
yym4 := z.EncBinary()
_ = yym4
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Path))
}
} else {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("Path"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym5 := z.EncBinary()
_ = yym5
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Path))
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[1] {
yym7 := z.EncBinary()
_ = yym7
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
}
} else {
r.EncodeString(codecSelferC_UTF81234, "")
}
} else {
if yyq2[1] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("kind"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym8 := z.EncBinary()
_ = yym8
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.Kind))
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yym10 := z.EncBinary()
_ = yym10
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
}
} else {
r.EncodeString(codecSelferC_UTF81234, "")
}
} else {
if yyq2[2] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("apiVersion"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yym11 := z.EncBinary()
_ = yym11
if false {
} else {
r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion))
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
}
}
}
}

func (x *NodeProxyOptions) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
yym1 := z.DecBinary()
_ = yym1
if false {
} else if z.HasExtensions() && z.DecExt(x) {
} else {
yyct2 := r.ContainerType()
if yyct2 == codecSelferValueTypeMap1234 {
yyl2 := r.ReadMapStart()
if yyl2 == 0 {
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
} else {
x.codecDecodeSelfFromMap(yyl2, d)
}
} else if yyct2 == codecSelferValueTypeArray1234 {
yyl2 := r.ReadArrayStart()
if yyl2 == 0 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
x.codecDecodeSelfFromArray(yyl2, d)
}
} else {
panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
}
}
}

func (x *NodeProxyOptions) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yys3Slc = z.DecScratchBuffer() // default slice to decode into
_ = yys3Slc
var yyhl3 bool = l >= 0
for yyj3 := 0; ; yyj3++ {
if yyhl3 {
if yyj3 >= l {
break
}
} else {
if r.CheckBreak() {
break
}
}
z.DecSendContainerState(codecSelfer_containerMapKey1234)
yys3Slc = r.DecodeBytes(yys3Slc, true, true)
yys3 := string(yys3Slc)
z.DecSendContainerState(codecSelfer_containerMapValue1234)
switch yys3 {
case "Path":
if r.TryDecodeAsNil() {
x.Path = ""
} else {
x.Path = string(r.DecodeString())
}
case "kind":
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
x.Kind = string(r.DecodeString())
}
case "apiVersion":
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
x.APIVersion = string(r.DecodeString())
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
} // end for yyj3
z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}

func (x *NodeProxyOptions) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj7 int
var yyb7 bool
var yyhl7 bool = l >= 0
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb7 = r.CheckBreak()
}
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Path = ""
} else {
x.Path = string(r.DecodeString())
}
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb7 = r.CheckBreak()
}
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
x.Kind = string(r.DecodeString())
}
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb7 = r.CheckBreak()
}
if yyb7 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
x.APIVersion = string(r.DecodeString())
}
for {
yyj7++
if yyhl7 {
yyb7 = yyj7 > l
} else {
yyb7 = r.CheckBreak()
}
if yyb7 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj7-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

func (x *ObjectReference) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperEncoder(e)
Expand Down
8 changes: 8 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,14 @@ type PodProxyOptions struct {
Path string
}

// NodeProxyOptions is the query options to a Node's proxy call
type NodeProxyOptions struct {
unversioned.TypeMeta

// Path is the URL path to use for the current proxy request
Path string
}

// ObjectReference contains enough information to let you inspect or modify the referred object.
type ObjectReference struct {
Kind string `json:"kind,omitempty"`
Expand Down
26 changes: 26 additions & 0 deletions pkg/api/v1/conversion_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,18 @@ func Convert_api_NodeList_To_v1_NodeList(in *api.NodeList, out *NodeList, s conv
return autoConvert_api_NodeList_To_v1_NodeList(in, out, s)
}

func autoConvert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in *api.NodeProxyOptions, out *NodeProxyOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.NodeProxyOptions))(in)
}
out.Path = in.Path
return nil
}

func Convert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in *api.NodeProxyOptions, out *NodeProxyOptions, s conversion.Scope) error {
return autoConvert_api_NodeProxyOptions_To_v1_NodeProxyOptions(in, out, s)
}

func autoConvert_api_NodeSpec_To_v1_NodeSpec(in *api.NodeSpec, out *NodeSpec, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*api.NodeSpec))(in)
Expand Down Expand Up @@ -4804,6 +4816,18 @@ func Convert_v1_NodeList_To_api_NodeList(in *NodeList, out *api.NodeList, s conv
return autoConvert_v1_NodeList_To_api_NodeList(in, out, s)
}

func autoConvert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in *NodeProxyOptions, out *api.NodeProxyOptions, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*NodeProxyOptions))(in)
}
out.Path = in.Path
return nil
}

func Convert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in *NodeProxyOptions, out *api.NodeProxyOptions, s conversion.Scope) error {
return autoConvert_v1_NodeProxyOptions_To_api_NodeProxyOptions(in, out, s)
}

func autoConvert_v1_NodeSpec_To_api_NodeSpec(in *NodeSpec, out *api.NodeSpec, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*NodeSpec))(in)
Expand Down Expand Up @@ -6519,6 +6543,7 @@ func init() {
autoConvert_api_NodeCondition_To_v1_NodeCondition,
autoConvert_api_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints,
autoConvert_api_NodeList_To_v1_NodeList,
autoConvert_api_NodeProxyOptions_To_v1_NodeProxyOptions,
autoConvert_api_NodeSpec_To_v1_NodeSpec,
autoConvert_api_NodeStatus_To_v1_NodeStatus,
autoConvert_api_NodeSystemInfo_To_v1_NodeSystemInfo,
Expand Down Expand Up @@ -6649,6 +6674,7 @@ func init() {
autoConvert_v1_NodeCondition_To_api_NodeCondition,
autoConvert_v1_NodeDaemonEndpoints_To_api_NodeDaemonEndpoints,
autoConvert_v1_NodeList_To_api_NodeList,
autoConvert_v1_NodeProxyOptions_To_api_NodeProxyOptions,
autoConvert_v1_NodeSpec_To_api_NodeSpec,
autoConvert_v1_NodeStatus_To_api_NodeStatus,
autoConvert_v1_NodeSystemInfo_To_api_NodeSystemInfo,
Expand Down
Loading

0 comments on commit e852539

Please sign in to comment.