-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cf): Repair Rollback Cluster pipeline stage (#6743)
Cloud Foundry's Reactified implementation of AccountRegionClusterSelector did not account for moniker selection. The moniker field is required by Orca to properly perform the rollback. spinnaker/spinnaker#4180 Co-Authored-By: Stu Pollock <spollock@pivotal.io>
- Loading branch information
1 parent
9c14b02
commit e0a8639
Showing
6 changed files
with
71 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
...es/cloudfoundry/src/pipeline/stages/rollbackCluster/cloudfoundryRollbackClusterStage.html
This file was deleted.
Oops, something went wrong.
49 changes: 15 additions & 34 deletions
49
...oudfoundry/src/pipeline/stages/rollbackCluster/cloudfoundryRollbackClusterStage.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,17 @@ | ||
import { IController, IScope, module } from 'angular'; | ||
import { react2angular } from 'react2angular'; | ||
|
||
import { CloudfoundryRollbackClusterStageConfig } from './CloudfoundryRollbackClusterStageConfig'; | ||
import { Application, IStage, Registry } from '@spinnaker/core'; | ||
|
||
class CloudFoundryRollbackClusterStageCtrl implements IController { | ||
public static $inject = ['$scope', 'application']; | ||
constructor(public $scope: IScope, private application: Application) { | ||
this.$scope.application = this.application; | ||
} | ||
} | ||
import { IStage, Registry } from '@spinnaker/core'; | ||
|
||
export const CLOUD_FOUNDRY_ROLLBACK_CLUSTER_STAGE = 'spinnaker.cloudfoundry.pipeline.stage.rollbackClusterStage'; | ||
module(CLOUD_FOUNDRY_ROLLBACK_CLUSTER_STAGE, []) | ||
.config(function() { | ||
Registry.pipeline.registerStage({ | ||
accountExtractor: (stage: IStage) => stage.context.credentials, | ||
configAccountExtractor: (stage: IStage) => [stage.credentials], | ||
provides: 'rollbackCluster', | ||
key: 'rollbackCluster', | ||
cloudProvider: 'cloudfoundry', | ||
templateUrl: require('./cloudfoundryRollbackClusterStage.html'), | ||
controller: 'cfRollbackClusterStageCtrl', | ||
validators: [ | ||
{ type: 'requiredField', fieldName: 'cluster' }, | ||
{ type: 'requiredField', fieldName: 'regions' }, | ||
{ type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' }, | ||
], | ||
}); | ||
}) | ||
.component( | ||
'cfRollbackClusterStage', | ||
react2angular(CloudfoundryRollbackClusterStageConfig, ['application', 'pipeline', 'stage', 'stageFieldUpdated']), | ||
) | ||
.controller('cfRollbackClusterStageCtrl', CloudFoundryRollbackClusterStageCtrl); | ||
Registry.pipeline.registerStage({ | ||
accountExtractor: (stage: IStage) => stage.context.credentials, | ||
configAccountExtractor: (stage: IStage) => [stage.credentials], | ||
provides: 'rollbackCluster', | ||
key: 'rollbackCluster', | ||
cloudProvider: 'cloudfoundry', | ||
component: CloudfoundryRollbackClusterStageConfig, | ||
controller: 'cfRollbackClusterStageCtrl', | ||
validators: [ | ||
{ type: 'requiredField', preventSave: true, fieldName: 'cluster' }, | ||
{ type: 'requiredField', preventSave: true, fieldName: 'regions' }, | ||
{ type: 'requiredField', preventSave: true, fieldName: 'credentials', fieldLabel: 'account' }, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters