diff --git a/app/scripts/modules/amazon/src/pipeline/stages/bake/awsBakeStage.js b/app/scripts/modules/amazon/src/pipeline/stages/bake/awsBakeStage.js index c349c835460..a178e4df006 100644 --- a/app/scripts/modules/amazon/src/pipeline/stages/bake/awsBakeStage.js +++ b/app/scripts/modules/amazon/src/pipeline/stages/bake/awsBakeStage.js @@ -55,7 +55,9 @@ module.exports = angular $scope.viewState = { loading: true, - roscoMode: SETTINGS.feature.roscoMode, + roscoMode: + SETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && SETTINGS.feature.roscoSelector($scope.stage)), minRootVolumeSize: AWSProviderSettings.minRootVolumeSize, showVmTypeSelector: true, }; @@ -85,6 +87,15 @@ module.exports = angular if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) { $scope.stage.baseOs = $scope.baseOsOptions[0].id; + } else if ( + $scope.stage.baseOs && + !($scope.baseOsOptions || []).find(baseOs => baseOs.id === $scope.stage.baseOs) + ) { + $scope.baseOsOptions.push({ + id: $scope.stage.baseOs, + detailedDescription: 'Custom', + vmTypes: ['hvm', 'pv'], + }); } if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) { $scope.stage.baseLabel = $scope.baseLabelOptions[0]; diff --git a/app/scripts/modules/amazon/src/pipeline/stages/bake/bakeExecutionDetails.controller.js b/app/scripts/modules/amazon/src/pipeline/stages/bake/bakeExecutionDetails.controller.js index 07227580dd6..15c361611c0 100644 --- a/app/scripts/modules/amazon/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +++ b/app/scripts/modules/amazon/src/pipeline/stages/bake/bakeExecutionDetails.controller.js @@ -18,7 +18,10 @@ module.exports = angular let initialized = () => { $scope.detailsSection = $stateParams.details; $scope.provider = $scope.stage.context.cloudProviderType || 'aws'; - $scope.roscoMode = SETTINGS.feature.roscoMode; + $scope.roscoMode = + SETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && + SETTINGS.feature.roscoSelector($scope.stage.context)); $scope.bakeryDetailUrl = $interpolate(SETTINGS.bakeryDetailUrl); $scope.bakeFailedNoError = get($scope.stage, 'context.status.result') === 'FAILURE' && !$scope.stage.failureMessage; diff --git a/app/scripts/modules/azure/src/pipeline/stages/bake/azureBakeStage.js b/app/scripts/modules/azure/src/pipeline/stages/bake/azureBakeStage.js index f4f4dd54e9a..41a28f19b98 100644 --- a/app/scripts/modules/azure/src/pipeline/stages/bake/azureBakeStage.js +++ b/app/scripts/modules/azure/src/pipeline/stages/bake/azureBakeStage.js @@ -92,7 +92,9 @@ module.exports = angular if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) { $scope.stage.baseLabel = $scope.baseLabelOptions[0]; } - $scope.viewState.roscoMode = SETTINGS.feature.roscoMode; + $scope.viewState.roscoMode = + SETTINGS.feature.roscoModeSETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && SETTINGS.feature.roscoSelector($scope.stage)); $scope.viewState.loading = false; }); } diff --git a/app/scripts/modules/azure/src/pipeline/stages/bake/bakeExecutionDetails.controller.js b/app/scripts/modules/azure/src/pipeline/stages/bake/bakeExecutionDetails.controller.js index 8cc9f0f8b28..72e489781c1 100644 --- a/app/scripts/modules/azure/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +++ b/app/scripts/modules/azure/src/pipeline/stages/bake/bakeExecutionDetails.controller.js @@ -17,7 +17,10 @@ module.exports = angular let initialized = () => { $scope.detailsSection = $stateParams.details; $scope.provider = $scope.stage.context.cloudProviderType || 'azure'; - $scope.roscoMode = SETTINGS.feature.roscoMode; + $scope.roscoMode = + SETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && + SETTINGS.feature.roscoSelector($scope.stage.context)); $scope.bakeryDetailUrl = $interpolate(SETTINGS.bakeryDetailUrl); }; diff --git a/app/scripts/modules/google/src/pipeline/stages/bake/bakeExecutionDetails.controller.js b/app/scripts/modules/google/src/pipeline/stages/bake/bakeExecutionDetails.controller.js index cf97a0d33e0..f322cc2d0ef 100644 --- a/app/scripts/modules/google/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +++ b/app/scripts/modules/google/src/pipeline/stages/bake/bakeExecutionDetails.controller.js @@ -17,7 +17,10 @@ module.exports = angular const initialized = () => { $scope.detailsSection = $stateParams.details; $scope.provider = $scope.stage.context.cloudProviderType || 'gce'; - $scope.roscoMode = SETTINGS.feature.roscoMode; + $scope.roscoMode = + SETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && + SETTINGS.feature.roscoSelector($scope.stage.context)); $scope.bakeryDetailUrl = $interpolate(SETTINGS.bakeryDetailUrl); }; diff --git a/app/scripts/modules/google/src/pipeline/stages/bake/gceBakeStage.js b/app/scripts/modules/google/src/pipeline/stages/bake/gceBakeStage.js index 9a421045aea..61483e24856 100644 --- a/app/scripts/modules/google/src/pipeline/stages/bake/gceBakeStage.js +++ b/app/scripts/modules/google/src/pipeline/stages/bake/gceBakeStage.js @@ -84,7 +84,9 @@ module.exports = angular if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) { $scope.stage.baseLabel = $scope.baseLabelOptions[0]; } - $scope.viewState.roscoMode = SETTINGS.feature.roscoMode; + $scope.viewState.roscoMode = + SETTINGS.feature.roscoModeSETTINGS.feature.roscoMode || + (typeof SETTINGS.feature.roscoSelector === 'function' && SETTINGS.feature.roscoSelector($scope.stage)); $scope.showAdvancedOptions = showAdvanced(); $scope.viewState.loading = false; });