// Performs necessary post-processing for runner configs.
// For example sets case names based on runner name and therafter lowercases the runner name.
Performs necessary post-processing for runner configs.
For example sets case names based on runner name and therafter lowercases the runner name.
// Performs necessary post - processing for runner configs . // For example sets case names based on runner name and therafter lowercases the runner name .
func PostprocessRunnerConfig(runner avian.RunnerApplyRequest) avian.RunnerApplyRequest {
	if runner.CaseSettings.Case == nil {
		runner.CaseSettings.Case = &avian.Case{}
	}
	if runner.CaseSettings.Case.Name == "" {
		runner.CaseSettings.Case.Name = runner.Name + "-single"
	}
	if runner.CaseSettings.Case.Directory == "" {
		runner.CaseSettings.Case.Directory = fmt.Sprintf("%s/%s",
			runner.CaseSettings.CaseLocation,
			runner.CaseSettings.Case.Name,
		)
	}
	if runner.CaseSettings.CompoundCase != nil {
		var compound_name = runner.Name + "-compound"
		if runner.CaseSettings.CompoundCase.Name != "" {
			compound_name = runner.CaseSettings.CompoundCase.Name
		}
		var compound_directory = fmt.Sprintf("%s/%s",
			runner.CaseSettings.CaseLocation,
			compound_name)
		var compound_description string
		var compound_investigator string
		if runner.CaseSettings.CompoundCase.Directory != "" {
			compound_directory = runner.CaseSettings.CompoundCase.Directory
		}
		compound_description = runner.CaseSettings.CompoundCase.Description
		compound_investigator = runner.CaseSettings.CompoundCase.Investigator
		runner.CaseSettings.CompoundCase = &avian.Case{
			Name:         compound_name,
			Directory:    compound_directory,
			Description:  compound_description,
			Investigator: compound_investigator,
		}
	}
	if runner.CaseSettings.ReviewCompound != nil {
		var review_name = runner.Name + "-review"
		if runner.CaseSettings.ReviewCompound.Name != "" {
			review_name = runner.CaseSettings.ReviewCompound.Name
		}
		var review_directory = fmt.Sprintf("%s/%s",
			runner.CaseSettings.CaseLocation,
			review_name)
		var review_description string
		var review_investigator string
		if runner.CaseSettings.ReviewCompound.Directory != "" {
			review_directory = runner.CaseSettings.ReviewCompound.Directory
		}
		review_description = runner.CaseSettings.ReviewCompound.Description
		review_investigator = runner.CaseSettings.ReviewCompound.Investigator
		runner.CaseSettings.ReviewCompound = &avian.Case{
			Name:         review_name,
			Directory:    review_directory,
			Description:  review_description,
			Investigator: review_investigator,
		}
	}
	runner.Name = strings.ToLower(runner.Name)
	runner.Hostname = strings.ToLower(runner.Hostname)
	runner.Nms = strings.ToLower(runner.Nms)
	return runner
}
func PostprocessRunnerConfig ( runner avian . RunnerApplyRequest ) avian . RunnerApplyRequest { if runner . CaseSettings . Case == nil { runner . CaseSettings . Case = & avian . Case { } } if runner . CaseSettings . Case . Name == " " { runner . CaseSettings . Case . Name = runner . Name + " " } if runner . CaseSettings . Case . Directory == " " { runner . CaseSettings . Case . Directory = fmt . Sprintf ( " " , runner . CaseSettings . CaseLocation , runner . CaseSettings . Case . Name , ) } if runner . CaseSettings . CompoundCase != nil { var compound_name = runner . Name + " " if runner . CaseSettings . CompoundCase . Name != " " { compound_name = runner . CaseSettings . CompoundCase . Name } var compound_directory = fmt . Sprintf ( " " , runner . CaseSettings . CaseLocation , compound_name ) var compound_description string var compound_investigator string if runner . CaseSettings . CompoundCase . Directory != " " { compound_directory = runner . CaseSettings . CompoundCase . Directory } compound_description = runner . CaseSettings . CompoundCase . Description compound_investigator = runner . CaseSettings . CompoundCase . Investigator runner . CaseSettings . CompoundCase = & avian . Case { Name : compound_name , Directory : compound_directory , Description : compound_description , Investigator : compound_investigator , } } if runner . CaseSettings . ReviewCompound != nil { var review_name = runner . Name + " " if runner . CaseSettings . ReviewCompound . Name != " " { review_name = runner . CaseSettings . ReviewCompound . Name } var review_directory = fmt . Sprintf ( " " , runner . CaseSettings . CaseLocation , review_name ) var review_description string var review_investigator string if runner . CaseSettings . ReviewCompound . Directory != " " { review_directory = runner . CaseSettings . ReviewCompound . Directory } review_description = runner . CaseSettings . ReviewCompound . Description review_investigator = runner . CaseSettings . ReviewCompound . Investigator runner . CaseSettings . ReviewCompound = & avian . Case { Name : review_name , Directory : review_directory , Description : review_description , Investigator : review_investigator , } } runner . Name = strings . ToLower ( runner . Name ) runner . Hostname = strings . ToLower ( runner . Hostname ) runner . Nms = strings . ToLower ( runner . Nms ) return runner }
Performs necessary post-processing for runner configs.
Performs necessary post - processing for runner configs .
// Sets up the compound case. // Defaults to runnername-compound, but uses the specified name if it exists. // Defaults to runner_caselocation-compoundname, but uses the specified directory if it exists. // Sets up the review case. // Defaults to runnername-review, but uses the specified name if it exists. // Defaults to runner_caselocation-reviewname, but uses the specified directory if it exists.