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
b1e8c9fc
Commit
b1e8c9fc
authored
Sep 28, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Sep 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29491 from justinsb/aws_deprecate_orempty
Automatic merge from submit-queue AWS: Deprecate a few functions in favor of aws-sdk-go
parents
43758c8f
aa9f2b2c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
aws.go
pkg/cloudprovider/providers/aws/aws.go
+8
-9
aws_utils.go
pkg/cloudprovider/providers/aws/aws_utils.go
+3
-4
No files found.
pkg/cloudprovider/providers/aws/aws.go
View file @
b1e8c9fc
...
@@ -499,26 +499,25 @@ func (p *awsSDKProvider) Metadata() (EC2Metadata, error) {
...
@@ -499,26 +499,25 @@ func (p *awsSDKProvider) Metadata() (EC2Metadata, error) {
return
client
,
nil
return
client
,
nil
}
}
// stringPointerArray creates a slice of string pointers from a slice of strings
// Deprecated: consider using aws.StringSlice - but note the slightly different behaviour with a nil input
func
stringPointerArray
(
orig
[]
string
)
[]
*
string
{
func
stringPointerArray
(
orig
[]
string
)
[]
*
string
{
if
orig
==
nil
{
if
orig
==
nil
{
return
nil
return
nil
}
}
n
:=
make
([]
*
string
,
len
(
orig
))
return
aws
.
StringSlice
(
orig
)
for
i
:=
range
orig
{
n
[
i
]
=
&
orig
[
i
]
}
return
n
}
}
// isNilOrEmpty returns true if the value is nil or ""
// Deprecated: prefer aws.StringValue(x) == "" (and elimination of this check altogether whrere possible)
func
isNilOrEmpty
(
s
*
string
)
bool
{
func
isNilOrEmpty
(
s
*
string
)
bool
{
return
s
==
nil
||
*
s
==
""
return
s
==
nil
||
*
s
==
""
}
}
// orEmpty returns the string value, or "" if the pointer is nil
// Deprecated: prefer aws.StringValue
func
orEmpty
(
s
*
string
)
string
{
func
orEmpty
(
s
*
string
)
string
{
if
s
==
nil
{
return
aws
.
StringValue
(
s
)
return
""
}
return
*
s
}
}
func
newEc2Filter
(
name
string
,
value
string
)
*
ec2
.
Filter
{
func
newEc2Filter
(
name
string
,
value
string
)
*
ec2
.
Filter
{
...
...
pkg/cloudprovider/providers/aws/aws_utils.go
View file @
b1e8c9fc
...
@@ -43,9 +43,8 @@ func stringSetFromPointers(in []*string) sets.String {
...
@@ -43,9 +43,8 @@ func stringSetFromPointers(in []*string) sets.String {
return
out
return
out
}
}
// orZero returns the value, or 0 if the pointer is nil
// Deprecated: prefer aws.Int64Value
func
orZero
(
v
*
int64
)
int64
{
func
orZero
(
v
*
int64
)
int64
{
if
v
==
nil
{
return
aws
.
Int64Value
(
v
)
return
0
}
return
*
v
}
}
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