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
cb7d3f01
Commit
cb7d3f01
authored
Aug 28, 2015
by
CJ Cullen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return an error from gce.EnsureTCPLoadBalancer with no hosts.
parent
98801225
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
gce.go
pkg/cloudprovider/providers/gce/gce.go
+5
-1
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
cb7d3f01
...
@@ -352,7 +352,11 @@ func makeFirewallName(name string) string {
...
@@ -352,7 +352,11 @@ func makeFirewallName(name string) string {
// TODO(a-robinson): Don't just ignore specified IP addresses. Check if they're
// TODO(a-robinson): Don't just ignore specified IP addresses. Check if they're
// owned by the project and available to be used, and use them if they are.
// owned by the project and available to be used, and use them if they are.
func
(
gce
*
GCECloud
)
EnsureTCPLoadBalancer
(
name
,
region
string
,
externalIP
net
.
IP
,
ports
[]
*
api
.
ServicePort
,
hosts
[]
string
,
affinityType
api
.
ServiceAffinity
)
(
*
api
.
LoadBalancerStatus
,
error
)
{
func
(
gce
*
GCECloud
)
EnsureTCPLoadBalancer
(
name
,
region
string
,
externalIP
net
.
IP
,
ports
[]
*
api
.
ServicePort
,
hosts
[]
string
,
affinityType
api
.
ServiceAffinity
)
(
*
api
.
LoadBalancerStatus
,
error
)
{
glog
.
V
(
2
)
.
Info
(
"Checking if load balancer already exists: %s"
,
name
)
if
len
(
hosts
)
==
0
{
return
nil
,
fmt
.
Errorf
(
"Cannot EnsureTCPLoadBalancer() with no hosts"
)
}
glog
.
V
(
2
)
.
Infof
(
"Checking if load balancer already exists: %s"
,
name
)
_
,
exists
,
err
:=
gce
.
GetTCPLoadBalancer
(
name
,
region
)
_
,
exists
,
err
:=
gce
.
GetTCPLoadBalancer
(
name
,
region
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error checking if GCE load balancer already exists: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error checking if GCE load balancer already exists: %v"
,
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