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
c33d8bbe
Commit
c33d8bbe
authored
Apr 18, 2016
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let admission plugins indicate they want nothing
parent
616af686
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
plugins.go
pkg/admission/plugins.go
+10
-9
No files found.
pkg/admission/plugins.go
View file @
c33d8bbe
...
@@ -63,18 +63,19 @@ func RegisterPlugin(name string, plugin Factory) {
...
@@ -63,18 +63,19 @@ func RegisterPlugin(name string, plugin Factory) {
plugins
[
name
]
=
plugin
plugins
[
name
]
=
plugin
}
}
//
GetPlugin creates an instance of the named plugin, or nil if the name is not
//
getPlugin creates an instance of the named plugin. It returns `false` if the
//
known. The error is returned only when the named provider was known but failed
//
the name is not known. The error is returned only when the named provider was
//
to initialize. The config parameter specifies the io.Reader handler of the
//
known but failed to initialize. The config parameter specifies the io.Reader
// configuration file for the cloud provider, or nil for no configuration.
//
handler of the
configuration file for the cloud provider, or nil for no configuration.
func
GetPlugin
(
name
string
,
client
clientset
.
Interface
,
config
io
.
Reader
)
(
Interface
,
error
)
{
func
getPlugin
(
name
string
,
client
clientset
.
Interface
,
config
io
.
Reader
)
(
Interface
,
bool
,
error
)
{
pluginsMutex
.
Lock
()
pluginsMutex
.
Lock
()
defer
pluginsMutex
.
Unlock
()
defer
pluginsMutex
.
Unlock
()
f
,
found
:=
plugins
[
name
]
f
,
found
:=
plugins
[
name
]
if
!
found
{
if
!
found
{
return
nil
,
nil
return
nil
,
false
,
nil
}
}
return
f
(
client
,
config
)
ret
,
err
:=
f
(
client
,
config
)
return
ret
,
true
,
err
}
}
// InitPlugin creates an instance of the named interface.
// InitPlugin creates an instance of the named interface.
...
@@ -99,11 +100,11 @@ func InitPlugin(name string, client clientset.Interface, configFilePath string)
...
@@ -99,11 +100,11 @@ func InitPlugin(name string, client clientset.Interface, configFilePath string)
defer
config
.
Close
()
defer
config
.
Close
()
}
}
plugin
,
err
:=
G
etPlugin
(
name
,
client
,
config
)
plugin
,
found
,
err
:=
g
etPlugin
(
name
,
client
,
config
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Couldn't init admission plugin %q: %v"
,
name
,
err
)
glog
.
Fatalf
(
"Couldn't init admission plugin %q: %v"
,
name
,
err
)
}
}
if
plugin
==
nil
{
if
!
found
{
glog
.
Fatalf
(
"Unknown admission plugin: %s"
,
name
)
glog
.
Fatalf
(
"Unknown admission plugin: %s"
,
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