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
0dae82f6
Commit
0dae82f6
authored
Feb 29, 2016
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving deployment e2e failure error messages
parent
f3d943e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
deployment.go
pkg/util/deployment/deployment.go
+7
-4
No files found.
pkg/util/deployment/deployment.go
View file @
0dae82f6
...
...
@@ -206,15 +206,15 @@ func addHashKeyToRSAndPods(deployment *extensions.Deployment, c clientset.Interf
// 2. Update all pods managed by the rs to have the new hash label, so they will be correctly adopted.
selector
,
err
:=
unversioned
.
LabelSelectorAsSelector
(
updatedRS
.
Spec
.
Selector
)
if
err
!=
nil
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"error in converting selector to label selector for replica set %s: %s"
,
updatedRS
.
Name
,
err
)
}
options
:=
api
.
ListOptions
{
LabelSelector
:
selector
}
podList
,
err
:=
getPodList
(
namespace
,
options
)
if
err
!=
nil
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"error in getting pod list for namespace %s and list options %+v: %s"
,
namespace
,
options
,
err
)
}
if
err
=
labelPodsWithHash
(
podList
,
c
,
namespace
,
hash
);
err
!=
nil
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"error in adding template hash label %s to pods %+v: %s"
,
hash
,
podList
,
err
)
}
glog
.
V
(
4
)
.
Infof
(
"Labeled rs %s's pods with hash %s."
,
rs
.
Name
,
hash
)
...
...
@@ -251,7 +251,7 @@ func labelPodsWithHash(podList *api.PodList, c clientset.Interface, namespace, h
if
_
,
err
:=
updatePodWithRetries
(
c
.
Core
()
.
Pods
(
namespace
),
&
pod
,
func
(
updated
*
api
.
Pod
)
{
pod
.
Labels
=
labelsutil
.
AddLabel
(
pod
.
Labels
,
extensions
.
DefaultDeploymentUniqueLabelKey
,
hash
)
});
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"error in adding template hash label %s to pod %+v: %s"
,
hash
,
pod
,
err
)
}
glog
.
V
(
4
)
.
Infof
(
"Labeled pod %s with hash %s."
,
pod
.
Name
,
hash
)
}
...
...
@@ -303,6 +303,9 @@ func updatePodWithRetries(podClient unversionedcore.PodInterface, pod *api.Pod,
}
return
false
,
nil
})
if
err
==
wait
.
ErrWaitTimeout
{
return
nil
,
fmt
.
Errorf
(
"timed out trying to update pod: %+v"
,
oldPod
)
}
return
pod
,
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