Commit 87cc1ddb authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #48407 from k82cn/testapi_lint

Automatic merge from submit-queue Updated comments of func in testapi. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #N/A **Special notes for your reviewer**: **Release note**: ```release-note-none ```
parents 9548fbd5 4675f970
...@@ -432,7 +432,7 @@ func (g TestGroup) SelfLink(resource, name string) string { ...@@ -432,7 +432,7 @@ func (g TestGroup) SelfLink(resource, name string) string {
} }
} }
// Returns the appropriate path for the given prefix (watch, proxy, redirect, etc), resource, namespace and name. // ResourcePathWithPrefix returns the appropriate path for the given prefix (watch, proxy, redirect, etc), resource, namespace and name.
// For ex, this is of the form: // For ex, this is of the form:
// /api/v1/watch/namespaces/foo/pods/pod0 for v1. // /api/v1/watch/namespaces/foo/pods/pod0 for v1.
func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name string) string { func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name string) string {
...@@ -462,7 +462,7 @@ func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name stri ...@@ -462,7 +462,7 @@ func (g TestGroup) ResourcePathWithPrefix(prefix, resource, namespace, name stri
return path return path
} }
// Returns the appropriate path for the given resource, namespace and name. // ResourcePath returns the appropriate path for the given resource, namespace and name.
// For example, this is of the form: // For example, this is of the form:
// /api/v1/namespaces/foo/pods/pod0 for v1. // /api/v1/namespaces/foo/pods/pod0 for v1.
func (g TestGroup) ResourcePath(resource, namespace, name string) string { func (g TestGroup) ResourcePath(resource, namespace, name string) string {
...@@ -480,6 +480,7 @@ func (g TestGroup) SubResourcePath(resource, namespace, name, sub string) string ...@@ -480,6 +480,7 @@ func (g TestGroup) SubResourcePath(resource, namespace, name, sub string) string
return path return path
} }
// RESTMapper returns RESTMapper in api.Registry.
func (g TestGroup) RESTMapper() meta.RESTMapper { func (g TestGroup) RESTMapper() meta.RESTMapper {
return api.Registry.RESTMapper() return api.Registry.RESTMapper()
} }
...@@ -494,7 +495,7 @@ func ExternalGroupVersions() schema.GroupVersions { ...@@ -494,7 +495,7 @@ func ExternalGroupVersions() schema.GroupVersions {
return versions return versions
} }
// Get codec based on runtime.Object // GetCodecForObject gets codec based on runtime.Object
func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) { func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) {
kinds, _, err := api.Scheme.ObjectKinds(obj) kinds, _, err := api.Scheme.ObjectKinds(obj)
if err != nil { if err != nil {
...@@ -522,6 +523,7 @@ func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) { ...@@ -522,6 +523,7 @@ func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) {
return nil, fmt.Errorf("unexpected kind: %v", kind) return nil, fmt.Errorf("unexpected kind: %v", kind)
} }
// NewTestGroup creates a new TestGroup.
func NewTestGroup(external, internal schema.GroupVersion, internalTypes map[string]reflect.Type, externalTypes map[string]reflect.Type) TestGroup { func NewTestGroup(external, internal schema.GroupVersion, internalTypes map[string]reflect.Type, externalTypes map[string]reflect.Type) TestGroup {
return TestGroup{external, internal, internalTypes, externalTypes} return TestGroup{external, internal, internalTypes, externalTypes}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment