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
486d8ef2
Commit
486d8ef2
authored
Jul 18, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a union category expander
parent
6b78eeca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
categories.go
pkg/kubectl/resource/categories.go
+27
-0
No files found.
pkg/kubectl/resource/categories.go
View file @
486d8ef2
...
...
@@ -79,6 +79,33 @@ func (e discoveryFilteredExpander) Expand(category string) ([]schema.GroupResour
return
available
,
ok
}
type
UnionCategoryExpander
[]
CategoryExpander
func
(
u
UnionCategoryExpander
)
Expand
(
category
string
)
([]
schema
.
GroupResource
,
bool
)
{
ret
:=
[]
schema
.
GroupResource
{}
ok
:=
false
for
_
,
expansion
:=
range
u
{
curr
,
currOk
:=
expansion
.
Expand
(
category
)
for
_
,
currGR
:=
range
curr
{
found
:=
false
for
_
,
existing
:=
range
ret
{
if
existing
==
currGR
{
found
=
true
break
}
}
if
!
found
{
ret
=
append
(
ret
,
currGR
)
}
}
ok
=
ok
||
currOk
}
return
ret
,
ok
}
// legacyUserResources are the resource names that apply to the primary, user facing resources used by
// client tools. They are in deletion-first order - dependent resources should be last.
// Should remain exported in order to expose a current list of resources to downstream
...
...
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