@@ -23,7 +23,6 @@ import (
23
23
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
24
24
"k8s.io/apimachinery/pkg/runtime"
25
25
"k8s.io/apimachinery/pkg/runtime/schema"
26
- "k8s.io/kubectl/pkg/scheme"
27
26
deploymentutil "k8s.io/kubectl/pkg/util/deployment"
28
27
)
29
28
@@ -59,7 +58,7 @@ type StatefulSetStatusViewer struct{}
59
58
// Status returns a message describing deployment status, and a bool value indicating if the status is considered done.
60
59
func (s * DeploymentStatusViewer ) Status (obj runtime.Unstructured , revision int64 ) (string , bool , error ) {
61
60
deployment := & appsv1.Deployment {}
62
- err := scheme . Scheme . Convert (obj , deployment , nil )
61
+ err := runtime . DefaultUnstructuredConverter . FromUnstructured (obj . UnstructuredContent () , deployment )
63
62
if err != nil {
64
63
return "" , false , fmt .Errorf ("failed to convert %T to %T: %v" , obj , deployment , err )
65
64
}
@@ -97,7 +96,7 @@ func (s *DaemonSetStatusViewer) Status(obj runtime.Unstructured, revision int64)
97
96
//ignoring revision as DaemonSets does not have history yet
98
97
99
98
daemon := & appsv1.DaemonSet {}
100
- err := scheme . Scheme . Convert (obj , daemon , nil )
99
+ err := runtime . DefaultUnstructuredConverter . FromUnstructured (obj . UnstructuredContent () , daemon )
101
100
if err != nil {
102
101
return "" , false , fmt .Errorf ("failed to convert %T to %T: %v" , obj , daemon , err )
103
102
}
@@ -120,7 +119,7 @@ func (s *DaemonSetStatusViewer) Status(obj runtime.Unstructured, revision int64)
120
119
// Status returns a message describing statefulset status, and a bool value indicating if the status is considered done.
121
120
func (s * StatefulSetStatusViewer ) Status (obj runtime.Unstructured , revision int64 ) (string , bool , error ) {
122
121
sts := & appsv1.StatefulSet {}
123
- err := scheme . Scheme . Convert (obj , sts , nil )
122
+ err := runtime . DefaultUnstructuredConverter . FromUnstructured (obj . UnstructuredContent () , sts )
124
123
if err != nil {
125
124
return "" , false , fmt .Errorf ("failed to convert %T to %T: %v" , obj , sts , err )
126
125
}
0 commit comments