Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
0e8c1f14
Commit
0e8c1f14
authored
4 years ago
by
scott.wang
Browse files
Options
Downloads
Patches
Plain Diff
Add more comment
parent
f906acc0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
remoting/kubernetes/registry_controller.go
+7
-5
7 additions, 5 deletions
remoting/kubernetes/registry_controller.go
with
7 additions
and
5 deletions
remoting/kubernetes/registry_controller.go
+
7
−
5
View file @
0e8c1f14
...
...
@@ -100,7 +100,13 @@ type dubboRegistryController struct {
queue
workqueue
.
Interface
//shared by namespaced informers
}
func
newDubboRegistryController
(
ctx
context
.
Context
,
roleType
common
.
RoleType
,
kcGetter
func
()
(
kubernetes
.
Interface
,
error
))
(
*
dubboRegistryController
,
error
)
{
func
newDubboRegistryController
(
ctx
context
.
Context
,
// different provider and consumer have behavior
roleType
common
.
RoleType
,
// used to inject mock kubernetes client
kcGetter
func
()
(
kubernetes
.
Interface
,
error
),
)
(
*
dubboRegistryController
,
error
)
{
kc
,
err
:=
kcGetter
()
if
err
!=
nil
{
...
...
@@ -348,7 +354,6 @@ func (c *dubboRegistryController) work() {
// processNextWorkItem process work-queue elements
func
(
c
*
dubboRegistryController
)
processNextWorkItem
()
bool
{
item
,
shutdown
:=
c
.
queue
.
Get
()
if
shutdown
{
return
false
...
...
@@ -365,18 +370,15 @@ func (c *dubboRegistryController) handleWatchedPodEvent(p *v1.Pod, eventType wat
logger
.
Debugf
(
"get @type = %s event from @pod = %s"
,
eventType
,
p
.
GetName
())
for
ak
,
av
:=
range
p
.
GetAnnotations
()
{
// not dubbo interest annotation
if
ak
!=
DubboIOAnnotationKey
{
continue
}
ol
,
err
:=
c
.
unmarshalRecord
(
av
)
if
err
!=
nil
{
logger
.
Errorf
(
"there a pod with dubbo annotation, but unmarshal dubbo value %v"
,
err
)
return
}
for
_
,
o
:=
range
ol
{
switch
eventType
{
case
watch
.
Added
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment