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
1ffc82df
Commit
1ffc82df
authored
Oct 23, 2014
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
createPod should copy the labels, not edit them in place
parent
2475eb06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
replication_controller.go
pkg/controller/replication_controller.go
+10
-8
No files found.
pkg/controller/replication_controller.go
View file @
1ffc82df
...
@@ -53,18 +53,20 @@ type RealPodControl struct {
...
@@ -53,18 +53,20 @@ type RealPodControl struct {
}
}
func
(
r
RealPodControl
)
createReplica
(
ctx
api
.
Context
,
controllerSpec
api
.
ReplicationController
)
{
func
(
r
RealPodControl
)
createReplica
(
ctx
api
.
Context
,
controllerSpec
api
.
ReplicationController
)
{
labels
:=
controllerSpec
.
DesiredState
.
PodTemplate
.
Labels
desiredLabels
:=
make
(
labels
.
Set
)
// TODO: don't fail to set this label just because the map isn't created.
for
k
,
v
:=
range
controllerSpec
.
DesiredState
.
PodTemplate
.
Labels
{
if
labels
!=
nil
{
desiredLabels
[
k
]
=
v
labels
[
"replicationController"
]
=
controllerSpec
.
Name
}
}
desiredLabels
[
"replicationController"
]
=
controllerSpec
.
Name
pod
:=
&
api
.
Pod
{
pod
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Labels
:
desiredLabels
,
},
DesiredState
:
controllerSpec
.
DesiredState
.
PodTemplate
.
DesiredState
,
DesiredState
:
controllerSpec
.
DesiredState
.
PodTemplate
.
DesiredState
,
Labels
:
controllerSpec
.
DesiredState
.
PodTemplate
.
Labels
,
}
}
_
,
err
:=
r
.
kubeClient
.
CreatePod
(
ctx
,
pod
)
if
_
,
err
:=
r
.
kubeClient
.
CreatePod
(
ctx
,
pod
);
err
!=
nil
{
if
err
!=
nil
{
glog
.
Errorf
(
"Unable to create pod replica: %v"
,
err
)
glog
.
Errorf
(
"%#v
\n
"
,
err
)
}
}
}
}
...
...
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