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
91eaa8a3
Commit
91eaa8a3
authored
Aug 31, 2017
by
tcharding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename PluginsEnvVarPluginLoader to stop stutter
parent
86f1d74a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
factory_builder.go
pkg/kubectl/cmd/util/factory_builder.go
+1
-1
loader.go
pkg/kubectl/plugins/loader.go
+2
-2
loader_test.go
pkg/kubectl/plugins/loader_test.go
+2
-2
No files found.
pkg/kubectl/cmd/util/factory_builder.go
View file @
91eaa8a3
...
@@ -180,7 +180,7 @@ func (f *ring2Factory) NewUnstructuredBuilder(allowRemoteCalls bool) (*resource.
...
@@ -180,7 +180,7 @@ func (f *ring2Factory) NewUnstructuredBuilder(allowRemoteCalls bool) (*resource.
// system directory structure spec for the given platform.
// system directory structure spec for the given platform.
func
(
f
*
ring2Factory
)
PluginLoader
()
plugins
.
PluginLoader
{
func
(
f
*
ring2Factory
)
PluginLoader
()
plugins
.
PluginLoader
{
if
len
(
os
.
Getenv
(
"KUBECTL_PLUGINS_PATH"
))
>
0
{
if
len
(
os
.
Getenv
(
"KUBECTL_PLUGINS_PATH"
))
>
0
{
return
plugins
.
PluginsEnvVar
PluginLoader
()
return
plugins
.
KubectlPluginsPath
PluginLoader
()
}
}
return
plugins
.
TolerantMultiPluginLoader
{
return
plugins
.
TolerantMultiPluginLoader
{
plugins
.
XDGDataPluginLoader
(),
plugins
.
XDGDataPluginLoader
(),
...
...
pkg/kubectl/plugins/loader.go
View file @
91eaa8a3
...
@@ -137,9 +137,9 @@ func PathFromEnvVarPluginLoader(envVarName string, subdirs ...string) PluginLoad
...
@@ -137,9 +137,9 @@ func PathFromEnvVarPluginLoader(envVarName string, subdirs ...string) PluginLoad
return
loader
return
loader
}
}
//
PluginsEnvVar
PluginLoader returns a PluginLoader that loads plugins from one or more
//
KubectlPluginsPath
PluginLoader returns a PluginLoader that loads plugins from one or more
// directories specified by the KUBECTL_PLUGINS_PATH env var.
// directories specified by the KUBECTL_PLUGINS_PATH env var.
func
PluginsEnvVar
PluginLoader
()
PluginLoader
{
func
KubectlPluginsPath
PluginLoader
()
PluginLoader
{
return
PathFromEnvVarPluginLoader
(
"KUBECTL_PLUGINS_PATH"
)
return
PathFromEnvVarPluginLoader
(
"KUBECTL_PLUGINS_PATH"
)
}
}
...
...
pkg/kubectl/plugins/loader_test.go
View file @
91eaa8a3
...
@@ -109,7 +109,7 @@ func TestUnexistentDirectoryPluginLoader(t *testing.T) {
...
@@ -109,7 +109,7 @@ func TestUnexistentDirectoryPluginLoader(t *testing.T) {
}
}
}
}
func
Test
PluginsEnvVar
PluginLoader
(
t
*
testing
.
T
)
{
func
Test
KubectlPluginsPath
PluginLoader
(
t
*
testing
.
T
)
{
tmp
,
err
:=
setupValidPlugins
(
1
,
0
)
tmp
,
err
:=
setupValidPlugins
(
1
,
0
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
@@ -120,7 +120,7 @@ func TestPluginsEnvVarPluginLoader(t *testing.T) {
...
@@ -120,7 +120,7 @@ func TestPluginsEnvVarPluginLoader(t *testing.T) {
os
.
Setenv
(
env
,
tmp
)
os
.
Setenv
(
env
,
tmp
)
defer
os
.
Unsetenv
(
env
)
defer
os
.
Unsetenv
(
env
)
loader
:=
PluginsEnvVar
PluginLoader
()
loader
:=
KubectlPluginsPath
PluginLoader
()
plugins
,
err
:=
loader
.
Load
()
plugins
,
err
:=
loader
.
Load
()
if
err
!=
nil
{
if
err
!=
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