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
5daa0041
Commit
5daa0041
authored
Jan 29, 2019
by
ampsingram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SigningName as optional parameter
Makes AWS testing simpler
parent
1ab6569d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
aws.go
pkg/cloudprovider/providers/aws/aws.go
+2
-0
aws_test.go
pkg/cloudprovider/providers/aws/aws_test.go
+8
-2
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
5daa0041
...
@@ -590,6 +590,7 @@ type CloudConfig struct {
...
@@ -590,6 +590,7 @@ type CloudConfig struct {
URL
string
URL
string
SigningRegion
string
SigningRegion
string
SigningMethod
string
SigningMethod
string
SigningName
string
}
}
}
}
...
@@ -649,6 +650,7 @@ func (cfg *CloudConfig) getResolver() endpoints.ResolverFunc {
...
@@ -649,6 +650,7 @@ func (cfg *CloudConfig) getResolver() endpoints.ResolverFunc {
URL
:
override
.
URL
,
URL
:
override
.
URL
,
SigningRegion
:
override
.
SigningRegion
,
SigningRegion
:
override
.
SigningRegion
,
SigningMethod
:
override
.
SigningMethod
,
SigningMethod
:
override
.
SigningMethod
,
SigningName
:
override
.
SigningName
,
},
nil
},
nil
}
}
}
}
...
...
pkg/cloudprovider/providers/aws/aws_test.go
View file @
5daa0041
...
@@ -190,6 +190,7 @@ type ServiceDescriptor struct {
...
@@ -190,6 +190,7 @@ type ServiceDescriptor struct {
name
string
name
string
region
string
region
string
signingRegion
,
signingMethod
string
signingRegion
,
signingMethod
string
signingName
string
}
}
func
TestOverridesActiveConfig
(
t
*
testing
.
T
)
{
func
TestOverridesActiveConfig
(
t
*
testing
.
T
)
{
...
@@ -376,12 +377,12 @@ func TestOverridesActiveConfig(t *testing.T) {
...
@@ -376,12 +377,12 @@ func TestOverridesActiveConfig(t *testing.T) {
URL=https://s3.foo.bar
URL=https://s3.foo.bar
SigningRegion=sregion1
SigningRegion=sregion1
SigningMethod = v4
SigningMethod = v4
SigningName = "name"
`
),
`
),
nil
,
nil
,
false
,
true
,
false
,
true
,
[]
ServiceDescriptor
{{
name
:
"s3"
,
region
:
"region1"
,
signingRegion
:
"sregion1"
,
signingMethod
:
"v3"
},
[]
ServiceDescriptor
{{
name
:
"s3"
,
region
:
"region1"
,
signingRegion
:
"sregion1"
,
signingMethod
:
"v3"
},
{
name
:
"s3"
,
region
:
"region2"
,
signingRegion
:
"sregion1"
,
signingMethod
:
"v4"
}},
{
name
:
"s3"
,
region
:
"region2"
,
signingRegion
:
"sregion1"
,
signingMethod
:
"v4"
,
signingName
:
"name"
}},
},
},
}
}
...
@@ -411,6 +412,7 @@ func TestOverridesActiveConfig(t *testing.T) {
...
@@ -411,6 +412,7 @@ func TestOverridesActiveConfig(t *testing.T) {
URL
string
URL
string
SigningRegion
string
SigningRegion
string
SigningMethod
string
SigningMethod
string
SigningName
string
}
}
for
_
,
v
:=
range
cfg
.
ServiceOverride
{
for
_
,
v
:=
range
cfg
.
ServiceOverride
{
if
v
.
Service
==
sd
.
name
&&
v
.
Region
==
sd
.
region
{
if
v
.
Service
==
sd
.
name
&&
v
.
Region
==
sd
.
region
{
...
@@ -435,6 +437,10 @@ func TestOverridesActiveConfig(t *testing.T) {
...
@@ -435,6 +437,10 @@ func TestOverridesActiveConfig(t *testing.T) {
t
.
Errorf
(
"Expected Endpoint '%s', received '%s' for case %s"
,
t
.
Errorf
(
"Expected Endpoint '%s', received '%s' for case %s"
,
targetName
,
found
.
URL
,
test
.
name
)
targetName
,
found
.
URL
,
test
.
name
)
}
}
if
found
.
SigningName
!=
sd
.
signingName
{
t
.
Errorf
(
"Expected signing name '%s', received '%s' for case %s"
,
sd
.
signingName
,
found
.
SigningName
,
test
.
name
)
}
fn
:=
cfg
.
getResolver
()
fn
:=
cfg
.
getResolver
()
ep1
,
e
:=
fn
(
sd
.
name
,
sd
.
region
,
nil
)
ep1
,
e
:=
fn
(
sd
.
name
,
sd
.
region
,
nil
)
...
...
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