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
c7331249
Commit
c7331249
authored
Sep 11, 2015
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address lavalamp's comments
parent
f734a6f0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
26 additions
and
12 deletions
+26
-12
server.go
cmd/kube-apiserver/app/server.go
+5
-7
install.go
pkg/api/install/install.go
+2
-0
latest.go
pkg/api/latest/latest.go
+12
-3
fake.go
pkg/client/unversioned/fake/fake.go
+2
-0
helper.go
pkg/client/unversioned/helper.go
+1
-2
import_known_versions.go
pkg/client/unversioned/import_known_versions.go
+1
-0
install.go
pkg/expapi/install/install.go
+2
-0
import_known_versions.go
pkg/master/import_known_versions.go
+1
-0
No files found.
cmd/kube-apiserver/app/server.go
View file @
c7331249
...
...
@@ -35,7 +35,6 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/registered"
"k8s.io/kubernetes/pkg/apiserver"
"k8s.io/kubernetes/pkg/capabilities"
client
"k8s.io/kubernetes/pkg/client/unversioned"
...
...
@@ -331,10 +330,6 @@ func (s *APIServer) Run(_ []string) error {
// This takes preference over api/all, if specified.
enableExp
:=
s
.
getRuntimeConfigValue
(
"experimental/v1"
,
false
)
if
enableExp
&&
len
(
registered
.
GroupVersionsForGroup
(
"experimental"
))
==
0
{
glog
.
Fatalf
(
"experimental API is enabled in runtime config, but not registered throught environment variable KUBE_API_VERSIONS"
)
}
clientConfig
:=
&
client
.
Config
{
Host
:
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
)),
Version
:
s
.
StorageVersion
,
...
...
@@ -351,8 +346,11 @@ func (s *APIServer) Run(_ []string) error {
var
expEtcdStorage
storage
.
Interface
if
enableExp
{
expEtcdStorage
,
err
=
newEtcd
(
s
.
EtcdConfigFile
,
s
.
EtcdServerList
,
latest
.
GroupOrDie
(
"experimental"
)
.
InterfacesFor
,
latest
.
GroupOrDie
(
"experimental"
)
.
Version
,
s
.
ExpStorageVersion
,
s
.
EtcdPathPrefix
)
g
,
err
:=
latest
.
Group
(
"experimental"
)
if
err
!=
nil
{
glog
.
Fatalf
(
"experimental API is enabled in runtime config, but not enabled in the environment variable KUBE_API_VERSIONS. Error: %v"
,
err
)
}
expEtcdStorage
,
err
=
newEtcd
(
s
.
EtcdConfigFile
,
s
.
EtcdServerList
,
g
.
InterfacesFor
,
g
.
Version
,
s
.
ExpStorageVersion
,
s
.
EtcdPathPrefix
)
if
err
!=
nil
{
glog
.
Fatalf
(
"Invalid experimental storage version or misconfigured etcd: %v"
,
err
)
}
...
...
pkg/api/install/install.go
View file @
c7331249
...
...
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package install installs the v1 monolithic api, making it available as an
// option to all of the API encoding/decoding machinery.
package
install
import
(
...
...
pkg/api/latest/latest.go
View file @
c7331249
...
...
@@ -25,14 +25,19 @@ import (
)
var
(
allGroups
=
GroupMetaMap
{}
Group
=
allGroups
.
Group
allGroups
=
GroupMetaMap
{}
// Group is a shortcut to allGroups.Group.
Group
=
allGroups
.
Group
// RegisterGroup is a shortcut to allGroups.RegisterGroup.
RegisterGroup
=
allGroups
.
RegisterGroup
GroupOrDie
=
allGroups
.
GroupOrDie
// GroupOrDie is a shortcut to allGroups.GroupOrDie.
GroupOrDie
=
allGroups
.
GroupOrDie
)
// GroupMetaMap is a map between group names and their metadata.
type
GroupMetaMap
map
[
string
]
*
GroupMeta
// RegisterGroup registers a group to GroupMetaMap.
func
(
g
GroupMetaMap
)
RegisterGroup
(
group
string
)
(
*
GroupMeta
,
error
)
{
_
,
found
:=
g
[
group
]
if
found
{
...
...
@@ -45,6 +50,8 @@ func (g GroupMetaMap) RegisterGroup(group string) (*GroupMeta, error) {
return
g
[
group
],
nil
}
// Group returns the metadata of a group if the gruop is registered, otherwise
// an erorr is returned.
func
(
g
GroupMetaMap
)
Group
(
group
string
)
(
*
GroupMeta
,
error
)
{
groupMeta
,
found
:=
g
[
group
]
if
!
found
{
...
...
@@ -100,5 +107,7 @@ type GroupMeta struct {
// Kubernetes versions.
RESTMapper
meta
.
RESTMapper
// InterfacesFor returns the default Codec and ResourceVersioner for a given version
// string, or an error if the version is not known.
InterfacesFor
func
(
version
string
)
(
*
meta
.
VersionInterfaces
,
error
)
}
pkg/client/unversioned/fake/fake.go
View file @
c7331249
...
...
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// This is made a separate package and should only be imported by tests, because
// it imports testapi
package
fake
import
(
...
...
pkg/client/unversioned/helper.go
View file @
c7331249
...
...
@@ -33,7 +33,6 @@ import (
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/latest"
"k8s.io/kubernetes/pkg/api/registered"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/sets"
...
...
@@ -142,7 +141,7 @@ func New(c *Config) (*Client, error) {
return
nil
,
err
}
if
len
(
registered
.
GroupVersionsForGroup
(
"experimental"
))
==
0
{
if
_
,
err
:=
latest
.
Group
(
"experimental"
);
err
!=
nil
{
return
&
Client
{
RESTClient
:
client
,
ExperimentalClient
:
nil
},
nil
}
experimentalConfig
:=
*
c
...
...
pkg/client/unversioned/import_known_versions.go
View file @
c7331249
...
...
@@ -16,6 +16,7 @@ limitations under the License.
package
unversioned
// These imports are the API groups the client will support.
import
(
_
"k8s.io/kubernetes/pkg/api/install"
_
"k8s.io/kubernetes/pkg/expapi/install"
...
...
pkg/expapi/install/install.go
View file @
c7331249
...
...
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package install installs the experimental API group, making it available as
// an option to all of the API encoding/decoding machinery.
package
install
import
(
...
...
pkg/master/import_known_versions.go
View file @
c7331249
...
...
@@ -16,6 +16,7 @@ limitations under the License.
package
master
// These imports are the API groups the API server will support.
import
(
_
"k8s.io/kubernetes/pkg/api/install"
_
"k8s.io/kubernetes/pkg/expapi/install"
...
...
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