Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external versions no longer need reordering #18855

Merged
merged 1 commit into from
Jan 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,13 @@ func init() {
}

func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
worstToBestGroupVersions := []unversioned.GroupVersion{}
for i := len(externalVersions) - 1; i >= 0; i-- {
worstToBestGroupVersions = append(worstToBestGroupVersions, externalVersions[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()

return api.NewDefaultRESTMapper(worstToBestGroupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}

// InterfacesFor returns the default Codec and ResourceVersioner for a given version
Expand Down
7 changes: 1 addition & 6 deletions pkg/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
var userResources = []string{"rc", "svc", "pods", "pvc"}

func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
worstToBestGroupVersions := []unversioned.GroupVersion{}
for i := len(externalVersions) - 1; i >= 0; i-- {
worstToBestGroupVersions = append(worstToBestGroupVersions, externalVersions[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(
Expand All @@ -117,7 +112,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper
"ThirdPartyResourceData",
"ThirdPartyResourceList")

mapper := api.NewDefaultRESTMapper(worstToBestGroupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
mapper := api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
// setup aliases for groups of resources
mapper.AddResourceAlias("all", userResources...)

Expand Down
7 changes: 1 addition & 6 deletions pkg/apis/componentconfig/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,13 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
}

func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
worstToBestGroupVersions := []unversioned.GroupVersion{}
for i := len(externalVersions) - 1; i >= 0; i-- {
worstToBestGroupVersions = append(worstToBestGroupVersions, externalVersions[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()

return api.NewDefaultRESTMapper(worstToBestGroupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}

// interfacesFor returns the default Codec and ResourceVersioner for a given version
Expand Down
7 changes: 1 addition & 6 deletions pkg/apis/extensions/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,13 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
}

func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
worstToBestGroupVersions := []unversioned.GroupVersion{}
for i := len(externalVersions) - 1; i >= 0; i-- {
worstToBestGroupVersions = append(worstToBestGroupVersions, externalVersions[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()

return api.NewDefaultRESTMapper(worstToBestGroupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}

// interfacesFor returns the default Codec and ResourceVersioner for a given version
Expand Down
7 changes: 1 addition & 6 deletions pkg/apis/metrics/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,13 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
}

func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper {
worstToBestGroupVersions := []unversioned.GroupVersion{}
for i := len(externalVersions) - 1; i >= 0; i-- {
worstToBestGroupVersions = append(worstToBestGroupVersions, externalVersions[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()

return api.NewDefaultRESTMapper(worstToBestGroupVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}

// interfacesFor returns the default Codec and ResourceVersioner for a given version
Expand Down