Skip to content

Commit

Permalink
"experimental" -> "extensions"
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Xu committed Oct 9, 2015
1 parent 138eeae commit 80f213c
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 75 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cmd/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
if err != nil {
glog.Fatalf("Unable to get etcd storage: %v", err)
}
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("experimental").InterfacesFor, testapi.Experimental.GroupAndVersion(), etcdtest.PathPrefix())
storageVersions["experimental"] = testapi.Experimental.GroupAndVersion()
expEtcdStorage, err := master.NewEtcdStorage(etcdClient, latest.GroupOrDie("extensions").InterfacesFor, testapi.Experimental.GroupAndVersion(), etcdtest.PathPrefix())
storageVersions["extensions"] = testapi.Experimental.GroupAndVersion()
if err != nil {
glog.Fatalf("Unable to get etcd storage for experimental: %v", err)
}
storageDestinations := master.NewStorageDestinations()
storageDestinations.AddAPIGroup("", etcdStorage)
storageDestinations.AddAPIGroup("experimental", expEtcdStorage)
storageDestinations.AddAPIGroup("extensions", expEtcdStorage)

// Master
host, port, err := net.SplitHostPort(strings.TrimLeft(apiServer.URL, "http://"))
Expand Down
4 changes: 2 additions & 2 deletions cmd/kube-apiserver/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func (s *APIServer) Run(_ []string) error {
storageDestinations.AddAPIGroup("", etcdStorage)

if enableExp {
expGroup, err := latest.Group("experimental")
expGroup, err := latest.Group("extensions")
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)
}
Expand All @@ -443,7 +443,7 @@ func (s *APIServer) Run(_ []string) error {
if err != nil {
glog.Fatalf("Invalid experimental storage version or misconfigured etcd: %v", err)
}
storageDestinations.AddAPIGroup("experimental", expEtcdStorage)
storageDestinations.AddAPIGroup("extensions", expEtcdStorage)
}

