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
301488b2
Commit
301488b2
authored
Dec 22, 2017
by
Bowei Du
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose all GCE cloud proivder services versions, not just the GA API
parent
13c80a99
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
7 deletions
+15
-7
gce.go
pkg/cloudprovider/providers/gce/gce.go
+11
-3
firewall_util.go
test/e2e/framework/firewall_util.go
+2
-2
util.go
test/e2e/framework/util.go
+1
-1
volume_provisioning.go
test/e2e/storage/volume_provisioning.go
+1
-1
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
301488b2
...
...
@@ -211,9 +211,17 @@ func init() {
})
}
// Raw access to the underlying GCE service, probably should only be used for e2e tests
func
(
g
*
GCECloud
)
GetComputeService
()
*
compute
.
Service
{
return
g
.
service
// Services is the set of all versions of the compute service.
type
Services
struct
{
// GA, Alpha, Beta versions of the compute API.
GA
*
compute
.
Service
Alpha
*
computealpha
.
Service
Beta
*
computebeta
.
Service
}
// ComputeServices returns access to the internal compute services.
func
(
g
*
GCECloud
)
ComputeServices
()
*
Services
{
return
&
Services
{
g
.
service
,
g
.
serviceAlpha
,
g
.
serviceBeta
}
}
// newGCECloud creates a new instance of GCECloud.
...
...
test/e2e/framework/firewall_util.go
View file @
301488b2
...
...
@@ -100,7 +100,7 @@ func ConstructHealthCheckFirewallForLBService(clusterID string, svc *v1.Service,
// GetInstanceTags gets tags from GCE instance with given name.
func
GetInstanceTags
(
cloudConfig
CloudConfig
,
instanceName
string
)
*
compute
.
Tags
{
gceCloud
:=
cloudConfig
.
Provider
.
(
*
gcecloud
.
GCECloud
)
res
,
err
:=
gceCloud
.
GetComputeService
()
.
Instances
.
Get
(
cloudConfig
.
ProjectID
,
cloudConfig
.
Zone
,
res
,
err
:=
gceCloud
.
ComputeServices
()
.
GA
.
Instances
.
Get
(
cloudConfig
.
ProjectID
,
cloudConfig
.
Zone
,
instanceName
)
.
Do
()
if
err
!=
nil
{
Failf
(
"Failed to get instance tags for %v: %v"
,
instanceName
,
err
)
...
...
@@ -113,7 +113,7 @@ func SetInstanceTags(cloudConfig CloudConfig, instanceName, zone string, tags []
gceCloud
:=
cloudConfig
.
Provider
.
(
*
gcecloud
.
GCECloud
)
// Re-get instance everytime because we need the latest fingerprint for updating metadata
resTags
:=
GetInstanceTags
(
cloudConfig
,
instanceName
)
_
,
err
:=
gceCloud
.
GetComputeService
()
.
Instances
.
SetTags
(
_
,
err
:=
gceCloud
.
ComputeServices
()
.
GA
.
Instances
.
SetTags
(
cloudConfig
.
ProjectID
,
zone
,
instanceName
,
&
compute
.
Tags
{
Fingerprint
:
resTags
.
Fingerprint
,
Items
:
tags
})
.
Do
()
if
err
!=
nil
{
...
...
test/e2e/framework/util.go
View file @
301488b2
...
...
@@ -4335,7 +4335,7 @@ func ensureGCELoadBalancerResourcesDeleted(ip, portRange string) error {
}
return
wait
.
Poll
(
10
*
time
.
Second
,
5
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
service
:=
gceCloud
.
GetComputeService
()
service
:=
gceCloud
.
ComputeServices
()
.
GA
list
,
err
:=
service
.
ForwardingRules
.
List
(
project
,
region
)
.
Do
()
if
err
!=
nil
{
return
false
,
err
...
...
test/e2e/storage/volume_provisioning.go
View file @
301488b2
...
...
@@ -501,7 +501,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
// Get a list of all zones in the project
zones
,
err
:=
gceCloud
.
GetComputeService
()
.
Zones
.
List
(
framework
.
TestContext
.
CloudConfig
.
ProjectID
)
.
Do
()
zones
,
err
:=
gceCloud
.
ComputeServices
()
.
GA
.
Zones
.
List
(
framework
.
TestContext
.
CloudConfig
.
ProjectID
)
.
Do
()
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
z
:=
range
zones
.
Items
{
allZones
.
Insert
(
z
.
Name
)
...
...
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