Write scheduler configuration from config file
Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
		@@ -123,22 +123,24 @@ func runCommand(cmd *cobra.Command, args []string, opts *options.Options, regist
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if errs := opts.Validate(); len(errs) > 0 {
 | 
						if errs := opts.Validate(); len(errs) > 0 {
 | 
				
			||||||
		fmt.Fprintf(os.Stderr, "%v\n", utilerrors.NewAggregate(errs))
 | 
							return utilerrors.NewAggregate(errs)
 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(opts.WriteConfigTo) > 0 {
 | 
						if len(opts.WriteConfigTo) > 0 {
 | 
				
			||||||
		if err := options.WriteConfigFile(opts.WriteConfigTo, &opts.ComponentConfig); err != nil {
 | 
							c := &schedulerserverconfig.Config{}
 | 
				
			||||||
			fmt.Fprintf(os.Stderr, "%v\n", err)
 | 
							if err := opts.ApplyTo(c); err != nil {
 | 
				
			||||||
			os.Exit(1)
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if err := options.WriteConfigFile(opts.WriteConfigTo, &c.ComponentConfig); err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		klog.Infof("Wrote configuration to: %s\n", opts.WriteConfigTo)
 | 
							klog.Infof("Wrote configuration to: %s\n", opts.WriteConfigTo)
 | 
				
			||||||
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c, err := opts.Config()
 | 
						c, err := opts.Config()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		fmt.Fprintf(os.Stderr, "%v\n", err)
 | 
							return err
 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Get the completed config
 | 
						// Get the completed config
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user