Skip to content

Commit

Permalink
feat(kubernetes): add dynamic target selection to patch manifest stage
Browse files Browse the repository at this point in the history
  • Loading branch information
maggieneterval committed Mar 1, 2019
1 parent 0abce66 commit 79a0700
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export class KubernetesV2PatchManifestConfigCtrl implements IController {
this.$scope.stage.options = defaultOptions;
}

if (!this.$scope.stage.app) {
this.$scope.stage.app = this.$scope.application.name;
}

this.setRawPatchBody(this.getMergeStrategy());

this.manifestArtifactDelegate = new NgGenericArtifactDelegate($scope, 'manifest');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<h4>Resource to Patch</h4>
<div class="horizontal-rule"></div>
<kubernetes-manifest-selector
application="ctrl.$scope.application"
modes='["static", "dynamic"]'
on-change="ctrl.handleManifestSelectorChange"
selector="ctrl.$scope.stage"
></kubernetes-manifest-selector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { KubernetesV2PatchManifestConfigCtrl } from '../patchManifest/patchManif
import { KUBERNETES_PATCH_MANIFEST_OPTIONS_FORM } from './patchOptionsForm.component';
import { KUBERNETES_MANIFEST_SELECTOR } from 'kubernetes/v2/manifest/selector/selector.component';
import { DeployStatus } from '../deployManifest/react/DeployStatus';
import { trafficValidators } from '../traffic/validators';

export const KUBERNETES_PATCH_MANIFEST_STAGE = 'spinnaker.kubernetes.v2.pipeline.stage.patchManifestStage';

Expand All @@ -33,11 +34,7 @@ module(KUBERNETES_PATCH_MANIFEST_STAGE, [KUBERNETES_PATCH_MANIFEST_OPTIONS_FORM,
executionDetailsSections: [PatchStatus, ExecutionDetailsTasks, ExecutionArtifactTab],
producesArtifacts: true,
defaultTimeoutMs: 30 * 60 * 1000, // 30 minutes
validators: [
{ type: 'requiredField', fieldName: 'location', fieldLabel: 'Namespace' },
{ type: 'requiredField', fieldName: 'account', fieldLabel: 'Account' },
{ type: 'manifestSelector' },
],
validators: trafficValidators(KUBERNETES_PATCH_MANIFEST_STAGE),
artifactExtractor: ExpectedArtifactService.accumulateArtifacts(['manifestArtifactId', 'requiredArtifactIds']),
artifactRemover: ArtifactReferenceService.removeArtifactFromFields([
'manifestArtifactId',
Expand Down

0 comments on commit 79a0700

Please sign in to comment.