mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Promote cronjob to batch/v1: kubectl sparse_test prune
This commit is contained in:
parent
2da8d1c18f
commit
363b78fe88
@ -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
Block a user