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
9d725995
Commit
9d725995
authored
Feb 24, 2016
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update status for paused deployments
parent
7e50fa6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+17
-2
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
9d725995
...
@@ -420,9 +420,12 @@ func (dc *DeploymentController) syncDeployment(key string) error {
...
@@ -420,9 +420,12 @@ func (dc *DeploymentController) syncDeployment(key string) error {
d
:=
*
obj
.
(
*
extensions
.
Deployment
)
d
:=
*
obj
.
(
*
extensions
.
Deployment
)
if
d
.
Spec
.
Paused
{
if
d
.
Spec
.
Paused
{
// TODO: Implement scaling for paused deployments.
// Dont take any action for paused deployment.
// But keep the status up-to-date.
// Ignore paused deployments
// Ignore paused deployments
glog
.
V
(
4
)
.
Infof
(
"
Ignoring
paused deployment %s/%s"
,
d
.
Namespace
,
d
.
Name
)
glog
.
V
(
4
)
.
Infof
(
"
Updating status only for
paused deployment %s/%s"
,
d
.
Namespace
,
d
.
Name
)
return
nil
return
dc
.
syncPausedDeploymentStatus
(
&
d
)
}
}
if
d
.
Spec
.
RollbackTo
!=
nil
{
if
d
.
Spec
.
RollbackTo
!=
nil
{
revision
:=
d
.
Spec
.
RollbackTo
.
Revision
revision
:=
d
.
Spec
.
RollbackTo
.
Revision
...
@@ -440,6 +443,18 @@ func (dc *DeploymentController) syncDeployment(key string) error {
...
@@ -440,6 +443,18 @@ func (dc *DeploymentController) syncDeployment(key string) error {
return
fmt
.
Errorf
(
"unexpected deployment strategy type: %s"
,
d
.
Spec
.
Strategy
.
Type
)
return
fmt
.
Errorf
(
"unexpected deployment strategy type: %s"
,
d
.
Spec
.
Strategy
.
Type
)
}
}
// Updates the status of a paused deployment
func
(
dc
*
DeploymentController
)
syncPausedDeploymentStatus
(
deployment
*
extensions
.
Deployment
)
error
{
newRS
,
oldRSs
,
err
:=
dc
.
getAllReplicaSets
(
*
deployment
,
false
)
if
err
!=
nil
{
return
err
}
allRSs
:=
append
(
controller
.
FilterActiveReplicaSets
(
oldRSs
),
newRS
)
// Sync deployment status
return
dc
.
syncDeploymentStatus
(
allRSs
,
newRS
,
*
deployment
)
}
// Rolling back to a revision; no-op if the toRevision is deployment's current revision
// Rolling back to a revision; no-op if the toRevision is deployment's current revision
func
(
dc
*
DeploymentController
)
rollback
(
deployment
*
extensions
.
Deployment
,
toRevision
*
int64
)
(
*
extensions
.
Deployment
,
error
)
{
func
(
dc
*
DeploymentController
)
rollback
(
deployment
*
extensions
.
Deployment
,
toRevision
*
int64
)
(
*
extensions
.
Deployment
,
error
)
{
newRS
,
allOldRSs
,
err
:=
dc
.
getAllReplicaSets
(
*
deployment
,
true
)
newRS
,
allOldRSs
,
err
:=
dc
.
getAllReplicaSets
(
*
deployment
,
true
)
...
...
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