pkg/registry/core/namespace/storage/storage.go 对于namespace的存储实现
    NewREST

    staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go
    CompleteWithOptions

    staging/src/k8s.io/apiserver/pkg/server/options/etcd.go
    StorageFactoryRestOptionsFactory.GetRESTOptions

    staging/src/k8s.io/apiserver/pkg/registry/generic/registry/storage_factory.go
    StorageWithCacher

    staging/src/k8s.io/apiserver/pkg/registry/generic/storage_decorator.go
    NewRawStorage

    staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/factory.go
    Create 创建storagebackend


    version转换,所有版本都要转换成存储的version

    staging/src/k8s.io/apiserver/pkg/endpoints/installer.go
    registerResourceHandlers
    设置handlers.RequestScope的HubGroupVersion字段,version基本都是runtime.APIVersionInternal ( __internal)

    staging/src/k8s.io/apiserver/pkg/endpoints/handlers/create.go
    createHandler
    —>scope.Serializer.DecoderToVersion(s.Serializer, scope.HubGroupVersion)
    ——>CodecFactory.DecoderToVersion
    —>decoder.Decode(body, &defaultGVK, original)

    staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
    codec.Decode
    —>c.convertor.Convert