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
96908d6d
Commit
96908d6d
authored
Feb 24, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more logs
parent
08270239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
deployment.go
pkg/util/deployment/deployment.go
+6
-0
No files found.
pkg/util/deployment/deployment.go
View file @
96908d6d
...
...
@@ -21,6 +21,8 @@ import (
"strconv"
"time"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions"
...
...
@@ -196,6 +198,7 @@ func addHashKeyToRSAndPods(deployment extensions.Deployment, c clientset.Interfa
return
nil
,
fmt
.
Errorf
(
"error waiting for rs %s generation %d observed by controller: %v"
,
updatedRS
.
Name
,
updatedRS
.
Generation
,
err
)
}
}
glog
.
V
(
4
)
.
Infof
(
"Observed the update of rs %s's pod template with hash %s."
,
rs
.
Name
,
hash
)
}
// 2. Update all pods managed by the rs to have the new hash label, so they will be correctly adopted.
...
...
@@ -211,6 +214,7 @@ func addHashKeyToRSAndPods(deployment extensions.Deployment, c clientset.Interfa
if
err
=
labelPodsWithHash
(
podList
,
c
,
namespace
,
hash
);
err
!=
nil
{
return
nil
,
err
}
glog
.
V
(
4
)
.
Infof
(
"Labeled rs %s's pods with hash %s."
,
rs
.
Name
,
hash
)
// 3. Update rs label and selector to include the new hash label
// Copy the old selector, so that we can scrub out any orphaned pods
...
...
@@ -220,6 +224,7 @@ func addHashKeyToRSAndPods(deployment extensions.Deployment, c clientset.Interfa
});
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error updating rs %s label and selector with template hash: %v"
,
updatedRS
.
Name
,
err
)
}
glog
.
V
(
4
)
.
Infof
(
"Updated rs %s's selector and label with hash %s."
,
rs
.
Name
,
hash
)
// TODO: look for orphaned pods and label them in the background somewhere else periodically
...
...
@@ -246,6 +251,7 @@ func labelPodsWithHash(podList *api.PodList, c clientset.Interface, namespace, h
});
err
!=
nil
{
return
err
}
glog
.
V
(
4
)
.
Infof
(
"Labeled pod %s with hash %s."
,
pod
.
Name
,
hash
)
}
}
return
nil
...
...
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