2014-06-16 06:29:07 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 Google Inc. 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 master
|
|
|
|
|
|
|
|
import (
|
2014-09-18 23:03:34 +00:00
|
|
|
"net"
|
2014-10-23 23:55:14 +00:00
|
|
|
"net/http"
|
2014-10-28 00:56:33 +00:00
|
|
|
"strconv"
|
2014-10-23 23:55:14 +00:00
|
|
|
"strings"
|
2014-06-16 06:29:07 +00:00
|
|
|
"time"
|
|
|
|
|
2014-09-11 23:01:29 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
2014-09-11 17:02:53 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
|
2014-09-11 17:04:13 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
|
2014-06-16 06:29:07 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
|
2014-10-27 21:18:02 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/authenticator"
|
2014-10-23 23:55:14 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/authenticator/bearertoken"
|
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/authenticator/tokenfile"
|
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/handlers"
|
2014-06-16 06:29:07 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
2014-06-17 17:50:42 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
2014-08-15 23:01:33 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/binding"
|
2014-08-11 07:34:59 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller"
|
2014-08-14 19:48:34 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint"
|
2014-08-11 07:34:59 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/etcd"
|
2014-10-09 22:46:41 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/event"
|
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
|
2014-08-11 07:34:59 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/minion"
|
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/pod"
|
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/service"
|
2014-09-02 17:55:27 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
2014-09-11 23:01:29 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
|
2014-10-23 20:56:18 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/ui"
|
2014-06-16 06:29:07 +00:00
|
|
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
2014-10-23 23:55:14 +00:00
|
|
|
|
|
|
|
"github.com/golang/glog"
|
2014-06-16 06:29:07 +00:00
|
|
|
)
|
|
|
|
|
2014-07-27 02:16:39 +00:00
|
|
|
// Config is a structure used to configure a Master.
|
|
|
|
type Config struct {
|
2014-10-23 23:55:14 +00:00
|
|
|
Client *client.Client
|
|
|
|
Cloud cloudprovider.Interface
|
|
|
|
EtcdHelper tools.EtcdHelper
|
|
|
|
HealthCheckMinions bool
|
|
|
|
EventTTL time.Duration
|
|
|
|
MinionRegexp string
|
|
|
|
KubeletClient client.KubeletClient
|
|
|
|
PortalNet *net.IPNet
|
|
|
|
Mux apiserver.Mux
|
|
|
|
EnableLogsSupport bool
|
|
|
|
EnableUISupport bool
|
|
|
|
APIPrefix string
|
|
|
|
CorsAllowedOriginList util.StringList
|
|
|
|
TokenAuthFile string
|
2014-10-16 21:18:16 +00:00
|
|
|
AuthorizationMode string
|
2014-10-28 00:56:33 +00:00
|
|
|
|
2014-10-28 23:49:52 +00:00
|
|
|
// Number of masters running; all masters must be started with the
|
|
|
|
// same value for this field. (Numbers > 1 currently untested.)
|
|
|
|
MasterCount int
|
|
|
|
|
2014-10-28 00:56:33 +00:00
|
|
|
// The port on PublicAddress where a read-only server will be installed.
|
|
|
|
// Defaults to 7080 if not set.
|
|
|
|
ReadOnlyPort int
|
|
|
|
// The port on PublicAddress where a read-write server will be installed.
|
|
|
|
// Defaults to 443 if not set.
|
|
|
|
ReadWritePort int
|
|
|
|
|
|
|
|
// If empty, the first result from net.InterfaceAddrs will be used.
|
|
|
|
PublicAddress string
|
2014-07-27 02:16:39 +00:00
|
|
|
}
|
|
|
|
|
2014-06-16 06:29:07 +00:00
|
|
|
// Master contains state for a Kubernetes cluster master/api server.
|
|
|
|
type Master struct {
|
2014-10-23 23:55:14 +00:00
|
|
|
// "Inputs", Copied from Config
|
|
|
|
podRegistry pod.Registry
|
|
|
|
controllerRegistry controller.Registry
|
|
|
|
serviceRegistry service.Registry
|
|
|
|
endpointRegistry endpoint.Registry
|
|
|
|
minionRegistry minion.Registry
|
|
|
|
bindingRegistry binding.Registry
|
|
|
|
eventRegistry generic.Registry
|
|
|
|
storage map[string]apiserver.RESTStorage
|
|
|
|
client *client.Client
|
|
|
|
portalNet *net.IPNet
|
|
|
|
mux apiserver.Mux
|
|
|
|
enableLogsSupport bool
|
|
|
|
enableUISupport bool
|
|
|
|
apiPrefix string
|
|
|
|
corsAllowedOriginList util.StringList
|
|
|
|
tokenAuthFile string
|
2014-10-16 21:18:16 +00:00
|
|
|
authorizationzMode string
|
2014-10-28 23:49:52 +00:00
|
|
|
masterCount int
|
2014-10-28 00:56:33 +00:00
|
|
|
|
2014-10-23 23:55:14 +00:00
|
|
|
// "Outputs"
|
|
|
|
Handler http.Handler
|
2014-10-28 00:56:33 +00:00
|
|
|
|
2014-10-28 23:49:52 +00:00
|
|
|
readOnlyServer string
|
|
|
|
readWriteServer string
|
|
|
|
masterServices *util.Runner
|
2014-06-16 06:29:07 +00:00
|
|
|
}
|
|
|
|
|
2014-09-11 23:01:29 +00:00
|
|
|
// NewEtcdHelper returns an EtcdHelper for the provided arguments or an error if the version
|
|
|
|
// is incorrect.
|
2014-09-26 01:11:01 +00:00
|
|
|
func NewEtcdHelper(client tools.EtcdGetSet, version string) (helper tools.EtcdHelper, err error) {
|
2014-09-11 23:01:29 +00:00
|
|
|
if version == "" {
|
|
|
|
version = latest.Version
|
|
|
|
}
|
2014-09-25 22:08:09 +00:00
|
|
|
versionInterfaces, err := latest.InterfacesFor(version)
|
2014-09-11 23:01:29 +00:00
|
|
|
if err != nil {
|
|
|
|
return helper, err
|
|
|
|
}
|
2014-10-27 03:01:17 +00:00
|
|
|
return tools.EtcdHelper{client, versionInterfaces.Codec, tools.RuntimeVersionAdapter{versionInterfaces.MetadataAccessor}}, nil
|
2014-09-11 23:01:29 +00:00
|
|
|
}
|
|
|
|
|
2014-10-28 00:56:33 +00:00
|
|
|
// setDefaults fills in any fields not set that are required to have valid data.
|
|
|
|
func setDefaults(c *Config) {
|
2014-10-29 19:27:35 +00:00
|
|
|
if c.PortalNet == nil {
|
|
|
|
defaultNet := "10.0.0.0/24"
|
|
|
|
glog.Warningf("Portal net unspecified. Defaulting to %v.", defaultNet)
|
|
|
|
_, portalNet, err := net.ParseCIDR(defaultNet)
|
|
|
|
if err != nil {
|
|
|
|
glog.Fatalf("Unable to parse CIDR: %v", err)
|
|
|
|
}
|
|
|
|
c.PortalNet = portalNet
|
|
|
|
}
|
2014-10-28 23:49:52 +00:00
|
|
|
if c.MasterCount == 0 {
|
|
|
|
// Clearly, there will be at least one master.
|
|
|
|
c.MasterCount = 1
|
|
|
|
}
|
2014-10-28 00:56:33 +00:00
|
|
|
if c.ReadOnlyPort == 0 {
|
|
|
|
c.ReadOnlyPort = 7080
|
|
|
|
}
|
|
|
|
if c.ReadWritePort == 0 {
|
|
|
|
c.ReadWritePort = 443
|
|
|
|
}
|
|
|
|
if c.PublicAddress == "" {
|
2014-10-28 23:49:52 +00:00
|
|
|
// Find and use the first non-loopback address.
|
|
|
|
// TODO: potentially it'd be useful to skip the docker interface if it
|
|
|
|
// somehow is first in the list.
|
2014-10-28 00:56:33 +00:00
|
|
|
addrs, err := net.InterfaceAddrs()
|
|
|
|
if err != nil {
|
|
|
|
glog.Fatalf("Unable to get network interfaces: error='%v'", err)
|
|
|
|
}
|
|
|
|
found := false
|
|
|
|
for i := range addrs {
|
|
|
|
ip, _, err := net.ParseCIDR(addrs[i].String())
|
|
|
|
if err != nil {
|
|
|
|
glog.Errorf("Error parsing '%v': %v", addrs[i], err)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if ip.IsLoopback() {
|
|
|
|
glog.Infof("'%v' (%v) is a loopback address, ignoring.", ip, addrs[i])
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
found = true
|
|
|
|
c.PublicAddress = ip.String()
|
|
|
|
glog.Infof("Will report %v as public IP address.", ip)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
if !found {
|
|
|
|
glog.Fatalf("Unable to find suitible network address in list: %v", addrs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-28 20:02:19 +00:00
|
|
|
// New returns a new instance of Master from the given config.
|
|
|
|
// Certain config fields will be set to a default value if unset,
|
|
|
|
// including:
|
|
|
|
// PortalNet
|
|
|
|
// MasterCount
|
|
|
|
// ReadOnlyPort
|
|
|
|
// ReadWritePort
|
|
|
|
// PublicAddress
|
|
|
|
// Certain config fields must be specified, including:
|
|
|
|
// KubeletClient
|
|
|
|
// Public fields:
|
|
|
|
// Handler -- The returned master has a field TopHandler which is an
|
|
|
|
// http.Handler which handles all the endpoints provided by the master,
|
|
|
|
// including the API, the UI, and miscelaneous debugging endpoints. All
|
|
|
|
// these are subject to authorization and authentication.
|
|
|
|
// Public methods:
|
|
|
|
// HandleWithAuth -- Allows caller to add an http.Handler for an endpoint
|
|
|
|
// that uses the same authentication and authorization (if any is configured)
|
|
|
|
// as the master's built-in endpoints.
|
|
|
|
// If the caller wants to add additional endpoints not using the master's
|
|
|
|
// auth, then the caller should create a handler for those endpoints, which delegates the
|
|
|
|
// any unhandled paths to "Handler".
|
2014-07-27 02:16:39 +00:00
|
|
|
func New(c *Config) *Master {
|
2014-10-28 00:56:33 +00:00
|
|
|
setDefaults(c)
|
2014-08-20 00:41:06 +00:00
|
|
|
minionRegistry := makeMinionRegistry(c)
|
2014-09-23 20:43:48 +00:00
|
|
|
serviceRegistry := etcd.NewRegistry(c.EtcdHelper, nil)
|
2014-10-09 17:27:47 +00:00
|
|
|
boundPodFactory := &pod.BasicBoundPodFactory{
|
2014-09-23 20:43:48 +00:00
|
|
|
ServiceRegistry: serviceRegistry,
|
|
|
|
}
|
2014-11-03 22:50:41 +00:00
|
|
|
if c.KubeletClient == nil {
|
|
|
|
glog.Fatalf("master.New() called with config.KubeletClient == nil")
|
|
|
|
}
|
2014-06-16 06:29:07 +00:00
|
|
|
m := &Master{
|
2014-10-23 23:55:14 +00:00
|
|
|
podRegistry: etcd.NewRegistry(c.EtcdHelper, boundPodFactory),
|
|
|
|
controllerRegistry: etcd.NewRegistry(c.EtcdHelper, nil),
|
|
|
|
serviceRegistry: serviceRegistry,
|
|
|
|
endpointRegistry: etcd.NewRegistry(c.EtcdHelper, nil),
|
|
|
|
bindingRegistry: etcd.NewRegistry(c.EtcdHelper, boundPodFactory),
|
|
|
|
eventRegistry: event.NewEtcdRegistry(c.EtcdHelper, uint64(c.EventTTL.Seconds())),
|
|
|
|
minionRegistry: minionRegistry,
|
|
|
|
client: c.Client,
|
|
|
|
portalNet: c.PortalNet,
|
2014-10-28 20:02:19 +00:00
|
|
|
mux: http.NewServeMux(),
|
2014-10-23 23:55:14 +00:00
|
|
|
enableLogsSupport: c.EnableLogsSupport,
|
|
|
|
enableUISupport: c.EnableUISupport,
|
|
|
|
apiPrefix: c.APIPrefix,
|
|
|
|
corsAllowedOriginList: c.CorsAllowedOriginList,
|
|
|
|
tokenAuthFile: c.TokenAuthFile,
|
2014-10-16 21:18:16 +00:00
|
|
|
authorizationzMode: c.AuthorizationMode,
|
|
|
|
|
|
|
|
masterCount: c.MasterCount,
|
|
|
|
readOnlyServer: net.JoinHostPort(c.PublicAddress, strconv.Itoa(int(c.ReadOnlyPort))),
|
|
|
|
readWriteServer: net.JoinHostPort(c.PublicAddress, strconv.Itoa(int(c.ReadWritePort))),
|
2014-06-16 06:29:07 +00:00
|
|
|
}
|
2014-10-28 23:49:52 +00:00
|
|
|
m.masterServices = util.NewRunner(m.serviceWriterLoop, m.roServiceWriterLoop)
|
2014-10-08 23:14:37 +00:00
|
|
|
m.init(c)
|
2014-06-16 06:29:07 +00:00
|
|
|
return m
|
|
|
|
}
|
|
|
|
|
2014-10-28 20:02:19 +00:00
|
|
|
// HandleWithAuth adds an http.Handler for pattern to an http.ServeMux
|
|
|
|
// Applies the same authentication and authorization (if any is configured)
|
|
|
|
// to the request is used for the master's built-in endpoints.
|
|
|
|
func (m *Master) HandleWithAuth(pattern string, handler http.Handler) {
|
|
|
|
// TODO: Add a way for plugged-in endpoints to translate their
|
|
|
|
// URLs into attributes that an Authorizer can understand, and have
|
|
|
|
// sensible policy defaults for plugged-in endpoints. This will be different
|
|
|
|
// for generic endpoints versus REST object endpoints.
|
|
|
|
m.mux.Handle(pattern, handler)
|
|
|
|
}
|
|
|
|
|
|
|
|
// HandleFuncWithAuth adds an http.Handler for pattern to an http.ServeMux
|
|
|
|
// Applies the same authentication and authorization (if any is configured)
|
|
|
|
// to the request is used for the master's built-in endpoints.
|
|
|
|
func (m *Master) HandleFuncWithAuth(pattern string, handler func(http.ResponseWriter, *http.Request)) {
|
|
|
|
m.mux.HandleFunc(pattern, handler)
|
|
|
|
}
|
|
|
|
|
2014-08-20 00:41:06 +00:00
|
|
|
func makeMinionRegistry(c *Config) minion.Registry {
|
2014-10-08 23:14:37 +00:00
|
|
|
var minionRegistry minion.Registry = etcd.NewRegistry(c.EtcdHelper, nil)
|
|
|
|
if c.HealthCheckMinions {
|
2014-10-10 22:19:23 +00:00
|
|
|
minionRegistry = minion.NewHealthyRegistry(minionRegistry, c.KubeletClient)
|
2014-10-08 23:14:37 +00:00
|
|
|
}
|
|
|
|
return minionRegistry
|
|
|
|
}
|
|
|
|
|
|
|
|
// init initializes master.
|
|
|
|
func (m *Master) init(c *Config) {
|
2014-10-10 22:19:23 +00:00
|
|
|
podCache := NewPodCache(c.KubeletClient, m.podRegistry)
|
2014-10-08 23:14:37 +00:00
|
|
|
go util.Forever(func() { podCache.UpdateAllContainers() }, time.Second*30)
|
|
|
|
|
2014-10-27 21:18:02 +00:00
|
|
|
var userContexts = handlers.NewUserRequestContext()
|
|
|
|
var authenticator authenticator.Request
|
|
|
|
if len(c.TokenAuthFile) != 0 {
|
|
|
|
tokenAuthenticator, err := tokenfile.New(c.TokenAuthFile)
|
|
|
|
if err != nil {
|
|
|
|
glog.Fatalf("Unable to load the token authentication file '%s': %v", c.TokenAuthFile, err)
|
|
|
|
}
|
|
|
|
authenticator = bearertoken.New(tokenAuthenticator)
|
|
|
|
}
|
|
|
|
|
2014-06-16 06:29:07 +00:00
|
|
|
m.storage = map[string]apiserver.RESTStorage{
|
2014-09-08 21:40:56 +00:00
|
|
|
"pods": pod.NewREST(&pod.RESTConfig{
|
2014-10-08 23:14:37 +00:00
|
|
|
CloudProvider: c.Cloud,
|
2014-08-11 07:34:59 +00:00
|
|
|
PodCache: podCache,
|
2014-10-10 22:19:23 +00:00
|
|
|
PodInfoGetter: c.KubeletClient,
|
2014-08-11 07:34:59 +00:00
|
|
|
Registry: m.podRegistry,
|
2014-10-21 21:14:35 +00:00
|
|
|
Minions: m.client.Minions(),
|
2014-08-11 07:34:59 +00:00
|
|
|
}),
|
2014-09-08 21:40:56 +00:00
|
|
|
"replicationControllers": controller.NewREST(m.controllerRegistry, m.podRegistry),
|
2014-09-18 23:03:34 +00:00
|
|
|
"services": service.NewREST(m.serviceRegistry, c.Cloud, m.minionRegistry, m.portalNet),
|
2014-09-08 21:40:56 +00:00
|
|
|
"endpoints": endpoint.NewREST(m.endpointRegistry),
|
|
|
|
"minions": minion.NewREST(m.minionRegistry),
|
2014-10-09 22:46:41 +00:00
|
|
|
"events": event.NewREST(m.eventRegistry),
|
2014-08-15 23:01:33 +00:00
|
|
|
|
|
|
|
// TODO: should appear only in scheduler API group.
|
2014-09-08 21:40:56 +00:00
|
|
|
"bindings": binding.NewREST(m.bindingRegistry),
|
2014-06-16 06:29:07 +00:00
|
|
|
}
|
2014-10-28 00:56:33 +00:00
|
|
|
|
2014-10-23 20:56:18 +00:00
|
|
|
apiserver.NewAPIGroup(m.API_v1beta1()).InstallREST(m.mux, c.APIPrefix+"/v1beta1")
|
|
|
|
apiserver.NewAPIGroup(m.API_v1beta2()).InstallREST(m.mux, c.APIPrefix+"/v1beta2")
|
2014-10-29 00:20:40 +00:00
|
|
|
versionHandler := apiserver.APIVersionHandler("v1beta1", "v1beta2")
|
|
|
|
m.mux.Handle(c.APIPrefix, versionHandler)
|
2014-10-23 20:56:18 +00:00
|
|
|
apiserver.InstallSupport(m.mux)
|
|
|
|
if c.EnableLogsSupport {
|
|
|
|
apiserver.InstallLogsSupport(m.mux)
|
|
|
|
}
|
|
|
|
if c.EnableUISupport {
|
|
|
|
ui.InstallSupport(m.mux)
|
|
|
|
}
|
2014-10-23 23:55:14 +00:00
|
|
|
|
|
|
|
handler := http.Handler(m.mux.(*http.ServeMux))
|
|
|
|
|
|
|
|
if len(c.CorsAllowedOriginList) > 0 {
|
|
|
|
allowedOriginRegexps, err := util.CompileRegexps(c.CorsAllowedOriginList)
|
|
|
|
if err != nil {
|
|
|
|
glog.Fatalf("Invalid CORS allowed origin, --cors_allowed_origins flag was set to %v - %v", strings.Join(c.CorsAllowedOriginList, ","), err)
|
|
|
|
}
|
|
|
|
handler = apiserver.CORS(handler, allowedOriginRegexps, nil, nil, "true")
|
|
|
|
}
|
|
|
|
|
2014-10-16 21:18:16 +00:00
|
|
|
// Install Authorizer
|
|
|
|
authorizer, err := apiserver.NewAuthorizerFromAuthorizationConfig(m.authorizationzMode)
|
|
|
|
if err != nil {
|
|
|
|
glog.Fatal(err)
|
|
|
|
}
|
|
|
|
handler = apiserver.WithAuthorizationCheck(handler, apiserver.BasicAttributeGetter, authorizer)
|
|
|
|
|
|
|
|
// Install Authenticator
|
2014-10-27 21:18:02 +00:00
|
|
|
if authenticator != nil {
|
|
|
|
handler = handlers.NewRequestAuthenticator(userContexts, authenticator, handlers.Unauthorized, handler)
|
2014-10-23 23:55:14 +00:00
|
|
|
}
|
2014-10-27 21:18:02 +00:00
|
|
|
m.mux.HandleFunc("/_whoami", handleWhoAmI(authenticator))
|
|
|
|
|
2014-10-23 23:55:14 +00:00
|
|
|
m.Handler = handler
|
2014-10-28 00:56:33 +00:00
|
|
|
|
2014-10-28 23:49:52 +00:00
|
|
|
// TODO: Attempt clean shutdown?
|
|
|
|
m.masterServices.Start()
|
2014-06-16 06:29:07 +00:00
|
|
|
}
|
|
|
|
|
2014-09-02 10:00:28 +00:00
|
|
|
// API_v1beta1 returns the resources and codec for API version v1beta1.
|
2014-09-26 00:20:28 +00:00
|
|
|
func (m *Master) API_v1beta1() (map[string]apiserver.RESTStorage, runtime.Codec, string, runtime.SelfLinker) {
|
2014-08-09 21:12:55 +00:00
|
|
|
storage := make(map[string]apiserver.RESTStorage)
|
|
|
|
for k, v := range m.storage {
|
|
|
|
storage[k] = v
|
2014-06-16 06:29:07 +00:00
|
|
|
}
|
2014-09-26 00:20:28 +00:00
|
|
|
return storage, v1beta1.Codec, "/api/v1beta1", latest.SelfLinker
|
2014-06-24 01:28:06 +00:00
|
|
|
}
|
2014-09-11 17:04:13 +00:00
|
|
|
|
|
|
|
// API_v1beta2 returns the resources and codec for API version v1beta2.
|
2014-09-26 00:20:28 +00:00
|
|
|
func (m *Master) API_v1beta2() (map[string]apiserver.RESTStorage, runtime.Codec, string, runtime.SelfLinker) {
|
2014-09-11 17:04:13 +00:00
|
|
|
storage := make(map[string]apiserver.RESTStorage)
|
|
|
|
for k, v := range m.storage {
|
|
|
|
storage[k] = v
|
|
|
|
}
|
2014-10-17 21:06:30 +00:00
|
|
|
return storage, v1beta2.Codec, "/api/v1beta2", latest.SelfLinker
|
2014-09-11 17:04:13 +00:00
|
|
|
}
|