@@ -246,7 +246,7 @@ Additional run commands:
246246 rootCmd .AddCommand (NewInitCmd (f ))
247247 rootCmd .AddCommand (NewRestartCmd (f , globalFlags ))
248248 rootCmd .AddCommand (NewSyncCmd (f , globalFlags ))
249- rootCmd .AddCommand (NewRenderCmd (f , globalFlags ))
249+ rootCmd .AddCommand (NewRenderCmd (f , globalFlags , rawConfig ))
250250 rootCmd .AddCommand (NewUpgradeCmd ())
251251 rootCmd .AddCommand (NewEnterCmd (f , globalFlags ))
252252 rootCmd .AddCommand (NewAnalyzeCmd (f , globalFlags ))
@@ -256,33 +256,21 @@ Additional run commands:
256256 rootCmd .AddCommand (NewRunCmd (f , globalFlags , rawConfig ))
257257 rootCmd .AddCommand (NewAttachCmd (f , globalFlags ))
258258 rootCmd .AddCommand (NewPrintCmd (f , globalFlags ))
259- rootCmd .AddCommand (NewRunPipelineCmd (f , globalFlags ))
259+ rootCmd .AddCommand (NewRunPipelineCmd (f , globalFlags , rawConfig ))
260260 rootCmd .AddCommand (NewCompletionCmd ())
261261
262262 // check overwrite commands
263- rootCmd .AddCommand (replaceCommand ( "dev" , rawConfig , f , globalFlags , NewDevCmd ))
264- rootCmd .AddCommand (replaceCommand ( "deploy" , rawConfig , f , globalFlags , NewDeployCmd ))
265- rootCmd .AddCommand (replaceCommand ( "build" , rawConfig , f , globalFlags , NewBuildCmd ))
266- rootCmd .AddCommand (replaceCommand ( "purge" , rawConfig , f , globalFlags , NewPurgeCmd ))
263+ rootCmd .AddCommand (NewDevCmd ( f , globalFlags , rawConfig ))
264+ rootCmd .AddCommand (NewDeployCmd ( f , globalFlags , rawConfig ))
265+ rootCmd .AddCommand (NewBuildCmd ( f , globalFlags , rawConfig ))
266+ rootCmd .AddCommand (NewPurgeCmd ( f , globalFlags , rawConfig ))
267267
268268 // Add plugin commands
269269 plugin .AddPluginCommands (rootCmd , plugins , "" )
270270 variable .AddPredefinedVars (plugins )
271271 return rootCmd
272272}
273273
274- func replaceCommand (command string , rawConfig * RawConfig , f factory.Factory , globalFlags * flags.GlobalFlags , fallback func (f factory.Factory , globalFlags * flags.GlobalFlags ) * cobra.Command ) * cobra.Command {
275- if rawConfig != nil && rawConfig .CommandsConfig != nil && rawConfig .Resolver != nil && rawConfig .CommandsConfig .Commands != nil {
276- // get command
277- overwriteCommand , ok := rawConfig .CommandsConfig .Commands [command ]
278- if ok && ! overwriteCommand .DisableReplace {
279- return NewOverwriteCmd (f , globalFlags , overwriteCommand , rawConfig .Resolver .ResolvedVariables ())
280- }
281- }
282-
283- return fallback (f , globalFlags )
284- }
285-
286274func disableKlog () {
287275 flagSet := & flag.FlagSet {}
288276 klog .InitFlags (flagSet )
@@ -338,7 +326,7 @@ type RawConfig struct {
338326 RawConfig map [string ]interface {}
339327 Resolver variable.Resolver
340328
341- CommandsConfig * latest.Config
329+ Config * latest.Config
342330
343331 resolvedMutex sync.Mutex
344332 resolved map [string ]string
@@ -357,8 +345,8 @@ func (r *RawConfig) Parse(
357345 r .Resolver = resolver
358346
359347 // try parsing commands
360- latestConfig , beforeConversion , err := loader .NewCommandsParser ().Parse (ctx , originalRawConfig , rawConfig , resolver , log )
361- r .CommandsConfig = latestConfig
348+ latestConfig , beforeConversion , err := loader .NewCommandsPipelinesParser ().Parse (ctx , originalRawConfig , rawConfig , resolver , log )
349+ r .Config = latestConfig
362350 return latestConfig , beforeConversion , err
363351}
364352
0 commit comments