1
0
mirror of https://github.com/rancher/types.git synced 2025-09-01 13:18:20 +00:00

types for req and limits

This commit is contained in:
Kinara Shah
2017-12-01 19:02:16 -08:00
parent 6b16d10452
commit f0339d2dc0
6 changed files with 123 additions and 51 deletions

View File

@@ -55,6 +55,8 @@ type ClusterStatus struct {
Capacity v1.ResourceList `json:"capacity,omitempty"`
Allocatable v1.ResourceList `json:"allocatable,omitempty"`
AppliedSpec ClusterSpec `json:"appliedSpec,omitempty"`
Requested v1.ResourceList `json:"requested,omitempty"`
Limits v1.ResourceList `json:"limits,omitempty"`
}
type ClusterComponentStatus struct {
@@ -214,13 +216,27 @@ type AuthConfig struct {
// Authentication options
Options map[string]string `yaml:"options" json:"options,omitempty"`
}
type ClusterNode struct {
v1.Node
metav1.TypeMeta `json:",inline"`
// Standard objects metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the cluster node. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
v1.NodeSpec `json:"spec,omitempty"`
// Most recent observed status of the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Status ClusterNodeStatus `json:"status"`
NodeName string
ClusterName string
}
type ClusterNodeStatus struct {
v1.NodeStatus
Requested v1.ResourceList `json:"requested,omitempty"`
Limits v1.ResourceList `json:"limits,omitempty"`
}
type MachineTemplate struct {
metav1.TypeMeta `json:",inline"`
// Standard objects metadata. More info:

View File

@@ -202,7 +202,10 @@ func (in *ClusterList) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterNode) DeepCopyInto(out *ClusterNode) {
*out = *in
in.Node.DeepCopyInto(&out.Node)
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.NodeSpec.DeepCopyInto(&out.NodeSpec)
in.Status.DeepCopyInto(&out.Status)
return
}
@@ -259,6 +262,37 @@ func (in *ClusterNodeList) DeepCopyObject() runtime.Object {
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterNodeStatus) DeepCopyInto(out *ClusterNodeStatus) {
*out = *in
in.NodeStatus.DeepCopyInto(&out.NodeStatus)
if in.Requested != nil {
in, out := &in.Requested, &out.Requested
*out = make(core_v1.ResourceList, len(*in))
for key, val := range *in {
(*out)[key] = val.DeepCopy()
}
}
if in.Limits != nil {
in, out := &in.Limits, &out.Limits
*out = make(core_v1.ResourceList, len(*in))
for key, val := range *in {
(*out)[key] = val.DeepCopy()
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNodeStatus.
func (in *ClusterNodeStatus) DeepCopy() *ClusterNodeStatus {
if in == nil {
return nil
}
out := new(ClusterNodeStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in
@@ -332,6 +366,20 @@ func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) {
}
}
in.AppliedSpec.DeepCopyInto(&out.AppliedSpec)
if in.Requested != nil {
in, out := &in.Requested, &out.Requested
*out = make(core_v1.ResourceList, len(*in))
for key, val := range *in {
(*out)[key] = val.DeepCopy()
}
}
if in.Limits != nil {
in, out := &in.Limits, &out.Limits
*out = make(core_v1.ResourceList, len(*in))
for key, val := range *in {
(*out)[key] = val.DeepCopy()
}
}
return
}