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
f2e12b76
Commit
f2e12b76
authored
Sep 12, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move things around because we move expapi to apis/experimental now
parent
c7331249
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
84 deletions
+9
-84
install.go
pkg/apis/experimental/install/install.go
+3
-3
install_test.go
pkg/apis/experimental/install/install_test.go
+6
-6
latest.go
pkg/apis/experimental/latest/latest.go
+0
-75
No files found.
pkg/
expapi
/install/install.go
→
pkg/
apis/experimental
/install/install.go
View file @
f2e12b76
...
...
@@ -29,13 +29,13 @@ import (
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/registered"
apiutil
"k8s.io/kubernetes/pkg/api/util"
_
"k8s.io/kubernetes/pkg/
expapi
"
"k8s.io/kubernetes/pkg/
expapi
/v1"
_
"k8s.io/kubernetes/pkg/
apis/experimental
"
"k8s.io/kubernetes/pkg/
apis/experimental
/v1"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets"
)
const
importPrefix
=
"k8s.io/kubernetes/pkg/
expapi
"
const
importPrefix
=
"k8s.io/kubernetes/pkg/
apis/experimental
"
var
accessor
=
meta
.
NewAccessor
()
...
...
pkg/
expapi
/install/install_test.go
→
pkg/
apis/experimental
/install/install_test.go
View file @
f2e12b76
...
...
@@ -22,11 +22,11 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/
expapi
"
"k8s.io/kubernetes/pkg/
apis/experimental
"
)
func
TestResourceVersioner
(
t
*
testing
.
T
)
{
daemonSet
:=
exp
api
.
DaemonSet
{
ObjectMeta
:
api
.
ObjectMeta
{
ResourceVersion
:
"10"
}}
daemonSet
:=
exp
erimental
.
DaemonSet
{
ObjectMeta
:
api
.
ObjectMeta
{
ResourceVersion
:
"10"
}}
version
,
err
:=
accessor
.
ResourceVersion
(
&
daemonSet
)
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
...
@@ -35,7 +35,7 @@ func TestResourceVersioner(t *testing.T) {
t
.
Errorf
(
"unexpected version %v"
,
version
)
}
daemonSetList
:=
exp
api
.
DaemonSetList
{
ListMeta
:
api
.
ListMeta
{
ResourceVersion
:
"10"
}}
daemonSetList
:=
exp
erimental
.
DaemonSetList
{
ListMeta
:
api
.
ListMeta
{
ResourceVersion
:
"10"
}}
version
,
err
=
accessor
.
ResourceVersion
(
&
daemonSetList
)
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
...
...
@@ -46,12 +46,12 @@ func TestResourceVersioner(t *testing.T) {
}
func
TestCodec
(
t
*
testing
.
T
)
{
daemonSet
:=
exp
api
.
DaemonSet
{}
daemonSet
:=
exp
erimental
.
DaemonSet
{}
data
,
err
:=
latest
.
GroupOrDie
(
"experimental"
)
.
Codec
.
Encode
(
&
daemonSet
)
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
other
:=
exp
api
.
DaemonSet
{}
other
:=
exp
erimental
.
DaemonSet
{}
if
err
:=
json
.
Unmarshal
(
data
,
&
other
);
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
...
...
@@ -98,7 +98,7 @@ func TestRESTMapper(t *testing.T) {
t
.
Errorf
(
"unexpected codec: %#v, expected: %#v"
,
mapping
,
interfaces
)
}
rc
:=
&
exp
api
.
HorizontalPodAutoscaler
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
}}
rc
:=
&
exp
erimental
.
HorizontalPodAutoscaler
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
}}
name
,
err
:=
mapping
.
MetadataAccessor
.
Name
(
rc
)
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
...
...
pkg/apis/experimental/latest/latest.go
deleted
100644 → 0
View file @
c7331249
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
latest
import
(
"fmt"
"strings"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/registered"
_
"k8s.io/kubernetes/pkg/apis/experimental"
"k8s.io/kubernetes/pkg/apis/experimental/v1"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/sets"
)
var
(
Version
string
Versions
[]
string
accessor
=
meta
.
NewAccessor
()
Codec
runtime
.
Codec
SelfLinker
=
runtime
.
SelfLinker
(
accessor
)
RESTMapper
meta
.
RESTMapper
)
const
importPrefix
=
"k8s.io/kubernetes/pkg/apis/experimental"
func
init
()
{
Version
=
registered
.
RegisteredVersions
[
0
]
Codec
=
runtime
.
CodecFor
(
api
.
Scheme
,
Version
)
// Put the registered versions in Versions in reverse order.
for
i
:=
len
(
registered
.
RegisteredVersions
)
-
1
;
i
>=
0
;
i
--
{
Versions
=
append
(
Versions
,
registered
.
RegisteredVersions
[
i
])
}
// the list of kinds that are scoped at the root of the api hierarchy
// if a kind is not enumerated here, it is assumed to have a namespace scope
rootScoped
:=
sets
.
NewString
()
ignoredKinds
:=
sets
.
NewString
()
RESTMapper
=
api
.
NewDefaultRESTMapper
(
"experimental"
,
Versions
,
InterfacesFor
,
importPrefix
,
ignoredKinds
,
rootScoped
)
api
.
RegisterRESTMapper
(
RESTMapper
)
}
// InterfacesFor returns the default Codec and ResourceVersioner for a given version
// string, or an error if the version is not known.
func
InterfacesFor
(
version
string
)
(
*
meta
.
VersionInterfaces
,
error
)
{
switch
version
{
case
"v1"
:
return
&
meta
.
VersionInterfaces
{
Codec
:
v1
.
Codec
,
ObjectConvertor
:
api
.
Scheme
,
MetadataAccessor
:
accessor
,
},
nil
default
:
return
nil
,
fmt
.
Errorf
(
"unsupported storage version: %s (valid: %s)"
,
version
,
strings
.
Join
(
Versions
,
", "
))
}
}
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