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
4b213ed2
Commit
4b213ed2
authored
Mar 01, 2016
by
Brian Grant
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22245 from nikhiljindal/deploymentTimeoutErrors
Improving deployment e2e failure error messages
parents
6deb2612
0dae82f6
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 @
4b213ed2
...
@@ -206,15 +206,15 @@ func addHashKeyToRSAndPods(deployment *extensions.Deployment, c clientset.Interf
...
@@ -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.
// 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
)
selector
,
err
:=
unversioned
.
LabelSelectorAsSelector
(
updatedRS
.
Spec
.
Selector
)
if
err
!=
nil
{
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
}
options
:=
api
.
ListOptions
{
LabelSelector
:
selector
}
podList
,
err
:=
getPodList
(
namespace
,
options
)
podList
,
err
:=
getPodList
(
namespace
,
options
)
if
err
!=
nil
{
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
{
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
)
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
...
@@ -251,7 +251,7 @@ func labelPodsWithHash(podList *api.PodList, c clientset.Interface, namespace, h
if
_
,
err
:=
updatePodWithRetries
(
c
.
Core
()
.
Pods
(
namespace
),
&
pod
,
func
(
podToUpdate
*
api
.
Pod
)
{
if
_
,
err
:=
updatePodWithRetries
(
c
.
Core
()
.
Pods
(
namespace
),
&
pod
,
func
(
podToUpdate
*
api
.
Pod
)
{
podToUpdate
.
Labels
=
labelsutil
.
AddLabel
(
podToUpdate
.
Labels
,
extensions
.
DefaultDeploymentUniqueLabelKey
,
hash
)
podToUpdate
.
Labels
=
labelsutil
.
AddLabel
(
podToUpdate
.
Labels
,
extensions
.
DefaultDeploymentUniqueLabelKey
,
hash
)
});
err
!=
nil
{
});
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
)
glog
.
V
(
4
)
.
Infof
(
"Labeled pod %s with hash %s."
,
pod
.
Name
,
hash
)
}
}
...
@@ -304,6 +304,9 @@ func updatePodWithRetries(podClient unversionedcore.PodInterface, pod *api.Pod,
...
@@ -304,6 +304,9 @@ func updatePodWithRetries(podClient unversionedcore.PodInterface, pod *api.Pod,
// Update could have failed due to conflict error. Try again.
// Update could have failed due to conflict error. Try again.
return
false
,
nil
return
false
,
nil
})
})
if
err
==
wait
.
ErrWaitTimeout
{
return
nil
,
fmt
.
Errorf
(
"timed out trying to update pod: %+v"
,
oldPod
)
}
return
pod
,
err
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