Merge pull request #4262 from vishh/api_resources
Rename ResourceRequirementSpec to ResourceRequirements.
This commit is contained in:
@@ -149,8 +149,8 @@ func TestPullPolicyConversion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func getResourceRequirements(cpu, memory resource.Quantity) current.ResourceRequirementSpec {
|
||||
res := current.ResourceRequirementSpec{}
|
||||
func getResourceRequirements(cpu, memory resource.Quantity) current.ResourceRequirements {
|
||||
res := current.ResourceRequirements{}
|
||||
res.Limits = current.ResourceList{}
|
||||
if cpu.Value() > 0 {
|
||||
res.Limits[current.ResourceCPU] = util.NewIntOrStringFromInt(int(cpu.Value()))
|
||||
|
||||
@@ -218,7 +218,7 @@ type Capabilities struct {
|
||||
Drop []CapabilityType `json:"drop,omitempty" description:"droped capabilities"`
|
||||
}
|
||||
|
||||
type ResourceRequirementSpec struct {
|
||||
type ResourceRequirements struct {
|
||||
// Limits describes the maximum amount of compute resources required.
|
||||
Limits ResourceList `json:"limits,omitempty" description:"Maximum amount of compute resources allowed"`
|
||||
}
|
||||
@@ -233,10 +233,10 @@ type Container struct {
|
||||
// Optional: Defaults to whatever is defined in the image.
|
||||
Command []string `json:"command,omitempty" description:"command argv array; not executed within a shell; defaults to entrypoint or command in the image"`
|
||||
// Optional: Defaults to Docker's default.
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default"`
|
||||
Ports []Port `json:"ports,omitempty" description:"list of ports to expose from the container"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container"`
|
||||
Resources ResourceRequirementSpec `json:"resources,omitempty" description:"Compute Resources required by this container"`
|
||||
WorkingDir string `json:"workingDir,omitempty" description:"container's working directory; defaults to image's default"`
|
||||
Ports []Port `json:"ports,omitempty" description:"list of ports to expose from the container"`
|
||||
Env []EnvVar `json:"env,omitempty" description:"list of environment variables to set in the container"`
|
||||
Resources ResourceRequirements `json:"resources,omitempty" description:"Compute Resources required by this container"`
|
||||
// Optional: Defaults to unlimited.
|
||||
CPU int `json:"cpu,omitempty" description:"CPU share in thousandths of a core"`
|
||||
// Optional: Defaults to unlimited.
|
||||
|
||||
Reference in New Issue
Block a user