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
2082c71a
Commit
2082c71a
authored
Jul 02, 2018
by
Cong Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apimachinery: runtime: cleanup comments
parent
10698f87
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
11 deletions
+10
-11
conversion.go
staging/src/k8s.io/apimachinery/pkg/runtime/conversion.go
+2
-2
doc.go
staging/src/k8s.io/apimachinery/pkg/runtime/doc.go
+0
-1
extension.go
staging/src/k8s.io/apimachinery/pkg/runtime/extension.go
+1
-1
helper.go
staging/src/k8s.io/apimachinery/pkg/runtime/helper.go
+1
-1
interfaces.go
staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go
+3
-3
scheme.go
staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go
+2
-2
json.go
...c/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
+1
-1
No files found.
staging/src/k8s.io/apimachinery/pkg/runtime/conversion.go
View file @
2082c71a
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
//
D
efines conversions between generic types and structs to map query strings
//
Package runtime d
efines conversions between generic types and structs to map query strings
// to struct objects.
// to struct objects.
package
runtime
package
runtime
...
@@ -27,7 +27,7 @@ import (
...
@@ -27,7 +27,7 @@ import (
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/conversion"
)
)
// DefaultFieldSelectorConversion auto-accepts metav1 values for name and namespace.
// Default
MetaV1
FieldSelectorConversion auto-accepts metav1 values for name and namespace.
// A cluster scoped resource specifying namespace empty works fine and specifying a particular
// A cluster scoped resource specifying namespace empty works fine and specifying a particular
// namespace will return no results, as expected.
// namespace will return no results, as expected.
func
DefaultMetaV1FieldSelectorConversion
(
label
,
value
string
)
(
string
,
string
,
error
)
{
func
DefaultMetaV1FieldSelectorConversion
(
label
,
value
string
)
(
string
,
string
,
error
)
{
...
...
staging/src/k8s.io/apimachinery/pkg/runtime/doc.go
View file @
2082c71a
...
@@ -41,5 +41,4 @@ limitations under the License.
...
@@ -41,5 +41,4 @@ limitations under the License.
//
//
// As a bonus, a few common types useful from all api objects and versions
// As a bonus, a few common types useful from all api objects and versions
// are provided in types.go.
// are provided in types.go.
package
runtime
// import "k8s.io/apimachinery/pkg/runtime"
package
runtime
// import "k8s.io/apimachinery/pkg/runtime"
staging/src/k8s.io/apimachinery/pkg/runtime/extension.go
View file @
2082c71a
...
@@ -32,7 +32,7 @@ func (re *RawExtension) UnmarshalJSON(in []byte) error {
...
@@ -32,7 +32,7 @@ func (re *RawExtension) UnmarshalJSON(in []byte) error {
return
nil
return
nil
}
}
// Marshal may get called on pointers or values, so implement MarshalJSON on value.
// Marshal
JSON
may get called on pointers or values, so implement MarshalJSON on value.
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
// http://stackoverflow.com/questions/21390979/custom-marshaljson-never-gets-called-in-go
func
(
re
RawExtension
)
MarshalJSON
()
([]
byte
,
error
)
{
func
(
re
RawExtension
)
MarshalJSON
()
([]
byte
,
error
)
{
if
re
.
Raw
==
nil
{
if
re
.
Raw
==
nil
{
...
...
staging/src/k8s.io/apimachinery/pkg/runtime/helper.go
View file @
2082c71a
...
@@ -87,7 +87,7 @@ func Field(v reflect.Value, fieldName string, dest interface{}) error {
...
@@ -87,7 +87,7 @@ func Field(v reflect.Value, fieldName string, dest interface{}) error {
return
fmt
.
Errorf
(
"couldn't assign/convert %v to %v"
,
field
.
Type
(),
destValue
.
Type
())
return
fmt
.
Errorf
(
"couldn't assign/convert %v to %v"
,
field
.
Type
(),
destValue
.
Type
())
}
}
//
f
ieldPtr puts the address of fieldName, which must be a member of v,
//
F
ieldPtr puts the address of fieldName, which must be a member of v,
// into dest, which must be an address of a variable to which this field's
// into dest, which must be an address of a variable to which this field's
// address can be assigned.
// address can be assigned.
func
FieldPtr
(
v
reflect
.
Value
,
fieldName
string
,
dest
interface
{})
error
{
func
FieldPtr
(
v
reflect
.
Value
,
fieldName
string
,
dest
interface
{})
error
{
...
...
staging/src/k8s.io/apimachinery/pkg/runtime/interfaces.go
View file @
2082c71a
...
@@ -39,14 +39,14 @@ type GroupVersioner interface {
...
@@ -39,14 +39,14 @@ type GroupVersioner interface {
KindForGroupVersionKinds
(
kinds
[]
schema
.
GroupVersionKind
)
(
target
schema
.
GroupVersionKind
,
ok
bool
)
KindForGroupVersionKinds
(
kinds
[]
schema
.
GroupVersionKind
)
(
target
schema
.
GroupVersionKind
,
ok
bool
)
}
}
// Encoder
s write
objects to a serialized form
// Encoder
writes
objects to a serialized form
type
Encoder
interface
{
type
Encoder
interface
{
// Encode writes an object to a stream. Implementations may return errors if the versions are
// Encode writes an object to a stream. Implementations may return errors if the versions are
// incompatible, or if no conversion is defined.
// incompatible, or if no conversion is defined.
Encode
(
obj
Object
,
w
io
.
Writer
)
error
Encode
(
obj
Object
,
w
io
.
Writer
)
error
}
}
// Decoder
s attempt
to load an object from data.
// Decoder
attempts
to load an object from data.
type
Decoder
interface
{
type
Decoder
interface
{
// Decode attempts to deserialize the provided data using either the innate typing of the scheme or the
// Decode attempts to deserialize the provided data using either the innate typing of the scheme or the
// default kind, group, and version provided. It returns a decoded object as well as the kind, group, and
// default kind, group, and version provided. It returns a decoded object as well as the kind, group, and
...
@@ -224,7 +224,7 @@ type SelfLinker interface {
...
@@ -224,7 +224,7 @@ type SelfLinker interface {
Namespace
(
obj
Object
)
(
string
,
error
)
Namespace
(
obj
Object
)
(
string
,
error
)
}
}
//
All API types registered with Scheme must support the Object interfac
e. Since objects in a scheme are
//
Object interface must be supported by all API types registered with Schem
e. Since objects in a scheme are
// expected to be serialized to the wire, the interface an Object must provide to the Scheme allows
// expected to be serialized to the wire, the interface an Object must provide to the Scheme allows
// serializers to set the kind, version, and group the object is represented as. An Object may choose
// serializers to set the kind, version, and group the object is represented as. An Object may choose
// to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized.
// to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized.
...
...
staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go
View file @
2082c71a
...
@@ -80,7 +80,7 @@ type Scheme struct {
...
@@ -80,7 +80,7 @@ type Scheme struct {
observedVersions
[]
schema
.
GroupVersion
observedVersions
[]
schema
.
GroupVersion
}
}
// F
unction to convert
a field selector to internal representation.
// F
ieldLabelConversionFunc converts
a field selector to internal representation.
type
FieldLabelConversionFunc
func
(
label
,
value
string
)
(
internalLabel
,
internalValue
string
,
err
error
)
type
FieldLabelConversionFunc
func
(
label
,
value
string
)
(
internalLabel
,
internalValue
string
,
err
error
)
// NewScheme creates a new Scheme. This scheme is pluggable by default.
// NewScheme creates a new Scheme. This scheme is pluggable by default.
...
@@ -393,7 +393,7 @@ func (s *Scheme) RegisterInputDefaults(in interface{}, fn conversion.FieldMappin
...
@@ -393,7 +393,7 @@ func (s *Scheme) RegisterInputDefaults(in interface{}, fn conversion.FieldMappin
return
s
.
converter
.
RegisterInputDefaults
(
in
,
fn
,
defaultFlags
)
return
s
.
converter
.
RegisterInputDefaults
(
in
,
fn
,
defaultFlags
)
}
}
// AddTypeDefaultingFunc
s
registers a function that is passed a pointer to an
// AddTypeDefaultingFunc registers a function that is passed a pointer to an
// object and can default fields on the object. These functions will be invoked
// object and can default fields on the object. These functions will be invoked
// when Default() is called. The function will never be called unless the
// when Default() is called. The function will never be called unless the
// defaulted object matches srcType. If this function is invoked twice with the
// defaulted object matches srcType. If this function is invoked twice with the
...
...
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go
View file @
2082c71a
...
@@ -241,7 +241,7 @@ func (jsonFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {
...
@@ -241,7 +241,7 @@ func (jsonFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {
return
framer
.
NewJSONFramedReader
(
r
)
return
framer
.
NewJSONFramedReader
(
r
)
}
}
// Framer is the default JSON framing behavior, with newlines delimiting individual objects.
//
YAML
Framer is the default JSON framing behavior, with newlines delimiting individual objects.
var
YAMLFramer
=
yamlFramer
{}
var
YAMLFramer
=
yamlFramer
{}
type
yamlFramer
struct
{}
type
yamlFramer
struct
{}
...
...
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