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
1b64d6b3
Commit
1b64d6b3
authored
Mar 04, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22530 from mwielgus/rcconfig
Auto commit by PR queue bot
parents
4d599ea3
a13843cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
util.go
test/e2e/util.go
+17
-0
No files found.
test/e2e/util.go
View file @
1b64d6b3
...
@@ -270,6 +270,11 @@ type RCConfig struct {
...
@@ -270,6 +270,11 @@ type RCConfig struct {
// Ports to declare in the container (map of name to containerPort).
// Ports to declare in the container (map of name to containerPort).
Ports
map
[
string
]
int
Ports
map
[
string
]
int
// Ports to declare in the container as host and container ports.
HostPorts
map
[
string
]
int
Volumes
[]
api
.
Volume
VolumeMounts
[]
api
.
VolumeMount
// Pointer to a list of pods; if non-nil, will be set to a list of pods
// Pointer to a list of pods; if non-nil, will be set to a list of pods
// created by this RC by RunRC.
// created by this RC by RunRC.
...
@@ -1780,6 +1785,12 @@ func (config *RCConfig) applyTo(template *api.PodTemplateSpec) {
...
@@ -1780,6 +1785,12 @@ func (config *RCConfig) applyTo(template *api.PodTemplateSpec) {
c
.
Ports
=
append
(
c
.
Ports
,
api
.
ContainerPort
{
Name
:
k
,
ContainerPort
:
v
})
c
.
Ports
=
append
(
c
.
Ports
,
api
.
ContainerPort
{
Name
:
k
,
ContainerPort
:
v
})
}
}
}
}
if
config
.
HostPorts
!=
nil
{
for
k
,
v
:=
range
config
.
HostPorts
{
c
:=
&
template
.
Spec
.
Containers
[
0
]
c
.
Ports
=
append
(
c
.
Ports
,
api
.
ContainerPort
{
Name
:
k
,
ContainerPort
:
v
,
HostPort
:
v
})
}
}
if
config
.
CpuLimit
>
0
||
config
.
MemLimit
>
0
{
if
config
.
CpuLimit
>
0
||
config
.
MemLimit
>
0
{
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Limits
=
api
.
ResourceList
{}
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Limits
=
api
.
ResourceList
{}
}
}
...
@@ -1798,6 +1809,12 @@ func (config *RCConfig) applyTo(template *api.PodTemplateSpec) {
...
@@ -1798,6 +1809,12 @@ func (config *RCConfig) applyTo(template *api.PodTemplateSpec) {
if
config
.
MemRequest
>
0
{
if
config
.
MemRequest
>
0
{
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Requests
[
api
.
ResourceMemory
]
=
*
resource
.
NewQuantity
(
config
.
MemRequest
,
resource
.
DecimalSI
)
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Requests
[
api
.
ResourceMemory
]
=
*
resource
.
NewQuantity
(
config
.
MemRequest
,
resource
.
DecimalSI
)
}
}
if
len
(
config
.
Volumes
)
>
0
{
template
.
Spec
.
Volumes
=
config
.
Volumes
}
if
len
(
config
.
VolumeMounts
)
>
0
{
template
.
Spec
.
Containers
[
0
]
.
VolumeMounts
=
config
.
VolumeMounts
}
}
}
func
(
config
*
RCConfig
)
start
()
error
{
func
(
config
*
RCConfig
)
start
()
error
{
...
...
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