@@ -11,7 +11,6 @@ import (
11
11
"k8s.io/apiserver/pkg/storage/names"
12
12
kapi "k8s.io/kubernetes/pkg/api"
13
13
14
- deployapiv1 "github.com/openshift/api/apps/v1"
15
14
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
16
15
"github.com/openshift/origin/pkg/apps/apis/apps/validation"
17
16
)
@@ -136,7 +135,7 @@ func (s groupStrategy) PrepareForCreate(ctx apirequest.Context, obj runtime.Obje
136
135
s .strategy .PrepareForCreate (ctx , obj )
137
136
138
137
dc := obj .(* deployapi.DeploymentConfig )
139
- deployapiv1 . AppsV1DeploymentConfigLayeredDefaults (dc )
138
+ appsV1DeploymentConfigLayeredDefaults (dc )
140
139
}
141
140
142
141
// statusStrategy implements behavior for DeploymentConfig status updates.
@@ -158,3 +157,14 @@ func (statusStrategy) PrepareForUpdate(ctx apirequest.Context, obj, old runtime.
158
157
func (statusStrategy ) ValidateUpdate (ctx apirequest.Context , obj , old runtime.Object ) field.ErrorList {
159
158
return validation .ValidateDeploymentConfigStatusUpdate (obj .(* deployapi.DeploymentConfig ), old .(* deployapi.DeploymentConfig ))
160
159
}
160
+
161
+ // Applies defaults only for API group "apps.openshift.io" and not for the legacy API.
162
+ // This function is called from storage layer where differentiation
163
+ // between legacy and group API can be made and is not related to other functions here
164
+ // which are called fom auto-generated code.
165
+ func appsV1DeploymentConfigLayeredDefaults (dc * deployapi.DeploymentConfig ) {
166
+ if dc .Spec .RevisionHistoryLimit == nil {
167
+ v := deployapi .DefaultRevisionHistoryLimit
168
+ dc .Spec .RevisionHistoryLimit = & v
169
+ }
170
+ }
0 commit comments