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
50b1034b
Commit
50b1034b
authored
Feb 05, 2015
by
Brian Grant
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4122 from pmorie/comment
Clarify commenting in endpoints_controller
parents
2c9e620d
3229a634
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
rest_test.go
pkg/registry/service/rest_test.go
+1
-1
endpoints_controller.go
pkg/service/endpoints_controller.go
+4
-3
No files found.
pkg/registry/service/rest_test.go
View file @
50b1034b
...
@@ -96,7 +96,7 @@ func TestServiceStorageValidatesCreate(t *testing.T) {
...
@@ -96,7 +96,7 @@ func TestServiceStorageValidatesCreate(t *testing.T) {
SessionAffinity
:
api
.
AffinityTypeNone
,
SessionAffinity
:
api
.
AffinityTypeNone
,
},
},
},
},
"empty
selector
"
:
{
"empty
port
"
:
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
},
Spec
:
api
.
ServiceSpec
{
Spec
:
api
.
ServiceSpec
{
Selector
:
map
[
string
]
string
{
"bar"
:
"baz"
},
Selector
:
map
[
string
]
string
{
"bar"
:
"baz"
},
...
...
pkg/service/endpoints_controller.go
View file @
50b1034b
...
@@ -30,7 +30,7 @@ import (
...
@@ -30,7 +30,7 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
)
)
// EndpointController manages service endpoints.
// EndpointController manages se
lector-based se
rvice endpoints.
type
EndpointController
struct
{
type
EndpointController
struct
{
client
*
client
.
Client
client
*
client
.
Client
}
}
...
@@ -42,7 +42,7 @@ func NewEndpointController(client *client.Client) *EndpointController {
...
@@ -42,7 +42,7 @@ func NewEndpointController(client *client.Client) *EndpointController {
}
}
}
}
// SyncServiceEndpoints syncs
service endpoint
s.
// SyncServiceEndpoints syncs
endpoints for services with selector
s.
func
(
e
*
EndpointController
)
SyncServiceEndpoints
()
error
{
func
(
e
*
EndpointController
)
SyncServiceEndpoints
()
error
{
services
,
err
:=
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
labels
.
Everything
())
services
,
err
:=
e
.
client
.
Services
(
api
.
NamespaceAll
)
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -52,7 +52,8 @@ func (e *EndpointController) SyncServiceEndpoints() error {
...
@@ -52,7 +52,8 @@ func (e *EndpointController) SyncServiceEndpoints() error {
var
resultErr
error
var
resultErr
error
for
_
,
service
:=
range
services
.
Items
{
for
_
,
service
:=
range
services
.
Items
{
if
service
.
Spec
.
Selector
==
nil
{
if
service
.
Spec
.
Selector
==
nil
{
// services without a selector receive no endpoints. The last endpoint will be used.
// services without a selector receive no endpoints from this controller;
// these services will receive the endpoints that are created out-of-band via the REST API.
continue
continue
}
}
...
...
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