Promote cronjob to batch/v1: kubectl sparse_test prune
Kubernetes-commit: 363b78fe883b58460a1191bb19a760fb86f7140e
This commit is contained in:
parent
f25ea19f9a
commit
27a118e81a
|
|
@ -20,7 +20,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"k8s.io/api/batch/v1"
|
||||
"k8s.io/api/batch/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
|
@ -28,9 +27,9 @@ import (
|
|||
)
|
||||
|
||||
func TestCronJob(t *testing.T) {
|
||||
src := &v1beta1.CronJob{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
src := &v1.CronJob{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
|
||||
encoder := Codecs.LegacyCodec(v1.SchemeGroupVersion, v1beta1.SchemeGroupVersion)
|
||||
encoder := Codecs.LegacyCodec(v1.SchemeGroupVersion)
|
||||
cronjobBytes, err := runtime.Encode(encoder, src)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
@ -46,7 +45,7 @@ func TestCronJob(t *testing.T) {
|
|||
}
|
||||
|
||||
// clear typemeta
|
||||
uncastDst.(*v1beta1.CronJob).TypeMeta = metav1.TypeMeta{}
|
||||
uncastDst.(*v1.CronJob).TypeMeta = metav1.TypeMeta{}
|
||||
|
||||
if !equality.Semantic.DeepEqual(src, uncastDst) {
|
||||
t.Fatal(diff.ObjectDiff(src, uncastDst))
|
||||
|
|
|
|||
Loading…
Reference in New Issue