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
c299a804
Unverified
Commit
c299a804
authored
May 14, 2017
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Table to meta.k8s.io/v1alpha1
Table is a generic tabular output that can be returned by servers to enable clients to display data simply.
parent
2413fe15
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
330 additions
and
0 deletions
+330
-0
cmd.go
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
+1
-0
BUILD
pkg/generated/openapi/BUILD
+1
-0
BUILD
...c/k8s.io/apimachinery/pkg/apis/meta/internalversion/BUILD
+1
-0
register.go
...io/apimachinery/pkg/apis/meta/internalversion/register.go
+7
-0
BUILD
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/BUILD
+27
-0
doc.go
...ing/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/doc.go
+22
-0
register.go
...rc/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/register.go
+50
-0
types.go
...g/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go
+100
-0
zz_generated.deepcopy.go
...machinery/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go
+121
-0
No files found.
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
View file @
c299a804
...
@@ -67,6 +67,7 @@ func New() *Generator {
...
@@ -67,6 +67,7 @@ func New() *Generator {
`+k8s.io/apimachinery/pkg/runtime/schema`
,
`+k8s.io/apimachinery/pkg/runtime/schema`
,
`+k8s.io/apimachinery/pkg/runtime`
,
`+k8s.io/apimachinery/pkg/runtime`
,
`k8s.io/apimachinery/pkg/apis/meta/v1`
,
`k8s.io/apimachinery/pkg/apis/meta/v1`
,
`k8s.io/apimachinery/pkg/apis/meta/v1alpha1`
,
`k8s.io/apiserver/pkg/apis/example/v1`
,
`k8s.io/apiserver/pkg/apis/example/v1`
,
`k8s.io/kube-aggregator/pkg/apis/apiregistration/v1alpha1`
,
`k8s.io/kube-aggregator/pkg/apis/apiregistration/v1alpha1`
,
`k8s.io/kubernetes/pkg/api/v1`
,
`k8s.io/kubernetes/pkg/api/v1`
,
...
...
pkg/generated/openapi/BUILD
View file @
c299a804
...
@@ -38,6 +38,7 @@ openapi_library(
...
@@ -38,6 +38,7 @@ openapi_library(
vendor_targets = [
vendor_targets = [
"k8s.io/apimachinery/pkg/api/resource",
"k8s.io/apimachinery/pkg/api/resource",
"k8s.io/apimachinery/pkg/apis/meta/v1",
"k8s.io/apimachinery/pkg/apis/meta/v1",
"k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"k8s.io/apimachinery/pkg/runtime",
"k8s.io/apimachinery/pkg/runtime",
"k8s.io/apimachinery/pkg/util/intstr",
"k8s.io/apimachinery/pkg/util/intstr",
"k8s.io/apimachinery/pkg/version",
"k8s.io/apimachinery/pkg/version",
...
...
staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/BUILD
View file @
c299a804
...
@@ -29,6 +29,7 @@ go_library(
...
@@ -29,6 +29,7 @@ go_library(
tags = ["automanaged"],
tags = ["automanaged"],
deps = [
deps = [
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1alpha1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/fields:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
...
...
staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go
View file @
c299a804
...
@@ -18,6 +18,7 @@ package internalversion
...
@@ -18,6 +18,7 @@ package internalversion
import
(
import
(
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1alpha1
"k8s.io/apimachinery/pkg/apis/meta/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer"
...
@@ -69,6 +70,12 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
...
@@ -69,6 +70,12 @@ func addToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion)
&
metav1
.
ExportOptions
{},
&
metav1
.
ExportOptions
{},
&
metav1
.
DeleteOptions
{},
&
metav1
.
DeleteOptions
{},
)
)
scheme
.
AddKnownTypes
(
SchemeGroupVersion
,
&
metav1alpha1
.
Table
{},
)
scheme
.
AddKnownTypes
(
metav1alpha1
.
SchemeGroupVersion
,
&
metav1alpha1
.
Table
{},
)
// Allow delete options to be decoded across all version in this scheme (we may want to be more clever than this)
// Allow delete options to be decoded across all version in this scheme (we may want to be more clever than this)
scheme
.
AddUnversionedTypes
(
SchemeGroupVersion
,
&
metav1
.
DeleteOptions
{})
scheme
.
AddUnversionedTypes
(
SchemeGroupVersion
,
&
metav1
.
DeleteOptions
{})
metav1
.
AddToGroupVersion
(
scheme
,
metav1
.
SchemeGroupVersion
)
metav1
.
AddToGroupVersion
(
scheme
,
metav1
.
SchemeGroupVersion
)
...
...
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/BUILD
0 → 100644
View file @
c299a804
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"generated.pb.go",
"register.go",
"types.go",
"zz_generated.deepcopy.go",
],
tags = ["automanaged"],
deps = [
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
],
)
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/doc.go
0 → 100644
View file @
c299a804
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:deepcopy-gen=package
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +groupName=meta.k8s.io
package
v1alpha1
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/register.go
0 → 100644
View file @
c299a804
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1alpha1
import
(
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name for this API.
const
GroupName
=
"meta.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var
SchemeGroupVersion
=
schema
.
GroupVersion
{
Group
:
GroupName
,
Version
:
"v1alpha1"
}
// Kind takes an unqualified kind and returns a Group qualified GroupKind
func
Kind
(
kind
string
)
schema
.
GroupKind
{
return
SchemeGroupVersion
.
WithKind
(
kind
)
.
GroupKind
()
}
// scheme is the registry for the common types that adhere to the meta v1alpha1 API spec.
var
scheme
=
runtime
.
NewScheme
()
// ParameterCodec knows about query parameters used with the meta v1alpha1 API spec.
var
ParameterCodec
=
runtime
.
NewParameterCodec
(
scheme
)
func
init
()
{
scheme
.
AddKnownTypes
(
SchemeGroupVersion
,
&
Table
{},
&
TableOptions
{},
&
PartialObjectMetadata
{},
)
// register manually. This usually goes through the SchemeBuilder, which we cannot use here.
//scheme.AddGeneratedDeepCopyFuncs(GetGeneratedDeepCopyFuncs()...)
}
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/types.go
0 → 100644
View file @
c299a804
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// package v1alpha1 is alpha objects from meta that will be introduced.
package
v1alpha1
import
(
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// Table is a tabular representation of a set of API resources. The server transforms the
// object into a set of preferred columns for quickly reviewing the objects.
// +protobuf=false
type
Table
struct
{
v1
.
TypeMeta
`json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
v1
.
ListMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// columnDefinitions describes each column in the returned items array. The number of cells per row
// will always match the number of column definitions.
ColumnDefinitions
[]
TableColumnDefinitions
`json:"columnDefinitions"`
// rows is the list of items in the table.
Rows
[]
TableRow
`json:"rows"`
}
// TableColumnDefinitions contains information about a column returned in the Table.
// +protobuf=false
type
TableColumnDefinitions
struct
{
// name is a human readable name for the column.
Name
string
`json:"name"`
// type is an OpenAPI type definition for this column.
// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
Type
string
`json:"type"`
// format is an optional OpenAPI type definition for this column.
// See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.
Format
string
`json:"format"`
// description is a human readable description of this column.
Description
string
`json:"description"`
}
// TableRow is an individual row in a table.
// +protobuf=false
type
TableRow
struct
{
// cells will be as wide as headers and may contain strings, numbers, booleans, simple maps, or lists, or
// null. See the type field of the column definition for a more detailed description.
Cells
[]
interface
{}
`json:"cells"`
// This field contains the requested additional information about each object based on the includeObject
// policy when requesting the Table. If "None", this field is empty, if "Object" this will be the
// default serialization of the object for the current API version, and if "Metadata" (the default) will
// contain the object metadata. Check the returned kind and apiVersion of the object before parsing.
Object
runtime
.
RawExtension
`json:"object"`
}
// IncludeObjectPolicy controls which portion of the object is returned with a Table.
type
IncludeObjectPolicy
string
const
(
// IncludeNone returns no object.
IncludeNone
IncludeObjectPolicy
=
"None"
// IncludeMetadata serializes the object containing only its metadata field.
IncludeMetadata
IncludeObjectPolicy
=
"Metadata"
// IncludeObject contains the full object.
IncludeObject
IncludeObjectPolicy
=
"Object"
)
// TableOptions are used when a Table is requested by the caller.
type
TableOptions
struct
{
v1
.
TypeMeta
`json:",inline"`
// includeObject decides whether to include each object along with its columnar information.
// Specifying "None" will return no object, specifying "Object" will return the full object contents, and
// specifying "Metadata" (the default) will return the object's metadata in the PartialObjectMetadata kind
// in version v1alpha1 of the meta.k8s.io API group.
IncludeObject
IncludeObjectPolicy
`json:"includeObject,omitempty" protobuf:"bytes,1,opt,name=includeObject"`
}
// PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients
// to get access to a particular ObjectMeta schema without knowing the details of the version.
type
PartialObjectMetadata
struct
{
v1
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1
.
ObjectMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
}
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1alpha1/zz_generated.deepcopy.go
0 → 100644
View file @
c299a804
// +build !ignore_autogenerated
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
package
v1alpha1
import
(
v1
"k8s.io/apimachinery/pkg/apis/meta/v1"
conversion
"k8s.io/apimachinery/pkg/conversion"
runtime
"k8s.io/apimachinery/pkg/runtime"
reflect
"reflect"
)
// GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
func
GetGeneratedDeepCopyFuncs
()
[]
conversion
.
GeneratedDeepCopyFunc
{
return
[]
conversion
.
GeneratedDeepCopyFunc
{
{
Fn
:
DeepCopy_v1alpha1_PartialObjectMetadata
,
InType
:
reflect
.
TypeOf
(
&
PartialObjectMetadata
{})},
{
Fn
:
DeepCopy_v1alpha1_Table
,
InType
:
reflect
.
TypeOf
(
&
Table
{})},
{
Fn
:
DeepCopy_v1alpha1_TableColumnDefinitions
,
InType
:
reflect
.
TypeOf
(
&
TableColumnDefinitions
{})},
{
Fn
:
DeepCopy_v1alpha1_TableOptions
,
InType
:
reflect
.
TypeOf
(
&
TableOptions
{})},
{
Fn
:
DeepCopy_v1alpha1_TableRow
,
InType
:
reflect
.
TypeOf
(
&
TableRow
{})},
}
}
func
DeepCopy_v1alpha1_PartialObjectMetadata
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
PartialObjectMetadata
)
out
:=
out
.
(
*
PartialObjectMetadata
)
*
out
=
*
in
if
newVal
,
err
:=
c
.
DeepCopy
(
&
in
.
ObjectMeta
);
err
!=
nil
{
return
err
}
else
{
out
.
ObjectMeta
=
*
newVal
.
(
*
v1
.
ObjectMeta
)
}
return
nil
}
}
func
DeepCopy_v1alpha1_Table
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
Table
)
out
:=
out
.
(
*
Table
)
*
out
=
*
in
if
in
.
ColumnDefinitions
!=
nil
{
in
,
out
:=
&
in
.
ColumnDefinitions
,
&
out
.
ColumnDefinitions
*
out
=
make
([]
TableColumnDefinitions
,
len
(
*
in
))
copy
(
*
out
,
*
in
)
}
if
in
.
Rows
!=
nil
{
in
,
out
:=
&
in
.
Rows
,
&
out
.
Rows
*
out
=
make
([]
TableRow
,
len
(
*
in
))
for
i
:=
range
*
in
{
if
newVal
,
err
:=
c
.
DeepCopy
(
&
(
*
in
)[
i
]);
err
!=
nil
{
return
err
}
else
{
(
*
out
)[
i
]
=
*
newVal
.
(
*
TableRow
)
}
}
}
return
nil
}
}
func
DeepCopy_v1alpha1_TableColumnDefinitions
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
TableColumnDefinitions
)
out
:=
out
.
(
*
TableColumnDefinitions
)
*
out
=
*
in
return
nil
}
}
func
DeepCopy_v1alpha1_TableOptions
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
TableOptions
)
out
:=
out
.
(
*
TableOptions
)
*
out
=
*
in
return
nil
}
}
func
DeepCopy_v1alpha1_TableRow
(
in
interface
{},
out
interface
{},
c
*
conversion
.
Cloner
)
error
{
{
in
:=
in
.
(
*
TableRow
)
out
:=
out
.
(
*
TableRow
)
*
out
=
*
in
if
in
.
Cells
!=
nil
{
in
,
out
:=
&
in
.
Cells
,
&
out
.
Cells
*
out
=
make
([]
interface
{},
len
(
*
in
))
for
i
:=
range
*
in
{
if
newVal
,
err
:=
c
.
DeepCopy
(
&
(
*
in
)[
i
]);
err
!=
nil
{
return
err
}
else
{
(
*
out
)[
i
]
=
*
newVal
.
(
*
interface
{})
}
}
}
if
newVal
,
err
:=
c
.
DeepCopy
(
&
in
.
Object
);
err
!=
nil
{
return
err
}
else
{
out
.
Object
=
*
newVal
.
(
*
runtime
.
RawExtension
)
}
return
nil
}
}
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