public static void addMissingConfigsToStage ( StageLibraryTask stageLibrary , StageConfiguration stageConf ) { StageDefinition stageDef = stageLibrary . getStage ( stageConf . getLibrary ( ) , stageConf . getStageName ( ) , false ) ; if ( stageDef != null ) { for ( ConfigDefinition configDef : stageDef . getConfigDefinitions ( ) ) { String configName = configDef . getName ( ) ; Config config = stageConf . getConfig ( configName ) ; if ( config == null ) { Object defaultValue = configDef . getDefaultValue ( ) ; LOG . warn ( "Stage '{}' missing configuration '{}', adding with '{}' as default" , stageConf . getInstanceName ( ) , configName , defaultValue ) ; config = new Config ( configName , defaultValue ) ; stageConf . addConfig ( config ) ; } } } }
Add any missing configs to the stage configuration .