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
8d90b2a6
Commit
8d90b2a6
authored
Mar 01, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22213 from janetkuo/deployment-type-assert
Auto commit by PR queue bot
parents
5b415a7a
1b831bab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+34
-16
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
8d90b2a6
...
@@ -114,23 +114,10 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller
...
@@ -114,23 +114,10 @@ func NewDeploymentController(client clientset.Interface, resyncPeriod controller
&
extensions
.
Deployment
{},
&
extensions
.
Deployment
{},
FullDeploymentResyncPeriod
,
FullDeploymentResyncPeriod
,
framework
.
ResourceEventHandlerFuncs
{
framework
.
ResourceEventHandlerFuncs
{
AddFunc
:
func
(
obj
interface
{})
{
AddFunc
:
dc
.
addDeploymentNotification
,
d
:=
obj
.
(
*
extensions
.
Deployment
)
UpdateFunc
:
dc
.
updateDeploymentNotification
,
glog
.
V
(
4
)
.
Infof
(
"Adding deployment %s"
,
d
.
Name
)
dc
.
enqueueDeployment
(
d
)
},
UpdateFunc
:
func
(
old
,
cur
interface
{})
{
oldD
:=
old
.
(
*
extensions
.
Deployment
)
glog
.
V
(
4
)
.
Infof
(
"Updating deployment %s"
,
oldD
.
Name
)
// Resync on deployment object relist.
dc
.
enqueueDeployment
(
cur
.
(
*
extensions
.
Deployment
))
},
// This will enter the sync loop and no-op, because the deployment has been deleted from the store.
// This will enter the sync loop and no-op, because the deployment has been deleted from the store.
DeleteFunc
:
func
(
obj
interface
{})
{
DeleteFunc
:
dc
.
deleteDeploymentNotification
,
d
:=
obj
.
(
*
extensions
.
Deployment
)
glog
.
V
(
4
)
.
Infof
(
"Deleting deployment %s"
,
d
.
Name
)
dc
.
enqueueDeployment
(
d
)
},
},
},
)
)
...
@@ -190,6 +177,37 @@ func (dc *DeploymentController) Run(workers int, stopCh <-chan struct{}) {
...
@@ -190,6 +177,37 @@ func (dc *DeploymentController) Run(workers int, stopCh <-chan struct{}) {
dc
.
queue
.
ShutDown
()
dc
.
queue
.
ShutDown
()
}
}
func
(
dc
*
DeploymentController
)
addDeploymentNotification
(
obj
interface
{})
{
d
:=
obj
.
(
*
extensions
.
Deployment
)
glog
.
V
(
4
)
.
Infof
(
"Adding deployment %s"
,
d
.
Name
)
dc
.
enqueueDeployment
(
d
)
}
func
(
dc
*
DeploymentController
)
updateDeploymentNotification
(
old
,
cur
interface
{})
{
oldD
:=
old
.
(
*
extensions
.
Deployment
)
glog
.
V
(
4
)
.
Infof
(
"Updating deployment %s"
,
oldD
.
Name
)
// Resync on deployment object relist.
dc
.
enqueueDeployment
(
cur
.
(
*
extensions
.
Deployment
))
}
func
(
dc
*
DeploymentController
)
deleteDeploymentNotification
(
obj
interface
{})
{
d
,
ok
:=
obj
.
(
*
extensions
.
Deployment
)
if
!
ok
{
tombstone
,
ok
:=
obj
.
(
cache
.
DeletedFinalStateUnknown
)
if
!
ok
{
glog
.
Errorf
(
"Couldn't get object from tombstone %+v"
,
obj
)
return
}
d
,
ok
=
tombstone
.
Obj
.
(
*
extensions
.
Deployment
)
if
!
ok
{
glog
.
Errorf
(
"Tombstone contained object that is not a Deployment %+v"
,
obj
)
return
}
}
glog
.
V
(
4
)
.
Infof
(
"Deleting deployment %s"
,
d
.
Name
)
dc
.
enqueueDeployment
(
d
)
}
// addReplicaSet enqueues the deployment that manages a ReplicaSet when the ReplicaSet is created.
// addReplicaSet enqueues the deployment that manages a ReplicaSet when the ReplicaSet is created.
func
(
dc
*
DeploymentController
)
addReplicaSet
(
obj
interface
{})
{
func
(
dc
*
DeploymentController
)
addReplicaSet
(
obj
interface
{})
{
rs
:=
obj
.
(
*
extensions
.
ReplicaSet
)
rs
:=
obj
.
(
*
extensions
.
ReplicaSet
)
...
...
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