@@ -165,59 +165,13 @@ func Parse(data map[string]interface{}, log log.Logger) (*latest.Config, error)
165165 // Filter out empty images, deployments etc.
166166 adjustConfig (latestConfigConverted )
167167
168- return latestConfigConverted , nil
169- }
170-
171- func adjustConfig (config * latest.Config ) {
172- for name , v := range config .Vars {
173- v .Name = name
174- }
175- for name , command := range config .Commands {
176- command .Name = name
177- }
178- for name , pullSecret := range config .PullSecrets {
179- pullSecret .Name = name
180- }
181- for name , devPod := range config .Dev {
182- devPod .Name = name
183- for c , v := range devPod .Containers {
184- v .Container = c
185- }
186- }
187- for name , pipeline := range config .Pipelines {
188- pipeline .Name = name
189- }
190- for name , dep := range config .Dependencies {
191- dep .Name = name
192- }
193- if config .Images != nil {
194- newObjs := map [string ]* latest.Image {}
195- for k , v := range config .Images {
196- if v != nil {
197- newObjs [k ] = v
198- }
199- }
200- config .Images = newObjs
201- }
202- if config .Deployments != nil {
203- newObjs := map [string ]* latest.DeploymentConfig {}
204- for k , v := range config .Deployments {
205- if v != nil {
206- v .Name = k
207- newObjs [k ] = v
208- }
209- }
210- config .Deployments = newObjs
211- }
212- if config .Hooks != nil {
213- newObjs := []* latest.HookConfig {}
214- for _ , v := range config .Hooks {
215- if v != nil {
216- newObjs = append (newObjs , v )
217- }
218- }
219- config .Hooks = newObjs
168+ // validate config
169+ err = Validate (latestConfigConverted )
170+ if err != nil {
171+ return nil , err
220172 }
173+
174+ return latestConfigConverted , nil
221175}
222176
223177// getProfiles loads a certain profile
0 commit comments