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
3bd00afa
Commit
3bd00afa
authored
Jan 24, 2017
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pkg/util: move Trie to k8s.io/apiserver
parent
ebbf3a93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
openapi.go
pkg/genericapiserver/endpoints/openapi/openapi.go
+2
-2
openapi.go
pkg/genericapiserver/server/openapi/openapi.go
+2
-2
trie.go
staging/src/k8s.io/apiserver/pkg/util/trie/trie.go
+3
-3
No files found.
pkg/genericapiserver/endpoints/openapi/openapi.go
View file @
3bd00afa
...
...
@@ -24,10 +24,10 @@ import (
"github.com/emicklei/go-restful"
"k8s.io/
kubernetes/pkg/util
"
"k8s.io/
apiserver/pkg/util/trie
"
)
var
verbs
=
util
.
CreateTrie
([]
string
{
"get"
,
"log"
,
"read"
,
"replace"
,
"patch"
,
"delete"
,
"deletecollection"
,
"watch"
,
"connect"
,
"proxy"
,
"list"
,
"create"
,
"patch"
})
var
verbs
=
trie
.
New
([]
string
{
"get"
,
"log"
,
"read"
,
"replace"
,
"patch"
,
"delete"
,
"deletecollection"
,
"watch"
,
"connect"
,
"proxy"
,
"list"
,
"create"
,
"patch"
})
// ToValidOperationID makes an string a valid op ID (e.g. removing punctuations and whitespaces and make it camel case)
func
ToValidOperationID
(
s
string
,
capitalizeFirstLetter
bool
)
string
{
...
...
pkg/genericapiserver/server/openapi/openapi.go
View file @
3bd00afa
...
...
@@ -27,8 +27,8 @@ import (
"k8s.io/apimachinery/pkg/openapi"
"k8s.io/apimachinery/pkg/util/json"
"k8s.io/apiserver/pkg/util/trie"
genericmux
"k8s.io/kubernetes/pkg/genericapiserver/server/mux"
"k8s.io/kubernetes/pkg/util"
)
const
(
...
...
@@ -127,7 +127,7 @@ func (o *openAPI) buildDefinitionForType(sample interface{}) (string, error) {
// buildPaths builds OpenAPI paths using go-restful's web services.
func
(
o
*
openAPI
)
buildPaths
(
webServices
[]
*
restful
.
WebService
)
error
{
pathsToIgnore
:=
util
.
CreateTrie
(
o
.
config
.
IgnorePrefixes
)
pathsToIgnore
:=
trie
.
New
(
o
.
config
.
IgnorePrefixes
)
duplicateOpId
:=
make
(
map
[
string
]
string
)
for
_
,
w
:=
range
webServices
{
rootPath
:=
w
.
RootPath
()
...
...
pkg/util
/trie.go
→
staging/src/k8s.io/apiserver/pkg/util/trie
/trie.go
View file @
3bd00afa
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
util
package
trie
// A simple trie implementation with Add an HasPrefix methods only.
type
Trie
struct
{
...
...
@@ -23,8 +23,8 @@ type Trie struct {
word
string
}
//
CreateTrie
creates a Trie and add all strings in the provided list to it.
func
CreateTrie
(
list
[]
string
)
Trie
{
//
New
creates a Trie and add all strings in the provided list to it.
func
New
(
list
[]
string
)
Trie
{
ret
:=
Trie
{
children
:
make
(
map
[
byte
]
*
Trie
),
wordTail
:
false
,
...
...
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