@@ -11,24 +11,10 @@ import (
11
11
"k8s.io/apimachinery/pkg/api/meta"
12
12
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13
13
"k8s.io/apimachinery/pkg/runtime"
14
- apirequest "k8s.io/apiserver/pkg/endpoints/request"
15
14
kapi "k8s.io/kubernetes/pkg/apis/core"
16
- "k8s.io/kubernetes/pkg/registry/core/endpoint"
17
- "k8s.io/kubernetes/pkg/registry/core/namespace"
18
- "k8s.io/kubernetes/pkg/registry/core/node"
19
- "k8s.io/kubernetes/pkg/registry/core/persistentvolume"
20
- "k8s.io/kubernetes/pkg/registry/core/persistentvolumeclaim"
21
- "k8s.io/kubernetes/pkg/registry/core/pod"
22
- "k8s.io/kubernetes/pkg/registry/core/replicationcontroller"
23
- "k8s.io/kubernetes/pkg/registry/core/resourcequota"
24
- "k8s.io/kubernetes/pkg/registry/core/secret"
25
- "k8s.io/kubernetes/pkg/registry/core/serviceaccount"
26
15
27
16
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
28
- deployrest "github.com/openshift/origin/pkg/apps/registry/deployconfig"
29
17
buildapi "github.com/openshift/origin/pkg/build/apis/build"
30
- buildrest "github.com/openshift/origin/pkg/build/registry/build"
31
- buildconfigrest "github.com/openshift/origin/pkg/build/registry/buildconfig"
32
18
imageapi "github.com/openshift/origin/pkg/image/apis/image"
33
19
routeapi "github.com/openshift/origin/pkg/route/apis/route"
34
20
osautil "github.com/openshift/origin/pkg/serviceaccounts/util"
@@ -66,34 +52,29 @@ func (e *DefaultExporter) Export(obj runtime.Object, exact bool) error {
66
52
} else {
67
53
glog .V (4 ).Infof ("Object of type %v does not have ObjectMeta: %v" , reflect .TypeOf (obj ), err )
68
54
}
69
- ctx := apirequest .NewContext ()
70
55
71
56
switch t := obj .(type ) {
72
57
case * kapi.Endpoints :
73
- endpoint .Strategy .PrepareForCreate (ctx , obj )
74
58
case * kapi.ResourceQuota :
75
- resourcequota . Strategy . PrepareForCreate ( ctx , obj )
59
+ t . Status = kapi. ResourceQuotaStatus {}
76
60
case * kapi.LimitRange :
77
61
// TODO: this needs to be fixed
78
62
// limitrange.Strategy.PrepareForCreate(obj)
79
63
case * kapi.Node :
80
- node .Strategy .PrepareForCreate (ctx , obj )
81
64
if exact {
82
65
return nil
83
66
}
84
67
// Nodes are the only resources that allow direct status edits, therefore
85
68
// we clear that without exact so that the node value can be reused.
86
69
t .Status = kapi.NodeStatus {}
87
70
case * kapi.Namespace :
88
- namespace .Strategy .PrepareForCreate (ctx , obj )
89
71
case * kapi.PersistentVolumeClaim :
90
- persistentvolumeclaim . Strategy . PrepareForCreate ( ctx , obj )
72
+ t . Status = kapi. PersistentVolumeClaimStatus {}
91
73
case * kapi.PersistentVolume :
92
- persistentvolume .Strategy .PrepareForCreate (ctx , obj )
93
74
case * kapi.ReplicationController :
94
- replicationcontroller . Strategy . PrepareForCreate ( ctx , obj )
75
+ t . Status = kapi. ReplicationControllerStatus {}
95
76
case * kapi.Pod :
96
- pod . Strategy . PrepareForCreate ( ctx , obj )
77
+ t . Status = kapi. PodStatus {}
97
78
case * kapi.PodTemplate :
98
79
case * kapi.Service :
99
80
// TODO: service does not yet have a strategy
@@ -110,7 +91,6 @@ func (e *DefaultExporter) Export(obj runtime.Object, exact bool) error {
110
91
}
111
92
}
112
93
case * kapi.Secret :
113
- secret .Strategy .PrepareForCreate (ctx , obj )
114
94
if exact {
115
95
return nil
116
96
}
@@ -119,7 +99,6 @@ func (e *DefaultExporter) Export(obj runtime.Object, exact bool) error {
119
99
return ErrExportOmit
120
100
}
121
101
case * kapi.ServiceAccount :
122
- serviceaccount .Strategy .PrepareForCreate (ctx , obj )
123
102
if exact {
124
103
return nil
125
104
}
@@ -146,22 +125,17 @@ func (e *DefaultExporter) Export(obj runtime.Object, exact bool) error {
146
125
t .Secrets = newMountableSecrets
147
126
148
127
case * appsapi.DeploymentConfig :
149
- return deployrest . CommonStrategy . Export ( ctx , obj , exact )
128
+ t . Status = appsapi. DeploymentConfigStatus {}
150
129
151
130
case * buildapi.BuildConfig :
152
- // Use the legacy strategy to avoid setting prune defaults if
153
- // the object wasn't created with them in the first place.
154
- // TODO: use the exportstrategy pattern instead.
155
- buildconfigrest .LegacyStrategy .PrepareForCreate (ctx , obj )
156
- // TODO: should be handled by prepare for create
157
- t .Status .LastVersion = 0
131
+ t .Status = buildapi.BuildConfigStatus {}
132
+
158
133
for i := range t .Spec .Triggers {
159
134
if p := t .Spec .Triggers [i ].ImageChange ; p != nil {
160
135
p .LastTriggeredImageID = ""
161
136
}
162
137
}
163
138
case * buildapi.Build :
164
- buildrest .Strategy .PrepareForCreate (ctx , obj )
165
139
// TODO: should be handled by prepare for create
166
140
t .Status .Duration = 0
167
141
t .Status .Phase = buildapi .BuildPhaseNew
0 commit comments