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
c93cd4a0
Commit
c93cd4a0
authored
Mar 31, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6225 from cjcullen/cloudprovider
Fix typed-nil passing in cloudprovider/plugins
parents
06fc01d7
aa91bde3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
plugins.go
pkg/cloudprovider/plugins.go
+8
-5
No files found.
pkg/cloudprovider/plugins.go
View file @
c93cd4a0
...
@@ -64,26 +64,29 @@ func GetCloudProvider(name string, config io.Reader) (Interface, error) {
...
@@ -64,26 +64,29 @@ func GetCloudProvider(name string, config io.Reader) (Interface, error) {
// InitCloudProvider creates an instance of the named cloud provider.
// InitCloudProvider creates an instance of the named cloud provider.
func
InitCloudProvider
(
name
string
,
configFilePath
string
)
Interface
{
func
InitCloudProvider
(
name
string
,
configFilePath
string
)
Interface
{
var
c
onfig
*
os
.
Fil
e
var
c
loud
Interfac
e
if
name
==
""
{
if
name
==
""
{
glog
.
Info
(
"No cloud provider specified."
)
glog
.
Info
(
"No cloud provider specified."
)
return
nil
return
nil
}
}
var
err
error
if
configFilePath
!=
""
{
if
configFilePath
!=
""
{
var
err
error
config
,
err
:=
os
.
Open
(
configFilePath
)
config
,
err
=
os
.
Open
(
configFilePath
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Couldn't open cloud provider configuration %s: %#v"
,
glog
.
Fatalf
(
"Couldn't open cloud provider configuration %s: %#v"
,
configFilePath
,
err
)
configFilePath
,
err
)
}
}
defer
config
.
Close
()
defer
config
.
Close
()
cloud
,
err
=
GetCloudProvider
(
name
,
config
)
}
else
{
// Pass explicit nil so plugins can actually check for nil. See
// "Why is my nil error value not equal to nil?" in golang.org/doc/faq.
cloud
,
err
=
GetCloudProvider
(
name
,
nil
)
}
}
cloud
,
err
:=
GetCloudProvider
(
name
,
config
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Couldn't init cloud provider %q: %v"
,
name
,
err
)
glog
.
Fatalf
(
"Couldn't init cloud provider %q: %v"
,
name
,
err
)
}
}
...
...
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