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
f5757bce
Commit
f5757bce
authored
Jul 13, 2017
by
Matt Liggett
Committed by
GitHub
Jul 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #48902 from freehan/gce-api-endpint
fix gce cloud provider projects api endpoint
parents
f818cbea
a471140e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
gce.go
pkg/cloudprovider/providers/gce/gce.go
+1
-1
gce_disks.go
pkg/cloudprovider/providers/gce/gce_disks.go
+3
-3
gce_loadbalancer_external.go
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
+3
-3
gce_loadbalancer_internal.go
pkg/cloudprovider/providers/gce/gce_loadbalancer_internal.go
+1
-1
gce_zones.go
pkg/cloudprovider/providers/gce/gce_zones.go
+1
-1
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
f5757bce
...
...
@@ -188,7 +188,7 @@ func newGCECloud(config io.Reader) (*GCECloud, error) {
if
err
!=
nil
{
return
nil
,
err
}
networkURL
:=
gceNetworkURL
(
apiEndpoint
,
projectID
,
networkName
)
networkURL
:=
gceNetworkURL
(
""
,
projectID
,
networkName
)
subnetworkURL
:=
""
// By default, Kubernetes clusters only run against one zone
...
...
pkg/cloudprovider/providers/gce/gce_disks.go
View file @
f5757bce
...
...
@@ -234,11 +234,11 @@ func (gce *GCECloud) CreateDisk(
return
fmt
.
Errorf
(
"invalid GCE disk type %q"
,
diskType
)
}
a
piEndpoint
:=
gceComputeAPIEndpoint
+
"projects/"
projectsA
piEndpoint
:=
gceComputeAPIEndpoint
+
"projects/"
if
gce
.
service
!=
nil
{
a
piEndpoint
=
gce
.
service
.
BasePath
projectsA
piEndpoint
=
gce
.
service
.
BasePath
}
diskTypeUri
:=
a
piEndpoint
+
fmt
.
Sprintf
(
diskTypeUriTemplate
,
gce
.
projectID
,
zone
,
diskType
)
diskTypeUri
:=
projectsA
piEndpoint
+
fmt
.
Sprintf
(
diskTypeUriTemplate
,
gce
.
projectID
,
zone
,
diskType
)
diskToCreate
:=
&
compute
.
Disk
{
Name
:
name
,
...
...
pkg/cloudprovider/providers/gce/gce_loadbalancer_external.go
View file @
f5757bce
...
...
@@ -542,7 +542,7 @@ func (gce *GCECloud) updateTargetPool(loadBalancerName string, existing sets.Str
}
func
(
gce
*
GCECloud
)
targetPoolURL
(
name
,
region
string
)
string
{
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
"projects"
,
gce
.
projectID
,
"regions"
,
region
,
"targetPools"
,
name
},
"/"
)
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
gce
.
projectID
,
"regions"
,
region
,
"targetPools"
,
name
},
"/"
)
}
func
makeHttpHealthCheck
(
name
,
path
string
,
port
int32
)
*
compute
.
HttpHealthCheck
{
...
...
@@ -671,9 +671,9 @@ func nodeNames(nodes []*v1.Node) []string {
return
ret
}
func
makeHostURL
(
a
piEndpoint
,
projectID
,
zone
,
host
string
)
string
{
func
makeHostURL
(
projectsA
piEndpoint
,
projectID
,
zone
,
host
string
)
string
{
host
=
canonicalizeInstanceName
(
host
)
return
apiEndpoint
+
strings
.
Join
([]
string
{
"projects"
,
projectID
,
"zones"
,
zone
,
"instances"
,
host
},
"/"
)
return
projectsApiEndpoint
+
strings
.
Join
([]
string
{
projectID
,
"zones"
,
zone
,
"instances"
,
host
},
"/"
)
}
func
hostURLToComparablePath
(
hostURL
string
)
string
{
...
...
pkg/cloudprovider/providers/gce/gce_loadbalancer_internal.go
View file @
f5757bce
...
...
@@ -624,7 +624,7 @@ func getPortsAndProtocol(svcPorts []v1.ServicePort) (ports []string, protocol v1
}
func
(
gce
*
GCECloud
)
getBackendServiceLink
(
name
string
)
string
{
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
"projects"
,
gce
.
projectID
,
"regions"
,
gce
.
region
,
"backendServices"
,
name
},
"/"
)
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
gce
.
projectID
,
"regions"
,
gce
.
region
,
"backendServices"
,
name
},
"/"
)
}
func
getNameFromLink
(
link
string
)
string
{
...
...
pkg/cloudprovider/providers/gce/gce_zones.go
View file @
f5757bce
...
...
@@ -53,5 +53,5 @@ func (gce *GCECloud) ListZonesInRegion(region string) ([]*compute.Zone, error) {
}
func
(
gce
*
GCECloud
)
getRegionLink
(
region
string
)
string
{
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
"projects"
,
gce
.
projectID
,
"regions"
,
region
},
"/"
)
return
gce
.
service
.
BasePath
+
strings
.
Join
([]
string
{
gce
.
projectID
,
"regions"
,
region
},
"/"
)
}
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