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
36b80a4c
Commit
36b80a4c
authored
Feb 20, 2019
by
Kenichi Omichi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix golint failures on e2e/[..]/(aws|azure)
parent
21e3c15d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
.golint_failures
hack/.golint_failures
+0
-2
aws.go
test/e2e/framework/providers/aws/aws.go
+10
-2
azure.go
test/e2e/framework/providers/azure/azure.go
+7
-2
No files found.
hack/.golint_failures
View file @
36b80a4c
...
...
@@ -674,8 +674,6 @@ test/e2e/cloud
test/e2e/common
test/e2e/framework
test/e2e/framework/ingress
test/e2e/framework/providers/aws
test/e2e/framework/providers/azure
test/e2e/framework/providers/gce
test/e2e/framework/providers/kubemark
test/e2e/instrumentation
...
...
test/e2e/framework/providers/aws/aws.go
View file @
36b80a4c
...
...
@@ -32,25 +32,28 @@ import (
)
func
init
()
{
framework
.
RegisterProvider
(
"aws"
,
N
ewProvider
)
framework
.
RegisterProvider
(
"aws"
,
n
ewProvider
)
}
func
N
ewProvider
()
(
framework
.
ProviderInterface
,
error
)
{
func
n
ewProvider
()
(
framework
.
ProviderInterface
,
error
)
{
if
framework
.
TestContext
.
CloudConfig
.
Zone
==
""
{
return
nil
,
fmt
.
Errorf
(
"gce-zone must be specified for AWS"
)
}
return
&
Provider
{},
nil
}
// Provider is a structure to handle AWS clouds for e2e testing
type
Provider
struct
{
framework
.
NullProvider
}
// ResizeGroup resizes an instance group
func
(
p
*
Provider
)
ResizeGroup
(
group
string
,
size
int32
)
error
{
client
:=
autoscaling
.
New
(
session
.
New
())
return
awscloud
.
ResizeInstanceGroup
(
client
,
group
,
int
(
size
))
}
// GroupSize returns the size of an instance group
func
(
p
*
Provider
)
GroupSize
(
group
string
)
(
int
,
error
)
{
client
:=
autoscaling
.
New
(
session
.
New
())
instanceGroup
,
err
:=
awscloud
.
DescribeInstanceGroup
(
client
,
group
)
...
...
@@ -63,6 +66,7 @@ func (p *Provider) GroupSize(group string) (int, error) {
return
instanceGroup
.
CurrentSize
()
}
// DeleteNode deletes a node which is specified as the argument
func
(
p
*
Provider
)
DeleteNode
(
node
*
v1
.
Node
)
error
{
client
:=
newAWSClient
(
""
)
...
...
@@ -80,6 +84,7 @@ func (p *Provider) DeleteNode(node *v1.Node) error {
return
err
}
// CreatePD creates a persistent volume on the specified availability zone
func
(
p
*
Provider
)
CreatePD
(
zone
string
)
(
string
,
error
)
{
client
:=
newAWSClient
(
zone
)
request
:=
&
ec2
.
CreateVolumeInput
{}
...
...
@@ -98,6 +103,7 @@ func (p *Provider) CreatePD(zone string) (string, error) {
return
volumeName
,
nil
}
// DeletePD deletes a persistent volume
func
(
p
*
Provider
)
DeletePD
(
pdName
string
)
error
{
client
:=
newAWSClient
(
""
)
...
...
@@ -116,6 +122,7 @@ func (p *Provider) DeletePD(pdName string) error {
return
nil
}
// CreatePVSource creates a persistent volume source
func
(
p
*
Provider
)
CreatePVSource
(
zone
,
diskName
string
)
(
*
v1
.
PersistentVolumeSource
,
error
)
{
return
&
v1
.
PersistentVolumeSource
{
AWSElasticBlockStore
:
&
v1
.
AWSElasticBlockStoreVolumeSource
{
...
...
@@ -125,6 +132,7 @@ func (p *Provider) CreatePVSource(zone, diskName string) (*v1.PersistentVolumeSo
},
nil
}
// DeletePVSource deletes a persistent volume source
func
(
p
*
Provider
)
DeletePVSource
(
pvSource
*
v1
.
PersistentVolumeSource
)
error
{
return
framework
.
DeletePDWithRetry
(
pvSource
.
AWSElasticBlockStore
.
VolumeID
)
}
...
...
test/e2e/framework/providers/azure/azure.go
View file @
36b80a4c
...
...
@@ -28,10 +28,10 @@ import (
)
func
init
()
{
framework
.
RegisterProvider
(
"azure"
,
N
ewProvider
)
framework
.
RegisterProvider
(
"azure"
,
n
ewProvider
)
}
func
N
ewProvider
()
(
framework
.
ProviderInterface
,
error
)
{
func
n
ewProvider
()
(
framework
.
ProviderInterface
,
error
)
{
if
framework
.
TestContext
.
CloudConfig
.
ConfigFile
==
""
{
return
nil
,
fmt
.
Errorf
(
"config-file must be specified for Azure"
)
}
...
...
@@ -47,16 +47,19 @@ func NewProvider() (framework.ProviderInterface, error) {
},
err
}
//Provider is a structure to handle Azure clouds for e2e testing
type
Provider
struct
{
framework
.
NullProvider
azureCloud
*
azure
.
Cloud
}
// DeleteNode deletes a node which is specified as the argument
func
(
p
*
Provider
)
DeleteNode
(
node
*
v1
.
Node
)
error
{
return
errors
.
New
(
"not implemented yet"
)
}
// CreatePD creates a persistent volume
func
(
p
*
Provider
)
CreatePD
(
zone
string
)
(
string
,
error
)
{
pdName
:=
fmt
.
Sprintf
(
"%s-%s"
,
framework
.
TestContext
.
Prefix
,
string
(
uuid
.
NewUUID
()))
_
,
diskURI
,
_
,
err
:=
p
.
azureCloud
.
CreateVolume
(
pdName
,
""
/* account */
,
""
/* sku */
,
""
/* location */
,
1
/* sizeGb */
)
...
...
@@ -66,6 +69,7 @@ func (p *Provider) CreatePD(zone string) (string, error) {
return
diskURI
,
nil
}
// DeletePD deletes a persistent volume
func
(
p
*
Provider
)
DeletePD
(
pdName
string
)
error
{
if
err
:=
p
.
azureCloud
.
DeleteVolume
(
pdName
);
err
!=
nil
{
framework
.
Logf
(
"failed to delete Azure volume %q: %v"
,
pdName
,
err
)
...
...
@@ -74,6 +78,7 @@ func (p *Provider) DeletePD(pdName string) error {
return
nil
}
// EnableAndDisableInternalLB returns functions for both enabling and disabling internal Load Balancer
func
(
p
*
Provider
)
EnableAndDisableInternalLB
()
(
enable
,
disable
func
(
svc
*
v1
.
Service
))
{
enable
=
func
(
svc
*
v1
.
Service
)
{
svc
.
ObjectMeta
.
Annotations
=
map
[
string
]
string
{
azure
.
ServiceAnnotationLoadBalancerInternal
:
"true"
}
...
...
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