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
e3be1e9e
Commit
e3be1e9e
authored
Nov 06, 2014
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to core types for introducing PodTemplateSpec
parent
9f15e96b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
23 deletions
+73
-23
types.go
pkg/api/types.go
+69
-23
types.go
pkg/api/v1beta1/types.go
+2
-0
types.go
pkg/api/v1beta2/types.go
+2
-0
No files found.
pkg/api/types.go
View file @
e3be1e9e
...
@@ -437,6 +437,15 @@ type PodList struct {
...
@@ -437,6 +437,15 @@ type PodList struct {
Items
[]
Pod
`json:"items" yaml:"items"`
Items
[]
Pod
`json:"items" yaml:"items"`
}
}
// PodSpec is a description of a pod
type
PodSpec
struct
{
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
}
// Pod is a collection of containers, used as either input (create, update) or as output (list, get).
// Pod is a collection of containers, used as either input (create, update) or as output (list, get).
type
Pod
struct
{
type
Pod
struct
{
TypeMeta
`json:",inline" yaml:",inline"`
TypeMeta
`json:",inline" yaml:",inline"`
...
@@ -448,19 +457,59 @@ type Pod struct {
...
@@ -448,19 +457,59 @@ type Pod struct {
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
}
}
// ReplicationControllerState is the state of a replication controller, either input (create, update) or as output (list, get).
// PodTemplateSpec describes the data a pod should have when created from a template
type
ReplicationControllerState
struct
{
type
PodTemplateSpec
struct
{
Replicas
int
`json:"replicas" yaml:"replicas"`
// Metadata of the pods created from this template.
ReplicaSelector
map
[
string
]
string
`json:"replicaSelector,omitempty" yaml:"replicaSelector,omitempty"`
ObjectMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
PodTemplate
PodTemplate
`json:"podTemplate,omitempty" yaml:"podTemplate,omitempty"`
// Spec defines the behavior of a pod.
Spec
PodSpec
`json:"spec,omitempty" yaml:"spec,omitempty"`
}
}
// ReplicationControllerList is a collection of replication controllers.
// PodTemplate describes a template for creating copies of a predefined pod.
type
ReplicationControllerList
struct
{
type
PodTemplate
struct
{
TypeMeta
`json:",inline" yaml:",inline"`
ObjectMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
// Spec defines the pods that will be created from this template
Spec
PodTemplateSpec
`json:"spec,omitempty" yaml:"spec,omitempty"`
}
// PodTemplateList is a list of PodTemplates.
type
PodTemplateList
struct
{
TypeMeta
`json:",inline" yaml:",inline"`
TypeMeta
`json:",inline" yaml:",inline"`
ListMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
ListMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
Items
[]
ReplicationController
`json:"items" yaml:"items"`
Items
[]
PodTemplate
`json:"items" yaml:"items"`
}
// ReplicationControllerSpec is the specification of a replication controller.
// As the internal representation of a replication controller, it may have either
// a TemplateRef or a Template set.
type
ReplicationControllerSpec
struct
{
// Replicas is the number of desired replicas.
Replicas
int
`json:"replicas" yaml:"replicas"`
// Selector is a label query over pods that should match the Replicas count.
Selector
map
[
string
]
string
`json:"selector" yaml:"selector"`
// TemplateRef is a reference to an object that describes the pod that will be created if
// insufficient replicas are detected. This reference is ignored if a Template is set.
// Must be set before converting to a v1beta3 API object
TemplateRef
*
ObjectReference
`json:"templateRef,omitempty" yaml:"templateRef,omitempty"`
// Template is the object that describes the pod that will be created if
// insufficient replicas are detected. Internally, this takes precedence over a
// TemplateRef.
// Must be set before converting to a v1beta1 or v1beta2 API object.
Template
*
PodTemplateSpec
`json:"template,omitempty" yaml:"template,omitempty"`
}
// ReplicationControllerStatus represents the current status of a replication
// controller.
type
ReplicationControllerStatus
struct
{
// Replicas is the number of actual replicas.
Replicas
int
`json:"replicas" yaml:"replicas"`
}
}
// ReplicationController represents the configuration of a replication controller.
// ReplicationController represents the configuration of a replication controller.
...
@@ -468,14 +517,20 @@ type ReplicationController struct {
...
@@ -468,14 +517,20 @@ type ReplicationController struct {
TypeMeta
`json:",inline" yaml:",inline"`
TypeMeta
`json:",inline" yaml:",inline"`
ObjectMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
ObjectMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
DesiredState
ReplicationControllerState
`json:"desiredState,omitempty" yaml:"desiredState,omitempty"`
// Spec defines the desired behavior of this replication controller.
CurrentState
ReplicationControllerState
`json:"currentState,omitempty" yaml:"currentState,omitempty"`
Spec
ReplicationControllerSpec
`json:"spec,omitempty" yaml:"spec,omitempty"`
// Status is the current status of this replication controller. This data may be
// out of date by some window of time.
Status
ReplicationControllerStatus
`json:"status,omitempty" yaml:"status,omitempty"`
}
}
// PodTemplate holds the information used for creating pods.
// ReplicationControllerList is a collection of replication controllers.
type
PodTemplate
struct
{
type
ReplicationControllerList
struct
{
DesiredState
PodState
`json:"desiredState,omitempty" yaml:"desiredState,omitempty"`
TypeMeta
`json:",inline" yaml:",inline"`
Labels
map
[
string
]
string
`json:"labels,omitempty" yaml:"labels,omitempty"`
ListMeta
`json:"metadata,omitempty" yaml:"metadata,omitempty"`
Items
[]
ReplicationController
`json:"items" yaml:"items"`
}
}
// ServiceList holds a list of services.
// ServiceList holds a list of services.
...
@@ -867,15 +922,6 @@ type ContainerManifestList struct {
...
@@ -867,15 +922,6 @@ type ContainerManifestList struct {
Items
[]
ContainerManifest
`json:"items" yaml:"items,omitempty"`
Items
[]
ContainerManifest
`json:"items" yaml:"items,omitempty"`
}
}
// Included in partial form from v1beta3 to replace ContainerManifest
// PodSpec is a description of a pod
type
PodSpec
struct
{
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
}
// BoundPod is a collection of containers that should be run on a host. A BoundPod
// BoundPod is a collection of containers that should be run on a host. A BoundPod
// defines how a Pod may change after a Binding is created. A Pod is a request to
// defines how a Pod may change after a Binding is created. A Pod is a request to
// execute a pod, whereas a BoundPod is the specification that would be run on a server.
// execute a pod, whereas a BoundPod is the specification that would be run on a server.
...
...
pkg/api/v1beta1/types.go
View file @
e3be1e9e
...
@@ -746,6 +746,8 @@ type PodSpec struct {
...
@@ -746,6 +746,8 @@ type PodSpec struct {
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
}
}
// BoundPod is a collection of containers that should be run on a host. A BoundPod
// BoundPod is a collection of containers that should be run on a host. A BoundPod
...
...
pkg/api/v1beta2/types.go
View file @
e3be1e9e
...
@@ -747,6 +747,8 @@ type PodSpec struct {
...
@@ -747,6 +747,8 @@ type PodSpec struct {
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Volumes
[]
Volume
`json:"volumes" yaml:"volumes"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
Containers
[]
Container
`json:"containers" yaml:"containers"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
RestartPolicy
RestartPolicy
`json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
}
}
// BoundPod is a collection of containers that should be run on a host. A BoundPod
// BoundPod is a collection of containers that should be run on a host. A BoundPod
...
...
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