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
1f3c322d
Commit
1f3c322d
authored
Aug 11, 2015
by
CJ Cullen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12438 from derekparker/handle-fqdn-gce
Handle full hostname when computing host tag on GCE
parents
1d6553bd
48fadc15
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
gce.go
pkg/cloudprovider/gce/gce.go
+1
-0
gce_test.go
pkg/cloudprovider/gce/gce_test.go
+4
-0
No files found.
pkg/cloudprovider/gce/gce.go
View file @
1f3c322d
...
@@ -456,6 +456,7 @@ func (gce *GCECloud) CreateTCPLoadBalancer(name, region string, externalIP net.I
...
@@ -456,6 +456,7 @@ func (gce *GCECloud) CreateTCPLoadBalancer(name, region string, externalIP net.I
// This is kind of hacky, but the managed instance group adds 4 random chars and a hyphen
// This is kind of hacky, but the managed instance group adds 4 random chars and a hyphen
// to the base name.
// to the base name.
func
(
gce
*
GCECloud
)
computeHostTag
(
host
string
)
string
{
func
(
gce
*
GCECloud
)
computeHostTag
(
host
string
)
string
{
host
=
strings
.
SplitN
(
host
,
"."
,
2
)[
0
]
return
host
[
:
len
(
host
)
-
5
]
return
host
[
:
len
(
host
)
-
5
]
}
}
...
...
pkg/cloudprovider/gce/gce_test.go
View file @
1f3c322d
...
@@ -50,6 +50,10 @@ func TestGetHostTag(t *testing.T) {
...
@@ -50,6 +50,10 @@ func TestGetHostTag(t *testing.T) {
host
:
"gke-test-ea6e8c80-node-8ytk"
,
host
:
"gke-test-ea6e8c80-node-8ytk"
,
expected
:
"gke-test-ea6e8c80-node"
,
expected
:
"gke-test-ea6e8c80-node"
,
},
},
{
host
:
"kubernetes-minion-559o.c.PROJECT_NAME.internal"
,
expected
:
"kubernetes-minion"
,
},
}
}
gce
:=
&
GCECloud
{}
gce
:=
&
GCECloud
{}
...
...
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