mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
address lavalamp's comment on using testapi instead of latest, and adding comments for public method.
This commit is contained in:
parent
f5023929d8
commit
ca803fc504
@ -46,6 +46,8 @@ func TestResourceVersioner(t *testing.T) {
|
||||
|
||||
func TestCodec(t *testing.T) {
|
||||
pod := internal.Pod{}
|
||||
// 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("").Codec.Encode(&pod)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
|
@ -67,6 +67,8 @@ func IsRegisteredAPIVersion(version string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// GroupVersionsForGroup returns the registered versions of a group in the form
|
||||
// of "group/version".
|
||||
func GroupVersionsForGroup(group string) []string {
|
||||
ret := []string{}
|
||||
for _, v := range RegisteredVersions {
|
||||
|
@ -47,6 +47,8 @@ func TestResourceVersioner(t *testing.T) {
|
||||
|
||||
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)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
@ -143,7 +142,7 @@ func TestDefaultErrorFunc(t *testing.T) {
|
||||
}
|
||||
handler := util.FakeHandler{
|
||||
StatusCode: 200,
|
||||
ResponseBody: runtime.EncodeOrDie(latest.GroupOrDie("").Codec, testPod),
|
||||
ResponseBody: runtime.EncodeOrDie(testapi.Default.Codec(), testPod),
|
||||
T: t,
|
||||
}
|
||||
mux := http.NewServeMux()
|
||||
|
Loading…
Reference in New Issue
Block a user