updateEtcdOverrides(s.EtcdServersOverrides, storageVersions, s.EtcdPathPrefix, &storageDestinations, newEtcd)
Expand Down
6 changes: 3 additions & 3 deletions cmd/kube-apiserver/app/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ func TestGenerateStorageVersionMap(t *testing.T) {
storageVersions: "v1,extensions/v1beta1",
expectedMap: map[string]string{
"": "v1",
"experimental": "extensions/v1beta1",
"extensions": "extensions/v1beta1",
},
},
{
legacyVersion: "",
storageVersions: "extensions/v1beta1,v1",
expectedMap: map[string]string{
"": "v1",
"experimental": "extensions/v1beta1",
"extensions": "extensions/v1beta1",
},
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestUpdateEtcdOverrides(t *testing.T) {
servers: []string{"http://127.0.0.1:10000", "http://127.0.0.1:20000"},
},
{
apigroup: "experimental",
apigroup: "extensions",
resource: "resource",
servers: []string{"http://127.0.0.1:10000"},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewDefaultRESTMapper(group string, versions []string, interfacesFunc meta.V
for _, version := range versions {
for kind, oType := range Scheme.KnownTypes(version) {
// TODO: Remove import path prefix check.
// We check the import path prefix because we currently stuff both "api" and "experimental" objects
// We check the import path prefix because we currently stuff both "api" and "extensions" objects
// into the same group within Scheme since Scheme has no notion of groups yet.
if !strings.HasPrefix(oType.PkgPath(), importPathPrefix) || ignoredKinds.Has(kind) {
continue
Expand Down
18 changes: 9 additions & 9 deletions pkg/api/testapi/testapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ func init() {
// have multiple group support
Groups[""] = TestGroup{"", latest.GroupOrDie("").Version, latest.GroupOrDie("").GroupVersion}
}
if _, ok := Groups["experimental"]; !ok {
Groups["experimental"] = TestGroup{"experimental", latest.GroupOrDie("experimental").Version, latest.GroupOrDie("experimental").GroupVersion}
if _, ok := Groups["extensions"]; !ok {
Groups["extensions"] = TestGroup{"extensions", latest.GroupOrDie("extensions").Version, latest.GroupOrDie("extensions").GroupVersion}
}

Default = Groups[""]
Experimental = Groups["experimental"]
Experimental = Groups["extensions"]
}

// Version returns the API version to test against, as set by the KUBE_TEST_API env var.
Expand All @@ -97,8 +97,8 @@ func (g TestGroup) Codec() runtime.Codec {
}
return interfaces.Codec
}
if g.Group == "experimental" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.GroupVersionUnderTest)
if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.GroupVersionUnderTest)
if err != nil {
panic(err)
}
Expand All @@ -118,8 +118,8 @@ func (g TestGroup) Converter() runtime.ObjectConvertor {
}
return interfaces.ObjectConvertor
}
if g.Group == "experimental" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.VersionUnderTest)
if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.VersionUnderTest)
if err != nil {
panic(err)
}
Expand All @@ -140,8 +140,8 @@ func (g TestGroup) MetadataAccessor() meta.MetadataAccessor {
}
return interfaces.MetadataAccessor
}
if g.Group == "experimental" {
interfaces, err := latest.GroupOrDie("experimental").InterfacesFor(g.VersionUnderTest)
if g.Group == "extensions" {
interfaces, err := latest.GroupOrDie("extensions").InterfacesFor(g.VersionUnderTest)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/util/group_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestGetGroup(t *testing.T) {
},
{
"extensions/v1beta1",
"experimental",
"extensions",
},
}
for _, test := range testCases {
Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/extensions/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const importPrefix = "k8s.io/kubernetes/pkg/apis/extensions"
var accessor = meta.NewAccessor()

func init() {
groupMeta, err := latest.RegisterGroup("experimental")
groupMeta, err := latest.RegisterGroup("extensions")
if err != nil {
glog.V(4).Infof("%v", err)
return
}
registeredGroupVersions := registered.GroupVersionsForGroup("experimental")
registeredGroupVersions := registered.GroupVersionsForGroup("extensions")
groupVersion := registeredGroupVersions[0]
*groupMeta = latest.GroupMeta{
GroupVersion: groupVersion,
Expand All @@ -70,7 +70,7 @@ func init() {

ignoredKinds := sets.NewString()

groupMeta.RESTMapper = api.NewDefaultRESTMapper("experimental", groupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
groupMeta.RESTMapper = api.NewDefaultRESTMapper("extensions", groupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
api.RegisterRESTMapper(groupMeta.RESTMapper)
groupMeta.InterfacesFor = interfacesFor
}
Expand All @@ -86,7 +86,7 @@ func interfacesFor(version string) (*meta.VersionInterfaces, error) {
MetadataAccessor: accessor,
}, nil
default:
g, _ := latest.Group("experimental")
g, _ := latest.Group("extensions")
return nil, fmt.Errorf("unsupported storage version: %s (valid: %s)", version, strings.Join(g.Versions, ", "))
}
}
20 changes: 10 additions & 10 deletions pkg/apis/extensions/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,41 @@ func TestCodec(t *testing.T) {
daemonSet := experimental.DaemonSet{}
// We do want to use package latest rather than testapi here, because we
// want to test if the package install and package latest work as expected.
data, err := latest.GroupOrDie("experimental").Codec.Encode(&daemonSet)
data, err := latest.GroupOrDie("extensions").Codec.Encode(&daemonSet)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
other := experimental.DaemonSet{}
if err := json.Unmarshal(data, &other); err != nil {
t.Fatalf("unexpected error: %v", err)
}
if other.APIVersion != latest.GroupOrDie("experimental").GroupVersion || other.Kind != "DaemonSet" {
if other.APIVersion != latest.GroupOrDie("extensions").GroupVersion || other.Kind != "DaemonSet" {
t.Errorf("unexpected unmarshalled object %#v", other)
}
}

func TestInterfacesFor(t *testing.T) {
if _, err := latest.GroupOrDie("experimental").InterfacesFor(""); err == nil {
if _, err := latest.GroupOrDie("extensions").InterfacesFor(""); err == nil {
t.Fatalf("unexpected non-error: %v", err)
}
for i, groupVersion := range append([]string{latest.GroupOrDie("experimental").GroupVersion}, latest.GroupOrDie("experimental").GroupVersions...) {
if vi, err := latest.GroupOrDie("experimental").InterfacesFor(groupVersion); err != nil || vi == nil {
for i, groupVersion := range append([]string{latest.GroupOrDie("extensions").GroupVersion}, latest.GroupOrDie("extensions").GroupVersions...) {
if vi, err := latest.GroupOrDie("extensions").InterfacesFor(groupVersion); err != nil || vi == nil {
t.Fatalf("%d: unexpected result: %v", i, err)
}
}
}

func TestRESTMapper(t *testing.T) {
if v, k, err := latest.GroupOrDie("experimental").RESTMapper.VersionAndKindForResource("horizontalpodautoscalers"); err != nil || v != "extensions/v1beta1" || k != "HorizontalPodAutoscaler" {
if v, k, err := latest.GroupOrDie("extensions").RESTMapper.VersionAndKindForResource("horizontalpodautoscalers"); err != nil || v != "extensions/v1beta1" || k != "HorizontalPodAutoscaler" {
t.Errorf("unexpected version mapping: %s %s %v", v, k, err)
}

if m, err := latest.GroupOrDie("experimental").RESTMapper.RESTMapping("DaemonSet", ""); err != nil || m.APIVersion != "extensions/v1beta1" || m.Resource != "daemonsets" {
if m, err := latest.GroupOrDie("extensions").RESTMapper.RESTMapping("DaemonSet", ""); err != nil || m.APIVersion != "extensions/v1beta1" || m.Resource != "daemonsets" {
t.Errorf("unexpected version mapping: %#v %v", m, err)
}

for _, groupVersion := range latest.GroupOrDie("experimental").GroupVersions {
mapping, err := latest.GroupOrDie("experimental").RESTMapper.RESTMapping("HorizontalPodAutoscaler", groupVersion)
for _, groupVersion := range latest.GroupOrDie("extensions").GroupVersions {
mapping, err := latest.GroupOrDie("extensions").RESTMapper.RESTMapping("HorizontalPodAutoscaler", groupVersion)
if err != nil {
t.Errorf("unexpected error: %v", err)
}
Expand All @@ -96,7 +96,7 @@ func TestRESTMapper(t *testing.T) {
t.Errorf("incorrect groupVersion: %v", mapping)
}

interfaces, _ := latest.GroupOrDie("experimental").InterfacesFor(groupVersion)
interfaces, _ := latest.GroupOrDie("extensions").InterfacesFor(groupVersion)
if mapping.Codec != interfaces.Codec {
t.Errorf("unexpected codec: %#v, expected: %#v", mapping, interfaces)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/extensions/v1beta1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func addDefaultingFuncs() {
api.Scheme.AddDefaultingFuncs(
func(obj *APIVersion) {
if len(obj.APIGroup) == 0 {
obj.APIGroup = "experimental"
obj.APIGroup = "extensions"
}
},
func(obj *DaemonSet) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ func TestGetAPIRequestInfo(t *testing.T) {
{"POST", "/api/v1/namespaces/other/pods", "create", "api", "", "v1", "other", "pods", "", "", []string{"pods"}},

// api group identification
{"POST", "/apis/extensions/v1/namespaces/other/pods", "create", "api", "experimental", "v1", "other", "pods", "", "", []string{"pods"}},
{"POST", "/apis/extensions/v1/namespaces/other/pods", "create", "api", "extensions", "v1", "other", "pods", "", "", []string{"pods"}},

// api version identification
{"POST", "/apis/extensions/v1beta3/namespaces/other/pods", "create", "api", "experimental", "v1beta3", "other", "pods", "", "", []string{"pods"}},
{"POST", "/apis/extensions/v1beta3/namespaces/other/pods", "create", "api", "extensions", "v1beta3", "other", "pods", "", "", []string{"pods"}},
}

apiRequestInfoResolver := newTestAPIRequestInfoResolver()
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/unversioned/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func NewExperimentalOrDie(c *Config) *ExperimentalClient {

func setExperimentalDefaults(config *Config) error {
// if experimental group is not registered, return an error
g, err := latest.Group("experimental")
g, err := latest.Group("extensions")
if err != nil {
return err
}
Expand All @@ -146,7 +146,7 @@ func setExperimentalDefaults(config *Config) error {
versionInterfaces, err := g.InterfacesFor(config.Version)
if err != nil {
return fmt.Errorf("Experimental API version '%s' is not recognized (valid values: %s)",
config.Version, strings.Join(latest.GroupOrDie("experimental").Versions, ", "))
config.Version, strings.Join(latest.GroupOrDie("extensions").Versions, ", "))
}
config.Codec = versionInterfaces.Codec
if config.QPS == 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/unversioned/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func New(c *Config) (*Client, error) {
return nil, err
}

if _, err := latest.Group("experimental"); err != nil {
if _, err := latest.Group("extensions"); err != nil {
return &Client{RESTClient: client, ExperimentalClient: nil}, nil
}
experimentalConfig := *c
Expand Down
4 changes: 2 additions & 2 deletions pkg/kubectl/cmd/util/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
switch group {
case "":
return client.RESTClient, nil
case "experimental":
case "extensions":
return client.ExperimentalClient.RESTClient, nil
}
return nil, fmt.Errorf("unable to get RESTClient for resource '%s'", mapping.Resource)
Expand Down Expand Up @@ -406,7 +406,7 @@ func (c *clientSwaggerSchema) ValidateBytes(data []byte) error {
if err != nil {
return fmt.Errorf("could not find api group for %s: %v", kind, err)
}
if group == "experimental" {
if group == "extensions" {
if c.c.ExperimentalClient == nil {
return errors.New("unable to validate: no experimental client")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubectl/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func DescriberFor(group string, kind string, c *client.Client) (Describer, bool)
switch group {
case "":
f, ok = describerMap(c)[kind]
case "experimental":
case "extensions":
f, ok = expDescriberMap(c)[kind]
}

Expand Down
16 changes: 8 additions & 8 deletions pkg/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,15 @@ func (m *Master) init(c *Config) {
// allGroups records all supported groups at /apis
allGroups := []api.APIGroup{}
if m.exp {
m.thirdPartyStorage = c.StorageDestinations.APIGroups["experimental"].Default
m.thirdPartyStorage = c.StorageDestinations.APIGroups["extensions"].Default
m.thirdPartyResources = map[string]*thirdpartyresourcedataetcd.REST{}

expVersion := m.experimental(c)

if err := expVersion.InstallREST(m.handlerContainer); err != nil {
glog.Fatalf("Unable to setup experimental api: %v", err)
}
g, err := latest.Group("experimental")
g, err := latest.Group("extensions")
if err != nil {
glog.Fatalf("Unable to setup experimental api: %v", err)
}
Expand All @@ -680,7 +680,7 @@ func (m *Master) init(c *Config) {
Versions: expAPIVersions,
PreferredVersion: api.GroupVersion{GroupVersion: storageVersion, Version: apiutil.GetVersion(storageVersion)},
}
apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("experimental").Group+"/", group)
apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group+"/", group)
allGroups = append(allGroups, group)
apiserver.InstallServiceErrorHandler(m.handlerContainer, m.newAPIRequestInfoResolver(), []string{expVersion.Version})
}
Expand Down Expand Up @@ -1023,9 +1023,9 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV
Convertor: api.Scheme,
Typer: api.Scheme,

Mapper: thirdpartyresourcedata.NewMapper(latest.GroupOrDie("experimental").RESTMapper, kind, version, group),
Codec: thirdpartyresourcedata.NewCodec(latest.GroupOrDie("experimental").Codec, kind),
Linker: latest.GroupOrDie("experimental").SelfLinker,
Mapper: thirdpartyresourcedata.NewMapper(latest.GroupOrDie("extensions").RESTMapper, kind, version, group),
Codec: thirdpartyresourcedata.NewCodec(latest.GroupOrDie("extensions").Codec, kind),
Linker: latest.GroupOrDie("extensions").SelfLinker,
Storage: storage,
ServerVersion: latest.GroupOrDie("").GroupVersion,

Expand All @@ -1040,7 +1040,7 @@ func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupV
func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion {
controllerStorage := expcontrolleretcd.NewStorage(c.StorageDestinations.get("", "replicationControllers"))
dbClient := func(resource string) storage.Interface {
return c.StorageDestinations.get("experimental", resource)
return c.StorageDestinations.get("extensions", resource)
}
autoscalerStorage := horizontalpodautoscaleretcd.NewREST(dbClient("horizonalpodautoscalers"))
thirdPartyResourceStorage := thirdpartyresourceetcd.NewREST(dbClient("thirdpartyresources"))
Expand Down Expand Up @@ -1074,7 +1074,7 @@ func (m *Master) experimental(c *Config) *apiserver.APIGroupVersion {
strings.ToLower("ingress"): ingressStorage,
}

expMeta := latest.GroupOrDie("experimental")
expMeta := latest.GroupOrDie("extensions")

return &apiserver.APIGroupVersion{
Root: m.apiGroupPrefix,
Expand Down
Loading

0 comments on commit 80f213c

Please sign in to comment.