mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
Begin to unify ResourceVersioner and SelfLinker
Create a new MetadataAccessor interface that combines both and use it where previously latest.ResourceVersioner and SelfLinker were being used. Adds Namespace to the get/set interface. Adds TODO about future fast path for metadata (as per thockin's comment)
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -44,14 +45,14 @@ func Codec() runtime.Codec {
|
||||
return interfaces.Codec
|
||||
}
|
||||
|
||||
// ResourceVersioner returns the ResourceVersioner for the API version to test against,
|
||||
// MetadataAccessor returns the MetadataAccessor for the API version to test against,
|
||||
// as set by the KUBE_API_VERSION env var.
|
||||
func ResourceVersioner() runtime.ResourceVersioner {
|
||||
func MetadataAccessor() meta.MetadataAccessor {
|
||||
interfaces, err := latest.InterfacesFor(Version())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return interfaces.ResourceVersioner
|
||||
return interfaces.MetadataAccessor
|
||||
}
|
||||
|
||||
// SelfLink returns a self link that will appear to be for the version Version().
|
||||
|
Reference in New Issue
Block a user