FieldRef feature for DownwardAPI (#534)

* FieldRef feature for DownwardAPI

Signed-off-by: VineethReddy02 <vineethpothulapati@outlook.com>

* Unit tests for FieldRef

Signed-off-by: VineethReddy02 <vineethpothulapati@outlook.com>
This commit is contained in:
Vineeth Reddy
2019-03-09 00:45:08 +05:30
committed by Brian Goff
parent f8c51004d4
commit 5cea3e7ea8
18 changed files with 6871 additions and 2672 deletions

View File

@@ -34,7 +34,7 @@ import (
"k8s.io/client-go/tools/remotecommand"
api "k8s.io/kubernetes/pkg/apis/core"
"github.com/golang/glog"
"k8s.io/klog"
)
// Options contains details about which streams are required for
@@ -54,7 +54,7 @@ func NewOptions(req *http.Request) (*Options, error) {
stderr := req.FormValue(api.ExecStderrParam) == "1"
if tty && stderr {
// TODO: make this an error before we reach this method
glog.V(4).Infof("Access to exec with tty and stderr is not supported, bypassing stderr")
klog.V(4).Infof("Access to exec with tty and stderr is not supported, bypassing stderr")
stderr = false
}
@@ -125,8 +125,7 @@ func createStreams(req *http.Request, w http.ResponseWriter, opts *Options, supp
func createHttpStreamStreams(req *http.Request, w http.ResponseWriter, opts *Options, supportedStreamProtocols []string, idleTimeout, streamCreationTimeout time.Duration) (*context, bool) {
protocol, err := httpstream.Handshake(req, w, supportedStreamProtocols)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
fmt.Fprint(w, err.Error())
http.Error(w, err.Error(), http.StatusBadRequest)
return nil, false
}
@@ -156,7 +155,7 @@ func createHttpStreamStreams(req *http.Request, w http.ResponseWriter, opts *Opt
case remotecommandconsts.StreamProtocolV2Name:
handler = &v2ProtocolHandler{}
case "":
glog.V(4).Infof("Client did not request protocol negotiation. Falling back to %q", remotecommandconsts.StreamProtocolV1Name)
klog.V(4).Infof("Client did not request protocol negotiation. Falling back to %q", remotecommandconsts.StreamProtocolV1Name)
fallthrough
case remotecommandconsts.StreamProtocolV1Name:
handler = &v1ProtocolHandler{}