@spinnaker/docker 2026.2.2 → 2026.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docker.module.d.ts +1 -1
- package/dist/image/DockerChartAndTagSelector.d.ts +1 -0
- package/dist/image/DockerImageAndTagSelector.d.ts +1 -0
- package/dist/image/DockerImageReader.d.ts +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/stages/bake/dockerBakeStage.d.ts +31 -2
- package/dist/pipeline/trigger/DockerTriggerTemplate.d.ts +2 -1
- package/package.json +2 -6
- package/src/docker.module.ts +1 -6
- package/src/image/DockerChartAndTagSelector.tsx +24 -12
- package/src/image/DockerImageAndTagSelector.spec.tsx +159 -0
- package/src/image/DockerImageAndTagSelector.tsx +24 -12
- package/src/image/DockerImageReader.spec.ts +21 -0
- package/src/image/DockerImageReader.ts +10 -6
- package/src/index.ts +2 -1
- package/src/pipeline/stages/bake/dockerBakeStage.spec.tsx +187 -0
- package/src/pipeline/stages/bake/dockerBakeStage.tsx +313 -0
- package/src/pipeline/trigger/DockerTrigger.tsx +2 -2
- package/src/pipeline/trigger/DockerTriggerTemplate.spec.tsx +124 -0
- package/src/pipeline/trigger/DockerTriggerTemplate.tsx +25 -13
- package/dist/pipeline/stages/bake/bakeExecutionDetails.controller.d.ts +0 -2
- package/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +0 -36
- package/src/pipeline/stages/bake/bakeExecutionDetails.html +0 -47
- package/src/pipeline/stages/bake/bakeStage.html +0 -32
- package/src/pipeline/stages/bake/dockerBakeStage.js +0 -81
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { get } from 'lodash';
|
|
2
|
-
import { $q } from 'ngimport';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import type { Option } from 'react-select';
|
|
5
4
|
import type { Subscription } from 'rxjs';
|
|
@@ -33,9 +32,12 @@ export class DockerTriggerTemplate extends React.Component<
|
|
|
33
32
|
> {
|
|
34
33
|
private queryStream = new Subject();
|
|
35
34
|
private subscription: Subscription;
|
|
35
|
+
private tagRequest: AbortController;
|
|
36
36
|
|
|
37
|
-
public static formatLabel(trigger: IDockerTrigger):
|
|
38
|
-
return
|
|
37
|
+
public static formatLabel(trigger: IDockerTrigger): Promise<string> {
|
|
38
|
+
return Promise.resolve(
|
|
39
|
+
`(Docker Registry) ${trigger.account ? trigger.account + ':' : ''} ${trigger.repository || ''}`,
|
|
40
|
+
);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
public constructor(props: ITriggerTemplateComponentProps) {
|
|
@@ -51,22 +53,30 @@ export class DockerTriggerTemplate extends React.Component<
|
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
private handleQuery = () => {
|
|
56
|
+
this.tagRequest?.abort();
|
|
57
|
+
this.tagRequest = new AbortController();
|
|
54
58
|
const trigger = this.props.command.trigger as IDockerTrigger;
|
|
55
59
|
if (trigger.type === 'helm/oci') {
|
|
56
60
|
return observableFrom(
|
|
57
|
-
DockerChartImageReader.findTags(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
DockerChartImageReader.findTags(
|
|
62
|
+
{
|
|
63
|
+
provider: 'dockerRegistry', // Use helmOci provider for Helm OCI triggers
|
|
64
|
+
account: trigger.account,
|
|
65
|
+
repository: trigger.repository,
|
|
66
|
+
},
|
|
67
|
+
this.tagRequest.signal,
|
|
68
|
+
),
|
|
62
69
|
);
|
|
63
70
|
} else {
|
|
64
71
|
return observableFrom(
|
|
65
|
-
DockerImageReader.findTags(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
DockerImageReader.findTags(
|
|
73
|
+
{
|
|
74
|
+
provider: 'dockerRegistry',
|
|
75
|
+
account: trigger.account,
|
|
76
|
+
repository: trigger.repository,
|
|
77
|
+
},
|
|
78
|
+
this.tagRequest.signal,
|
|
79
|
+
),
|
|
70
80
|
);
|
|
71
81
|
}
|
|
72
82
|
};
|
|
@@ -153,6 +163,7 @@ export class DockerTriggerTemplate extends React.Component<
|
|
|
153
163
|
if (this.subscription) {
|
|
154
164
|
this.subscription.unsubscribe();
|
|
155
165
|
}
|
|
166
|
+
this.tagRequest?.abort();
|
|
156
167
|
|
|
157
168
|
// cancel search stream if trigger has changed to some other type
|
|
158
169
|
if (command.trigger.type !== 'docker' && command.trigger.type !== 'helm/oci') {
|
|
@@ -174,6 +185,7 @@ export class DockerTriggerTemplate extends React.Component<
|
|
|
174
185
|
if (this.subscription) {
|
|
175
186
|
this.subscription.unsubscribe();
|
|
176
187
|
}
|
|
188
|
+
this.tagRequest?.abort();
|
|
177
189
|
}
|
|
178
190
|
|
|
179
191
|
private searchTags = (query = '') => {
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import UIROUTER_ANGULARJS from '@uirouter/angularjs';
|
|
4
|
-
import { module } from 'angular';
|
|
5
|
-
|
|
6
|
-
import { SETTINGS } from '@spinnaker/core';
|
|
7
|
-
|
|
8
|
-
export const DOCKER_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER =
|
|
9
|
-
'spinnaker.docker.pipeline.stage.bake.executionDetails.controller';
|
|
10
|
-
export const name = DOCKER_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER; // for backwards compatibility
|
|
11
|
-
module(DOCKER_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER, [UIROUTER_ANGULARJS]).controller(
|
|
12
|
-
'dockerBakeExecutionDetailsCtrl',
|
|
13
|
-
[
|
|
14
|
-
'$scope',
|
|
15
|
-
'$stateParams',
|
|
16
|
-
'executionDetailsSectionService',
|
|
17
|
-
'$interpolate',
|
|
18
|
-
function ($scope, $stateParams, executionDetailsSectionService, $interpolate) {
|
|
19
|
-
$scope.configSections = ['bakeConfig', 'taskStatus'];
|
|
20
|
-
|
|
21
|
-
const initialized = () => {
|
|
22
|
-
$scope.detailsSection = $stateParams.details;
|
|
23
|
-
$scope.provider = $scope.stage.context.cloudProviderType || 'docker';
|
|
24
|
-
$scope.bakeryDetailUrl = $interpolate(
|
|
25
|
-
$scope.roscoMode && SETTINGS.roscoDetailUrl ? SETTINGS.roscoDetailUrl : SETTINGS.bakeryDetailUrl,
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const initialize = () => executionDetailsSectionService.synchronizeSection($scope.configSections, initialized);
|
|
30
|
-
|
|
31
|
-
initialize();
|
|
32
|
-
|
|
33
|
-
$scope.$on('$stateChangeSuccess', initialize);
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<div ng-controller="dockerBakeExecutionDetailsCtrl">
|
|
2
|
-
<execution-details-section-nav sections="configSections"></execution-details-section-nav>
|
|
3
|
-
<div class="step-section-details" ng-if="detailsSection === 'bakeConfig'">
|
|
4
|
-
<div class="row">
|
|
5
|
-
<div class="col-md-6">
|
|
6
|
-
<dl class="dl-narrow dl-horizontal">
|
|
7
|
-
<dt if-multiple-providers>Provider</dt>
|
|
8
|
-
<dd if-multiple-providers>Docker</dd>
|
|
9
|
-
<dt>Organization</dt>
|
|
10
|
-
<dd>{{stage.context.organization}}</dd>
|
|
11
|
-
<dt>Image Name</dt>
|
|
12
|
-
<dd>{{stage.context.ami_name}}</dd>
|
|
13
|
-
<dt>Image Tag</dt>
|
|
14
|
-
<dd>{{stage.context.extendedAttributes['docker_target_image_tag']}}</dd>
|
|
15
|
-
<dt>Image</dt>
|
|
16
|
-
<dd>{{stage.context.ami}}</dd>
|
|
17
|
-
</dl>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="col-md-6">
|
|
20
|
-
<dl class="dl-narrow dl-horizontal">
|
|
21
|
-
<dt>Base OS</dt>
|
|
22
|
-
<dd>{{stage.context.baseOs}}</dd>
|
|
23
|
-
<dt>Region</dt>
|
|
24
|
-
<dd>{{stage.context.region}}</dd>
|
|
25
|
-
<dt>Package</dt>
|
|
26
|
-
<dd>{{stage.context.package}}</dd>
|
|
27
|
-
<dt>Label</dt>
|
|
28
|
-
<dd>{{stage.context.baseLabel}}</dd>
|
|
29
|
-
</dl>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>
|
|
33
|
-
|
|
34
|
-
<div class="row" ng-if="stage.context.region && stage.context.status.resourceId">
|
|
35
|
-
<div class="col-md-12">
|
|
36
|
-
<div class="alert alert-{{stage.isFailed ? 'danger' : 'info'}}">
|
|
37
|
-
<a target="_blank" href="{{ bakeryDetailUrl(stage) }}"> View Bakery Details </a>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="step-section-details" ng-if="detailsSection === 'taskStatus'">
|
|
43
|
-
<div class="row">
|
|
44
|
-
<execution-step-details item="stage"></execution-step-details>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<div ng-controller="dockerBakeStageCtrl as bakeStageCtrl">
|
|
2
|
-
<stage-config-field label="Package" help-key="pipeline.config.bake.package">
|
|
3
|
-
<input type="text" class="form-control input-sm" ng-model="stage.package" />
|
|
4
|
-
</stage-config-field>
|
|
5
|
-
<stage-config-field label="Organization" help-key="pipeline.config.docker.bake.organization">
|
|
6
|
-
<input type="text" class="form-control input-sm" ng-model="stage.organization" />
|
|
7
|
-
</stage-config-field>
|
|
8
|
-
<stage-config-field label="Image Name" help-key="pipeline.config.docker.bake.targetImage">
|
|
9
|
-
<input type="text" class="form-control input-sm" ng-model="stage.ami_name" />
|
|
10
|
-
</stage-config-field>
|
|
11
|
-
<stage-config-field label="Image tag" help-key="pipeline.config.docker.bake.targetImageTag">
|
|
12
|
-
<input type="text" class="form-control input-sm" ng-model="stage.extendedAttributes['docker_target_image_tag']" />
|
|
13
|
-
</stage-config-field>
|
|
14
|
-
<stage-config-field label="Base OS">
|
|
15
|
-
<bake-stage-choose-os model="stage.baseOs" base-os-options="baseOsOptions"></bake-stage-choose-os>
|
|
16
|
-
</stage-config-field>
|
|
17
|
-
|
|
18
|
-
<stage-config-field label="Base Label">
|
|
19
|
-
<label class="radio-inline" ng-repeat="baseLabel in baseLabelOptions">
|
|
20
|
-
<input type="radio" ng-model="stage.baseLabel" ng-value="baseLabel" />
|
|
21
|
-
{{baseLabel}}
|
|
22
|
-
</label>
|
|
23
|
-
</stage-config-field>
|
|
24
|
-
<stage-config-field label="Rebake">
|
|
25
|
-
<div class="checkbox" style="margin-bottom: 0">
|
|
26
|
-
<label>
|
|
27
|
-
<input type="checkbox" ng-model="stage.rebake" />
|
|
28
|
-
Rebake image without regard to the status of any existing bake
|
|
29
|
-
</label>
|
|
30
|
-
</div>
|
|
31
|
-
</stage-config-field>
|
|
32
|
-
</div>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import { module } from 'angular';
|
|
4
|
-
import _ from 'lodash';
|
|
5
|
-
|
|
6
|
-
import { AuthenticationService, BakeExecutionLabel, BakeryReader, Registry } from '@spinnaker/core';
|
|
7
|
-
import { DOCKER_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER } from './bakeExecutionDetails.controller';
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
This stage is just here so that we can experiment with baking Docker containers within pipelines.
|
|
11
|
-
Without this stage, programmatically-created pipelines with Docker bake stages would not render
|
|
12
|
-
execution details.
|
|
13
|
-
*/
|
|
14
|
-
export const DOCKER_PIPELINE_STAGES_BAKE_DOCKERBAKESTAGE = 'spinnaker.docker.pipeline.stage.bakeStage';
|
|
15
|
-
export const name = DOCKER_PIPELINE_STAGES_BAKE_DOCKERBAKESTAGE; // for backwards compatibility
|
|
16
|
-
module(DOCKER_PIPELINE_STAGES_BAKE_DOCKERBAKESTAGE, [DOCKER_PIPELINE_STAGES_BAKE_BAKEEXECUTIONDETAILS_CONTROLLER])
|
|
17
|
-
.config(function () {
|
|
18
|
-
Registry.pipeline.registerStage({
|
|
19
|
-
provides: 'bake',
|
|
20
|
-
cloudProvider: 'docker',
|
|
21
|
-
label: 'Bake',
|
|
22
|
-
description: 'Bakes an image',
|
|
23
|
-
templateUrl: require('./bakeStage.html'),
|
|
24
|
-
executionDetailsUrl: require('./bakeExecutionDetails.html'),
|
|
25
|
-
executionLabelComponent: BakeExecutionLabel,
|
|
26
|
-
extraLabelLines: (stage) => {
|
|
27
|
-
return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;
|
|
28
|
-
},
|
|
29
|
-
supportsCustomTimeout: true,
|
|
30
|
-
validators: [{ type: 'requiredField', fieldName: 'package' }],
|
|
31
|
-
restartable: true,
|
|
32
|
-
});
|
|
33
|
-
})
|
|
34
|
-
.controller('dockerBakeStageCtrl', [
|
|
35
|
-
'$scope',
|
|
36
|
-
'$q',
|
|
37
|
-
function ($scope, $q) {
|
|
38
|
-
const stage = $scope.stage;
|
|
39
|
-
|
|
40
|
-
stage.region = 'global';
|
|
41
|
-
|
|
42
|
-
if (!$scope.stage.user) {
|
|
43
|
-
$scope.stage.user = AuthenticationService.getAuthenticatedUser().name;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
$scope.viewState = {
|
|
47
|
-
loading: true,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
function initialize() {
|
|
51
|
-
$scope.viewState.providerSelected = true;
|
|
52
|
-
$q.all([BakeryReader.getBaseOsOptions('docker'), BakeryReader.getBaseLabelOptions()]).then(function ([
|
|
53
|
-
baseOsOptions,
|
|
54
|
-
baseLabelOptions,
|
|
55
|
-
]) {
|
|
56
|
-
$scope.baseOsOptions = baseOsOptions.baseImages;
|
|
57
|
-
$scope.baseLabelOptions = baseLabelOptions;
|
|
58
|
-
|
|
59
|
-
if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {
|
|
60
|
-
$scope.stage.baseOs = $scope.baseOsOptions[0].id;
|
|
61
|
-
}
|
|
62
|
-
if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {
|
|
63
|
-
$scope.stage.baseLabel = $scope.baseLabelOptions[0];
|
|
64
|
-
}
|
|
65
|
-
$scope.viewState.loading = false;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function deleteEmptyProperties() {
|
|
70
|
-
_.forOwn($scope.stage, function (val, key) {
|
|
71
|
-
if (val === '') {
|
|
72
|
-
delete $scope.stage[key];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
$scope.$watch('stage', deleteEmptyProperties, true);
|
|
78
|
-
|
|
79
|
-
initialize();
|
|
80
|
-
},
|
|
81
|
-
]);
|