From 7ad83079263ea73e022936887e67f267e41fd211 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 28 Jul 2015 15:56:27 -0700 Subject: [PATCH] Set some default values and add some additional comments for clarity. --- pkg/api/conversion.go | 5 +++++ pkg/api/latest/latest.go | 1 + pkg/api/serialization_test.go | 2 +- pkg/api/v1/types.go | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/api/conversion.go b/pkg/api/conversion.go index 918d0df7af3..61bd117d868 100644 --- a/pkg/api/conversion.go +++ b/pkg/api/conversion.go @@ -35,10 +35,15 @@ func init() { obj.LabelSelector = labels.Everything() obj.FieldSelector = fields.Everything() }, + // TODO: see about moving this into v1/defaults.go func(obj *PodExecOptions) { obj.Stderr = true obj.Stdout = true }, + func(obj *PodAttachOptions) { + obj.Stderr = true + obj.Stdout = true + }, ) Scheme.AddConversionFuncs( func(in *util.Time, out *util.Time, s conversion.Scope) error { diff --git a/pkg/api/latest/latest.go b/pkg/api/latest/latest.go index c08370fdf9c..585c978ce08 100644 --- a/pkg/api/latest/latest.go +++ b/pkg/api/latest/latest.go @@ -93,6 +93,7 @@ func init() { "Status", "PodLogOptions", "PodExecOptions", + "PodAttachOptions", "PodProxyOptions") mapper := api.NewDefaultRESTMapper(versions, InterfacesFor, importPrefix, ignoredKinds, rootScoped) diff --git a/pkg/api/serialization_test.go b/pkg/api/serialization_test.go index be451acfbc6..3fc3aecadf2 100644 --- a/pkg/api/serialization_test.go +++ b/pkg/api/serialization_test.go @@ -122,7 +122,7 @@ func TestList(t *testing.T) { } var nonRoundTrippableTypes = util.NewStringSet() -var nonInternalRoundTrippableTypes = util.NewStringSet("List", "ListOptions", "PodExecOptions") +var nonInternalRoundTrippableTypes = util.NewStringSet("List", "ListOptions", "PodExecOptions", "PodAttachOptions") var nonRoundTrippableTypesByVersion = map[string][]string{} func TestRoundTripTypes(t *testing.T) { diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 99c92a6d5ce..c5a32daa273 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -1477,6 +1477,7 @@ type PodLogOptions struct { // PodAttachOptions is the query options to a Pod's remote attach call // TODO: merge w/ PodExecOptions below for stdin, stdout, etc +// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY type PodAttachOptions struct { TypeMeta `json:",inline"` @@ -1498,6 +1499,8 @@ type PodAttachOptions struct { } // PodExecOptions is the query options to a Pod's remote exec call +// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging +// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY type PodExecOptions struct { TypeMeta `json:",inline"`