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
3bdd4130
Commit
3bdd4130
authored
Apr 22, 2016
by
jianhuiz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add protobuf generation
parent
384f801c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
18 deletions
+129
-18
cmd.go
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
+1
-0
generated.pb.go
federation/apis/federation/v1alpha1/generated.pb.go
+0
-0
generated.proto
federation/apis/federation/v1alpha1/generated.proto
+109
-0
types.go
federation/apis/federation/v1alpha1/types.go
+18
-18
update-generated-protobuf.sh
hack/update-generated-protobuf.sh
+1
-0
No files found.
cmd/libs/go2idl/go-to-protobuf/protobuf/cmd.go
View file @
3bdd4130
...
...
@@ -70,6 +70,7 @@ func New() *Generator {
`k8s.io/kubernetes/pkg/apis/autoscaling/v1`
,
`k8s.io/kubernetes/pkg/apis/batch/v1`
,
`k8s.io/kubernetes/pkg/apis/apps/v1alpha1`
,
`k8s.io/kubernetes/federation/apis/federation/v1alpha1`
,
},
","
),
DropEmbeddedFields
:
"k8s.io/kubernetes/pkg/api/unversioned.TypeMeta"
,
}
...
...
federation/apis/federation/v1alpha1/generated.pb.go
0 → 100644
View file @
3bdd4130
This diff is collapsed.
Click to expand it.
federation/apis/federation/v1alpha1/generated.proto
0 → 100644
View file @
3bdd4130
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
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 go-to-protobuf. Do not edit it manually!
syntax
=
'proto2'
;
package
k8s
.
io.kubernetes.federation.apis.federation.v1alpha1
;
import
"k8s.io/kubernetes/pkg/api/resource/generated.proto"
;
import
"k8s.io/kubernetes/pkg/api/unversioned/generated.proto"
;
import
"k8s.io/kubernetes/pkg/api/v1/generated.proto"
;
import
"k8s.io/kubernetes/pkg/util/intstr/generated.proto"
;
// Package-wide variables from generator "generated".
option
go_package
=
"v1alpha1"
;
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
message
Cluster
{
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
optional
k8s.io.kubernetes.pkg.api.v1.ObjectMeta
metadata
=
1
;
// Spec defines the behavior of the Cluster.
optional
ClusterSpec
spec
=
2
;
// Status describes the current status of a Cluster
optional
ClusterStatus
status
=
3
;
}
// ClusterCondition describes current state of a cluster.
message
ClusterCondition
{
// Type of cluster condition, Complete or Failed.
optional
string
type
=
1
;
// Status of the condition, one of True, False, Unknown.
optional
string
status
=
2
;
// Last time the condition was checked.
optional
k8s.io.kubernetes.pkg.api.unversioned.Time
lastProbeTime
=
3
;
// Last time the condition transit from one status to another.
optional
k8s.io.kubernetes.pkg.api.unversioned.Time
lastTransitionTime
=
4
;
// (brief) reason for the condition's last transition.
optional
string
reason
=
5
;
// Human readable message indicating details about last transition.
optional
string
message
=
6
;
}
// A list of all the kubernetes clusters registered to the federation
message
ClusterList
{
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
optional
k8s.io.kubernetes.pkg.api.unversioned.ListMeta
metadata
=
1
;
// List of Cluster objects.
repeated
Cluster
items
=
2
;
}
// Cluster metadata
message
ClusterMeta
{
// Release version of the cluster.
optional
string
version
=
1
;
}
// ClusterSpec describes the attributes of a kubernetes cluster.
message
ClusterSpec
{
// A map of client CIDR to server address.
// This is to help clients reach servers in the most network-efficient way possible.
// Clients can use the appropriate server address as per the CIDR that they match.
// In case of multiple matches, clients should use the longest matching CIDR.
repeated
k8s.io.kubernetes.pkg.api.unversioned.ServerAddressByClientCIDR
serverAddressByClientCIDRs
=
1
;
// the type (e.g. bearer token, client certificate etc) and data of the credential used to access cluster.
// It’s used for system routines (not behalf of users)
// TODO: string may not enough, https://github.com/kubernetes/kubernetes/pull/23847#discussion_r59301275
optional
string
credential
=
2
;
}
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
message
ClusterStatus
{
// Conditions is an array of current cluster conditions.
repeated
ClusterCondition
conditions
=
1
;
// Capacity represents the total resources of the cluster
map
<
string
,
k8s.io.kubernetes.pkg.api.resource.Quantity
>
capacity
=
2
;
// Allocatable represents the total resources of a cluster that are available for scheduling.
map
<
string
,
k8s.io.kubernetes.pkg.api.resource.Quantity
>
allocatable
=
3
;
optional
ClusterMeta
clusterMeta
=
4
;
}
federation/apis/federation/v1alpha1/types.go
View file @
3bdd4130
...
...
@@ -27,11 +27,11 @@ type ClusterSpec struct {
// This is to help clients reach servers in the most network-efficient way possible.
// Clients can use the appropriate server address as per the CIDR that they match.
// In case of multiple matches, clients should use the longest matching CIDR.
ServerAddressByClientCIDRs
[]
unversioned
.
ServerAddressByClientCIDR
`json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR"`
ServerAddressByClientCIDRs
[]
unversioned
.
ServerAddressByClientCIDR
`json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR"
protobuf:"bytes,1,rep,name=serverAddressByClientCIDRs"
`
// the type (e.g. bearer token, client certificate etc) and data of the credential used to access cluster.
// It’s used for system routines (not behalf of users)
// TODO: string may not enough, https://github.com/kubernetes/kubernetes/pull/23847#discussion_r59301275
Credential
string
`json:"credential,omitempty"`
Credential
string
`json:"credential,omitempty"
protobuf:"bytes,2,opt,name=credential"
`
}
type
ClusterConditionType
string
...
...
@@ -47,34 +47,34 @@ const (
// ClusterCondition describes current state of a cluster.
type
ClusterCondition
struct
{
// Type of cluster condition, Complete or Failed.
Type
ClusterConditionType
`json:"type"`
Type
ClusterConditionType
`json:"type"
protobuf:"bytes,1,opt,name=type,casttype=ClusterConditionType"
`
// Status of the condition, one of True, False, Unknown.
Status
v1
.
ConditionStatus
`json:"status"`
Status
v1
.
ConditionStatus
`json:"status"
protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"
`
// Last time the condition was checked.
LastProbeTime
unversioned
.
Time
`json:"lastProbeTime,omitempty"`
LastProbeTime
unversioned
.
Time
`json:"lastProbeTime,omitempty"
protobuf:"bytes,3,opt,name=lastProbeTime"
`
// Last time the condition transit from one status to another.
LastTransitionTime
unversioned
.
Time
`json:"lastTransitionTime,omitempty"`
LastTransitionTime
unversioned
.
Time
`json:"lastTransitionTime,omitempty"
protobuf:"bytes,4,opt,name=lastTransitionTime"
`
// (brief) reason for the condition's last transition.
Reason
string
`json:"reason,omitempty"`
Reason
string
`json:"reason,omitempty"
protobuf:"bytes,5,opt,name=reason"
`
// Human readable message indicating details about last transition.
Message
string
`json:"message,omitempty"`
Message
string
`json:"message,omitempty"
protobuf:"bytes,6,opt,name=message"
`
}
// Cluster metadata
type
ClusterMeta
struct
{
// Release version of the cluster.
Version
string
`json:"version,omitempty"`
Version
string
`json:"version,omitempty"
protobuf:"bytes,1,opt,name=version"
`
}
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
type
ClusterStatus
struct
{
// Conditions is an array of current cluster conditions.
Conditions
[]
ClusterCondition
`json:"conditions,omitempty"`
Conditions
[]
ClusterCondition
`json:"conditions,omitempty"
protobuf:"bytes,1,rep,name=conditions"
`
// Capacity represents the total resources of the cluster
Capacity
v1
.
ResourceList
`json:"capacity,omitempty"`
Capacity
v1
.
ResourceList
`json:"capacity,omitempty"
protobuf:"bytes,2,rep,name=capacity,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"
`
// Allocatable represents the total resources of a cluster that are available for scheduling.
Allocatable
v1
.
ResourceList
`json:"allocatable,omitempty"`
ClusterMeta
`json:",inline"`
Allocatable
v1
.
ResourceList
`json:"allocatable,omitempty"
protobuf:"bytes,3,rep,name=allocatable,casttype=k8s.io/kubernetes/pkg/api/v1.ResourceList,castkey=k8s.io/kubernetes/pkg/api/v1.ResourceName"
`
ClusterMeta
`json:",inline"
protobuf:"bytes,4,opt,name=clusterMeta"
`
}
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
...
...
@@ -82,12 +82,12 @@ type Cluster struct {
unversioned
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
v1
.
ObjectMeta
`json:"metadata,omitempty"`
v1
.
ObjectMeta
`json:"metadata,omitempty"
protobuf:"bytes,1,opt,name=metadata"
`
// Spec defines the behavior of the Cluster.
Spec
ClusterSpec
`json:"spec,omitempty"`
Spec
ClusterSpec
`json:"spec,omitempty"
protobuf:"bytes,2,opt,name=spec"
`
// Status describes the current status of a Cluster
Status
ClusterStatus
`json:"status,omitempty"`
Status
ClusterStatus
`json:"status,omitempty"
protobuf:"bytes,3,opt,name=status"
`
}
// A list of all the kubernetes clusters registered to the federation
...
...
@@ -95,8 +95,8 @@ type ClusterList struct {
unversioned
.
TypeMeta
`json:",inline"`
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
unversioned
.
ListMeta
`json:"metadata,omitempty"`
unversioned
.
ListMeta
`json:"metadata,omitempty"
protobuf:"bytes,1,opt,name=metadata"
`
// List of Cluster objects.
Items
[]
Cluster
`json:"items"`
Items
[]
Cluster
`json:"items"
protobuf:"bytes,2,rep,name=items"
`
}
hack/update-generated-protobuf.sh
View file @
3bdd4130
...
...
@@ -42,6 +42,7 @@ function prereqs() {
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/Godeps/_workspace/src:/go/src/
${
KUBE_GO_PACKAGE
}
/Godeps/_workspace/src"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/hack:/go/src/
${
KUBE_GO_PACKAGE
}
/hack"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/pkg:/go/src/
${
KUBE_GO_PACKAGE
}
/pkg"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/federation:/go/src/
${
KUBE_GO_PACKAGE
}
/federation"
--volume
"
${
REPO_DIR
:-${
KUBE_ROOT
}}
/third_party:/go/src/
${
KUBE_GO_PACKAGE
}
/third_party"
--volume
/etc/localtime:/etc/localtime:ro
--volumes-from
"
${
KUBE_BUILD_DATA_CONTAINER_NAME
}
"
...
...
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