Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinnaker/docker

Package Overview
Dependencies
Maintainers
13
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinnaker/docker - npm Package Compare versions

Comparing version 0.0.28 to 0.0.29

2

.cache-loader/13433c880a90bf5eb435383ab254b9fb.json

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","mtime":1547003192119},{"path":"/Users/chrisb/netflix/spinnaker/deck/.babelrc","mtime":1547003191612},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1543380569460},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1543380571134},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1543380572493}],"contextDependencies":[],"result":["'use strict';\n\nvar _lodash = require('lodash');\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _core = require('@spinnaker/core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst angular = require('angular');\n\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name]).config(function () {\n _core.Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: _core.BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true\n });\n}).controller('dockerBakeStageCtrl', ['$scope', '$q', function ($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = _core.AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: _core.BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: _core.BakeryReader.getBaseLabelOptions()\n }).then(function (results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _lodash2.default.forOwn($scope.stage, function (val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/dockerBakeStage.js"],"names":["angular","require","module","exports","name","config","pipeline","registerStage","provides","cloudProvider","label","description","templateUrl","executionDetailsUrl","executionLabelComponent","extraLabelLines","stage","masterStage","context","allPreviouslyBaked","somePreviouslyBaked","defaultTimeoutMs","validators","type","fieldName","restartable","controller","$scope","$q","region","user","getAuthenticatedUser","viewState","loading","initialize","providerSelected","all","baseOsOptions","getBaseOsOptions","baseLabelOptions","getBaseLabelOptions","then","results","baseImages","baseOs","length","id","baseLabel","deleteEmptyProperties","forOwn","val","key","$watch"],"mappings":"AAAA;;AAGA;;;;AAEA;;;;AAHA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;;AAKA;;;;;AAKAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,2CADO,EACsC,CAACD,QAAQ,sCAAR,EAAgDG,IAAjD,CADtC,EAEdC,MAFc,CAEP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,aAAlB,CAAgC;AAC9BC,cAAU,MADoB;AAE9BC,mBAAe,QAFe;AAG9BC,WAAO,MAHuB;AAI9BC,iBAAa,gBAJiB;AAK9BC,iBAAaX,QAAQ,kBAAR,CALiB;AAM9BY,yBAAqBZ,QAAQ,6BAAR,CANS;AAO9Ba,qDAP8B;AAQ9BC,qBAAiBC,SAAS;AACxB,aAAOA,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BC,kBAA1B,IAAgDH,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BE,mBAA1E,GAAgG,CAAhG,GAAoG,CAA3G;AACD,KAV6B;AAW9BC,sBAAkB,KAAK,EAAL,GAAU,IAXE,EAWI;AAClCC,gBAAY,CAAC,EAAEC,MAAM,eAAR,EAAyBC,WAAW,SAApC,EAAD,CAZkB;AAa9BC,iBAAa;AAbiB,GAAhC;AAeD,CAlBc,EAmBdC,UAnBc,CAmBH,qBAnBG,mBAmBoB,UAASC,MAAT,EAAiBC,EAAjB,EAAqB;AACtD,MAAIZ,QAAQW,OAAOX,KAAnB;;AAEAA,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F,KAJD;AAKD;;AAEDxB,SAAOyB,MAAP,CAAc,OAAd,EAAuBJ,qBAAvB,EAA8C,IAA9C;;AAEAd;AACD,CA9Dc,EAAjB","file":"dockerBakeStage.js","sourceRoot":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\nimport _ from 'lodash';\n\nimport { AuthenticationService, BakeExecutionLabel, BakeryReader, Registry } from '@spinnaker/core';\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name])\n .config(function() {\n Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true,\n });\n })\n .controller('dockerBakeStageCtrl', function($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true,\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: BakeryReader.getBaseLabelOptions(),\n }).then(function(results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _.forOwn($scope.stage, function(val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n });\n"]}]}
{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/dockerBakeStage.js","mtime":1547003192119},{"path":"/Users/chrisb/netflix/spinnaker/deck/.babelrc","mtime":1547049314072},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1543380569460},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1543380571134},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1543380572493}],"contextDependencies":[],"result":["'use strict';\n\nvar _lodash = require('lodash');\n\nvar _lodash2 = _interopRequireDefault(_lodash);\n\nvar _core = require('@spinnaker/core');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst angular = require('angular');\n\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name]).config(function () {\n _core.Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: _core.BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true\n });\n}).controller('dockerBakeStageCtrl', ['$scope', '$q', function ($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = _core.AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: _core.BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: _core.BakeryReader.getBaseLabelOptions()\n }).then(function (results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _lodash2.default.forOwn($scope.stage, function (val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/dockerBakeStage.js"],"names":["angular","require","module","exports","name","config","pipeline","registerStage","provides","cloudProvider","label","description","templateUrl","executionDetailsUrl","executionLabelComponent","extraLabelLines","stage","masterStage","context","allPreviouslyBaked","somePreviouslyBaked","defaultTimeoutMs","validators","type","fieldName","restartable","controller","$scope","$q","region","user","getAuthenticatedUser","viewState","loading","initialize","providerSelected","all","baseOsOptions","getBaseOsOptions","baseLabelOptions","getBaseLabelOptions","then","results","baseImages","baseOs","length","id","baseLabel","deleteEmptyProperties","forOwn","val","key","$watch"],"mappings":"AAAA;;AAGA;;;;AAEA;;;;AAHA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;;AAKA;;;;;AAKAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,2CADO,EACsC,CAACD,QAAQ,sCAAR,EAAgDG,IAAjD,CADtC,EAEdC,MAFc,CAEP,YAAW;AACjB,iBAASC,QAAT,CAAkBC,aAAlB,CAAgC;AAC9BC,cAAU,MADoB;AAE9BC,mBAAe,QAFe;AAG9BC,WAAO,MAHuB;AAI9BC,iBAAa,gBAJiB;AAK9BC,iBAAaX,QAAQ,kBAAR,CALiB;AAM9BY,yBAAqBZ,QAAQ,6BAAR,CANS;AAO9Ba,qDAP8B;AAQ9BC,qBAAiBC,SAAS;AACxB,aAAOA,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BC,kBAA1B,IAAgDH,MAAMC,WAAN,CAAkBC,OAAlB,CAA0BE,mBAA1E,GAAgG,CAAhG,GAAoG,CAA3G;AACD,KAV6B;AAW9BC,sBAAkB,KAAK,EAAL,GAAU,IAXE,EAWI;AAClCC,gBAAY,CAAC,EAAEC,MAAM,eAAR,EAAyBC,WAAW,SAApC,EAAD,CAZkB;AAa9BC,iBAAa;AAbiB,GAAhC;AAeD,CAlBc,EAmBdC,UAnBc,CAmBH,qBAnBG,mBAmBoB,UAASC,MAAT,EAAiBC,EAAjB,EAAqB;AACtD,MAAIZ,QAAQW,OAAOX,KAAnB;;AAEAA,QAAMa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D;AAKD;;AAEDxB,SAAOyB,MAAP,CAAc,OAAd,EAAuBJ,qBAAvB,EAA8C,IAA9C;;AAEAd;AACD,CA9Dc,EAAjB","file":"dockerBakeStage.js","sourceRoot":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\nimport _ from 'lodash';\n\nimport { AuthenticationService, BakeExecutionLabel, BakeryReader, Registry } from '@spinnaker/core';\n\n/*\n This stage is just here so that we can experiment with baking Docker containers within pipelines.\n Without this stage, programmatically-created pipelines with Docker bake stages would not render\n execution details.\n */\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bakeStage', [require('./bakeExecutionDetails.controller.js').name])\n .config(function() {\n Registry.pipeline.registerStage({\n provides: 'bake',\n cloudProvider: 'docker',\n label: 'Bake',\n description: 'Bakes an image',\n templateUrl: require('./bakeStage.html'),\n executionDetailsUrl: require('./bakeExecutionDetails.html'),\n executionLabelComponent: BakeExecutionLabel,\n extraLabelLines: stage => {\n return stage.masterStage.context.allPreviouslyBaked || stage.masterStage.context.somePreviouslyBaked ? 1 : 0;\n },\n defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes\n validators: [{ type: 'requiredField', fieldName: 'package' }],\n restartable: true,\n });\n })\n .controller('dockerBakeStageCtrl', function($scope, $q) {\n var stage = $scope.stage;\n\n stage.region = 'global';\n\n if (!$scope.stage.user) {\n $scope.stage.user = AuthenticationService.getAuthenticatedUser().name;\n }\n\n $scope.viewState = {\n loading: true,\n };\n\n function initialize() {\n $scope.viewState.providerSelected = true;\n $q.all({\n baseOsOptions: BakeryReader.getBaseOsOptions('docker'),\n baseLabelOptions: BakeryReader.getBaseLabelOptions(),\n }).then(function(results) {\n $scope.baseOsOptions = results.baseOsOptions.baseImages;\n $scope.baseLabelOptions = results.baseLabelOptions;\n\n if (!$scope.stage.baseOs && $scope.baseOsOptions && $scope.baseOsOptions.length) {\n $scope.stage.baseOs = $scope.baseOsOptions[0].id;\n }\n if (!$scope.stage.baseLabel && $scope.baseLabelOptions && $scope.baseLabelOptions.length) {\n $scope.stage.baseLabel = $scope.baseLabelOptions[0];\n }\n $scope.viewState.loading = false;\n });\n }\n\n function deleteEmptyProperties() {\n _.forOwn($scope.stage, function(val, key) {\n if (val === '') {\n delete $scope.stage[key];\n }\n });\n }\n\n $scope.$watch('stage', deleteEmptyProperties, true);\n\n initialize();\n });\n"]}]}

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--5-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/ts-loader/index.js??ref--5-2!/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","mtime":1547003192117},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/ts-loader/index.js","mtime":1545367341714},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js","mtime":1543380580305}],"contextDependencies":[],"result":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = require(\"react\");\nconst react_select_1 = require(\"react-select\");\nconst lodash_1 = require(\"lodash\");\nconst core_1 = require(\"@spinnaker/core\");\nconst DockerImageReader_1 = require(\"./DockerImageReader\");\nconst DockerImageUtils_1 = require(\"./DockerImageUtils\");\nconst imageFields = ['organization', 'repository', 'tag', 'digest'];\nconst defineOptions = [{ label: 'Manually', value: true }, { label: 'Select from list', value: false }];\nclass DockerImageAndTagSelector extends React.Component {\n constructor(props) {\n super(props);\n this.cachedValues = {};\n this.handleRefreshImages = () => {\n this.refreshImages(this.props);\n };\n this.lookupTypeChanged = (o) => {\n const newType = o.value;\n const oldType = this.state.lookupType;\n const oldValue = this.props[oldType];\n const cachedValue = this.cachedValues[newType];\n this.valueChanged(oldType, undefined);\n if (this.cachedValues[newType]) {\n this.valueChanged(newType, cachedValue);\n }\n this.setState({ lookupType: newType });\n this.cachedValues[oldType] = oldValue;\n };\n this.showManualInput = (defineManually) => {\n if (!defineManually) {\n const newFields = DockerImageUtils_1.DockerImageUtils.splitImageId(this.props.imageId || '');\n this.props.onChange(newFields);\n }\n this.setState({ defineManually });\n };\n const accountOptions = props.account ? [{ label: props.account, value: props.account }] : [];\n const organizationOptions = props.organization && props.organization.length ? [{ label: props.organization, value: props.organization }] : [];\n const repositoryOptions = props.repository && props.repository.length ? [{ label: props.repository, value: props.repository }] : [];\n const tagOptions = props.tag && props.tag.length ? [{ label: props.tag, value: props.tag }] : [];\n const defineManually = Boolean(props.imageId && props.imageId.includes('${'));\n this.state = {\n accountOptions,\n imagesLoaded: false,\n imagesLoading: false,\n imagesRefreshing: false,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n lookupType: props.digest ? 'digest' : 'tag',\n };\n }\n getAccountMap(images) {\n const groupedImages = lodash_1.groupBy(images.filter(image => image.account), 'account');\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => `${i.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`));\n return acc;\n }, {});\n }\n getRegistryMap(images) {\n return images.reduce((m, image) => {\n m[image.account] = image.registry;\n return m;\n }, {});\n }\n getOrganizationMap(images) {\n const extractGroupByKey = (image) => `${image.account}/${image.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`;\n const groupedImages = lodash_1.groupBy(images.filter(image => image.repository), extractGroupByKey);\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => i.repository));\n return acc;\n }, {});\n }\n getRepositoryMap(images) {\n const groupedImages = lodash_1.groupBy(images.filter(image => image.account), 'repository');\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => i.tag));\n return acc;\n }, {});\n }\n getOrganizationsList(accountMap) {\n return accountMap ? accountMap[this.props.showRegistry ? this.props.account : this.props.registry] || [] : [];\n }\n getRepositoryList(organizationMap, organization, registry) {\n if (organizationMap) {\n const key = `${this.props.showRegistry ? this.props.account : registry}/${organization || ''}`;\n return organizationMap[key] || [];\n }\n return [];\n }\n getTags(tag, repositoryMap, repository) {\n let tags = [];\n if (this.props.specifyTagByRegex) {\n if (tag && lodash_1.trim(tag) === '') {\n tag = undefined;\n }\n }\n else {\n if (repositoryMap) {\n tags = repositoryMap[repository] || [];\n if (!tags.includes(tag) && tag && !tag.includes('${')) {\n tag = undefined;\n }\n }\n }\n return { tag, tags };\n }\n componentWillReceiveProps(nextProps) {\n if (!this.images ||\n ['account', 'showRegistry'].some((key) => this.props[key] !== nextProps[key])) {\n this.refreshImages(nextProps);\n }\n else if (['organization', 'registry', 'repository'].some((key) => this.props[key] !== nextProps[key])) {\n this.updateThings(nextProps);\n }\n if (nextProps.imageId && nextProps.imageId.includes('${')) {\n this.setState({ defineManually: true });\n }\n }\n synchronizeChanges(values, registry) {\n const { organization, repository, tag, digest } = values;\n if (this.props.onChange) {\n const imageId = DockerImageUtils_1.DockerImageUtils.generateImageId({ organization, repository, tag, digest });\n const changes = {};\n if (tag !== this.props.tag) {\n changes.tag = tag;\n }\n if (imageId !== this.props.imageId) {\n changes.imageId = imageId;\n }\n if (organization !== this.props.organization) {\n changes.organization = organization;\n }\n if (registry !== this.props.registry) {\n changes.registry = registry;\n }\n if (repository !== this.props.repository) {\n changes.repository = repository;\n }\n if (digest !== this.props.digest) {\n changes.digest = digest;\n }\n if (Object.keys(changes).length > 0) {\n this.props.onChange(changes);\n }\n }\n }\n updateThings(props) {\n let { imageId, organization, registry, repository } = props;\n const { account, showRegistry } = props;\n organization =\n !this.organizations.includes(organization) && organization && !organization.includes('${') ? '' : organization;\n if (showRegistry) {\n registry = this.registryMap[account];\n }\n const repositories = this.getRepositoryList(this.organizationMap, organization, registry);\n if (!repositories.includes(repository) && repository && !repository.includes('${')) {\n repository = '';\n }\n const { tag, tags } = this.getTags(props.tag, this.repositoryMap, repository);\n if (!imageId || !imageId.includes('${')) {\n this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);\n }\n this.setState({\n accountOptions: this.newAccounts.sort().map(a => ({ label: a, value: a })),\n organizationOptions: this.organizations\n .filter(o => o)\n .sort()\n .map(o => ({ label: o, value: o })),\n imagesLoaded: true,\n repositoryOptions: repositories.sort().map(r => ({ label: r, value: r })),\n tagOptions: tags.sort().map(t => ({ label: t, value: t })),\n });\n }\n initializeImages(props, refresh) {\n if (this.state.imagesLoading) {\n return;\n }\n const { showRegistry, account, registry } = props;\n const imageConfig = {\n provider: 'dockerRegistry',\n account: showRegistry ? account : registry,\n };\n this.setState({\n imagesLoading: true,\n imagesRefreshing: refresh ? true : false,\n });\n DockerImageReader_1.DockerImageReader.findImages(imageConfig)\n .then((images) => {\n this.images = images;\n this.registryMap = this.getRegistryMap(this.images);\n this.accountMap = this.getAccountMap(this.images);\n this.newAccounts = this.accounts || Object.keys(this.accountMap);\n this.organizationMap = this.getOrganizationMap(this.images);\n this.repositoryMap = this.getRepositoryMap(this.images);\n this.organizations = this.getOrganizationsList(this.accountMap);\n this.updateThings(props);\n })\n .finally(() => {\n this.setState({\n imagesLoading: false,\n imagesRefreshing: false,\n });\n });\n }\n refreshImages(props) {\n this.initializeImages(props, true);\n }\n initializeAccounts(props) {\n let { account } = props;\n core_1.AccountService.listAccounts('dockerRegistry').then((allAccounts) => {\n const accounts = allAccounts.map((a) => a.name);\n if (this.props.showRegistry && !account) {\n account = accounts[0];\n }\n this.accounts = accounts;\n this.refreshImages(Object.assign({}, props, { account }));\n });\n }\n isNew() {\n const { account, organization, registry, repository, tag } = this.props;\n return !account && !organization && !registry && !repository && !tag;\n }\n componentDidMount() {\n if (!this.props.deferInitialization && (this.props.registry || this.isNew())) {\n this.initializeAccounts(this.props);\n }\n }\n valueChanged(name, value) {\n const changes = { [name]: value };\n if (imageFields.some(n => n === name)) {\n // values are parts of the image\n const { organization, repository, tag, digest } = this.props;\n const imageParts = Object.assign({ organization, repository, tag, digest }, changes);\n const imageId = DockerImageUtils_1.DockerImageUtils.generateImageId(imageParts);\n changes.imageId = imageId;\n }\n this.props.onChange && this.props.onChange(changes);\n }\n render() {\n const { account, digest, fieldClass, imageId, labelClass, organization, repository, showDigest, showRegistry, specifyTagByRegex, tag, } = this.props;\n const { accountOptions, imagesLoading, imagesRefreshing, lookupType, organizationOptions, repositoryOptions, defineManually, tagOptions, } = this.state;\n const manualInputToggle = (React.createElement(\"div\", { className: \"sp-formItem groupHeader\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Define Image ID\"),\n React.createElement(\"div\", { className: \"sp-formActions sp-formActions--mobile\" },\n React.createElement(\"span\", { className: \"action\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { value: defineManually, disabled: imagesRefreshing, onChange: (o) => this.showManualInput(o.value), options: defineOptions, clearable: false }))))));\n if (defineManually) {\n return (React.createElement(\"div\", { className: \"sp-formGroup\" },\n manualInputToggle,\n React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Image ID\"),\n React.createElement(\"div\", { className: \"sp-formActions sp-formActions--mobile\" },\n React.createElement(\"span\", { className: \"action\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(\"input\", { className: \"form-control input-sm\", value: imageId || '', onChange: e => this.valueChanged('imageId', e.target.value) })))))));\n }\n const Registry = showRegistry ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Registry Name\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { value: account, disabled: imagesRefreshing, onChange: (o) => this.valueChanged('account', o ? o.value : ''), options: accountOptions, isLoading: imagesRefreshing })),\n React.createElement(\"span\", { className: \"sp-formActions sp-formActions--web\" },\n React.createElement(\"span\", { className: \"action\" },\n React.createElement(core_1.Tooltip, { value: imagesRefreshing ? 'Images refreshing' : 'Refresh images list' },\n React.createElement(\"i\", { className: `fa icon-button-refresh-arrows ${imagesRefreshing ? 'fa-spin' : ''}`, onClick: this.handleRefreshImages })))))))) : null;\n const Organization = (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Organization\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, organization.includes('${') ? (React.createElement(\"input\", { disabled: imagesRefreshing, className: \"form-control input-sm\", value: organization || '', onChange: e => this.valueChanged('organization', e.target.value) })) : (React.createElement(react_select_1.default, { value: organization || '', disabled: imagesRefreshing, onChange: (o) => this.valueChanged('organization', (o && o.value) || ''), placeholder: \"No organization\", options: organizationOptions, isLoading: imagesRefreshing })))))));\n const Image = (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Image\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, repository.includes('${') ? (React.createElement(\"input\", { className: \"form-control input-sm\", disabled: imagesRefreshing, value: repository || '', onChange: e => this.valueChanged('repository', e.target.value) })) : (React.createElement(react_select_1.default, { value: repository || '', disabled: imagesRefreshing, onChange: (o) => this.valueChanged('repository', (o && o.value) || ''), options: repositoryOptions, required: true, isLoading: imagesRefreshing })))))));\n const Tag = lookupType === 'tag' ? (specifyTagByRegex ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" },\n \"Tag \",\n React.createElement(core_1.HelpField, { id: \"pipeline.config.docker.trigger.tag\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(\"input\", { type: \"text\", className: \"form-control input-sm\", value: tag || '', disabled: imagesRefreshing || !repository, onChange: e => this.valueChanged('tag', e.target.value) })))))) : (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Tag\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, tag && tag.includes('${') ? (React.createElement(\"input\", { className: \"form-control input-sm\", disabled: imagesRefreshing, value: tag || '', onChange: e => this.valueChanged('tag', e.target.value), required: true })) : (React.createElement(react_select_1.default, { value: tag || '', disabled: imagesRefreshing || !repository, isLoading: imagesLoading, onChange: (o) => this.valueChanged('tag', o ? o.value : undefined), options: tagOptions, placeholder: \"No tag\", required: true })))))))) : null;\n const Digest = lookupType === 'digest' ? (React.createElement(\"div\", { className: \"form-group\" },\n React.createElement(\"div\", { className: `sm-label-right ${labelClass}` },\n \"Digest \",\n React.createElement(core_1.HelpField, { id: \"pipeline.config.docker.trigger.digest\" })),\n React.createElement(\"div\", { className: fieldClass },\n React.createElement(\"input\", { className: \"form-control input-sm\", placeholder: \"sha256:abc123\", value: digest || '', onChange: e => this.valueChanged('digest', e.target.value), required: true })))) : null;\n const LookupTypeSelector = showDigest ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Type\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { clearable: false, value: lookupType, options: [{ value: 'digest', label: 'Digest' }, { value: 'tag', label: 'Tag' }], onChange: this.lookupTypeChanged })))))) : null;\n return (React.createElement(\"div\", { className: \"sp-formGroup\" },\n manualInputToggle,\n Registry,\n Organization,\n Image,\n LookupTypeSelector,\n Digest,\n Tag));\n }\n}\nDockerImageAndTagSelector.defaultProps = {\n fieldClass: 'col-md-8',\n labelClass: 'col-md-3',\n organization: '',\n registry: '',\n repository: '',\n showDigest: true,\n};\nexports.DockerImageAndTagSelector = DockerImageAndTagSelector;\n",{"version":3,"file":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","sourceRoot":"","sources":["/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,+CAA8C;AAC9C,mCAAqD;AAErD,0CAAiG;AAEjG,2DAAsE;AACtE,yDAAyE;AA2CzE,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAA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ACjB,CAAC;AAXJ,8DA+lBC","sourcesContent":["import * as React from 'react';\nimport Select, { Option } from 'react-select';\nimport { groupBy, reduce, trim, uniq } from 'lodash';\n\nimport { AccountService, HelpField, IAccount, IFindImageParams, Tooltip } from '@spinnaker/core';\n\nimport { DockerImageReader, IDockerImage } from './DockerImageReader';\nimport { DockerImageUtils, IDockerImageParts } from './DockerImageUtils';\n\nexport type IDockerLookupType = 'tag' | 'digest';\n\nexport interface IDockerImageAndTagChanges {\n account?: string;\n organization?: string;\n registry?: string;\n repository?: string;\n tag?: string;\n digest?: string;\n imageId?: string;\n}\n\nexport interface IDockerImageAndTagSelectorProps {\n specifyTagByRegex: boolean;\n imageId: string;\n organization: string;\n registry: string;\n repository: string;\n tag: string;\n digest: string;\n account: string;\n showRegistry?: boolean;\n labelClass?: string;\n fieldClass?: string;\n onChange: (changes: IDockerImageAndTagChanges) => void;\n deferInitialization?: boolean;\n showDigest?: boolean;\n}\n\nexport interface IDockerImageAndTagSelectorState {\n accountOptions: Array<Option<string>>;\n imagesLoaded: boolean;\n imagesLoading: boolean;\n imagesRefreshing: boolean;\n organizationOptions: Array<Option<string>>;\n repositoryOptions: Array<Option<string>>;\n defineManually: boolean;\n tagOptions: Array<Option<string>>;\n lookupType: IDockerLookupType;\n}\n\nconst imageFields = ['organization', 'repository', 'tag', 'digest'];\nconst defineOptions = [{ label: 'Manually', value: true }, { label: 'Select from list', value: false }];\n\nexport class DockerImageAndTagSelector extends React.Component<\n IDockerImageAndTagSelectorProps,\n IDockerImageAndTagSelectorState\n> {\n public static defaultProps: Partial<IDockerImageAndTagSelectorProps> = {\n fieldClass: 'col-md-8',\n labelClass: 'col-md-3',\n organization: '',\n registry: '',\n repository: '',\n showDigest: true,\n };\n\n private images: IDockerImage[];\n private accounts: string[];\n\n private registryMap: { [key: string]: string };\n private accountMap: { [key: string]: string[] };\n private newAccounts: string[];\n private organizationMap: { [key: string]: string[] };\n private repositoryMap: { [key: string]: string[] };\n private organizations: string[];\n private cachedValues: { [key: string]: string } = {};\n\n public constructor(props: IDockerImageAndTagSelectorProps) {\n super(props);\n\n const accountOptions = props.account ? [{ label: props.account, value: props.account }] : [];\n const organizationOptions =\n props.organization && props.organization.length ? [{ label: props.organization, value: props.organization }] : [];\n const repositoryOptions =\n props.repository && props.repository.length ? [{ label: props.repository, value: props.repository }] : [];\n const tagOptions = props.tag && props.tag.length ? [{ label: props.tag, value: props.tag }] : [];\n\n const defineManually = Boolean(props.imageId && props.imageId.includes('${'));\n\n this.state = {\n accountOptions,\n imagesLoaded: false,\n imagesLoading: false,\n imagesRefreshing: false,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n lookupType: props.digest ? 'digest' : 'tag',\n };\n }\n\n private getAccountMap(images: IDockerImage[]): { [key: string]: string[] } {\n const groupedImages = groupBy(images.filter(image => image.account), 'account');\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(\n image.map(\n i =>\n `${i.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`,\n ),\n );\n return acc;\n },\n {},\n );\n }\n\n private getRegistryMap(images: IDockerImage[]) {\n return images.reduce(\n (m: { [key: string]: string }, image: IDockerImage) => {\n m[image.account] = image.registry;\n return m;\n },\n {} as { [key: string]: string },\n );\n }\n\n private getOrganizationMap(images: IDockerImage[]): { [key: string]: string[] } {\n const extractGroupByKey = (image: IDockerImage) =>\n `${image.account}/${image.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`;\n const groupedImages = groupBy(images.filter(image => image.repository), extractGroupByKey);\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(image.map(i => i.repository));\n return acc;\n },\n {},\n );\n }\n\n private getRepositoryMap(images: IDockerImage[]) {\n const groupedImages = groupBy(images.filter(image => image.account), 'repository');\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(image.map(i => i.tag));\n return acc;\n },\n {},\n );\n }\n\n private getOrganizationsList(accountMap: { [key: string]: string[] }) {\n return accountMap ? accountMap[this.props.showRegistry ? this.props.account : this.props.registry] || [] : [];\n }\n\n private getRepositoryList(organizationMap: { [key: string]: string[] }, organization: string, registry: string) {\n if (organizationMap) {\n const key = `${this.props.showRegistry ? this.props.account : registry}/${organization || ''}`;\n return organizationMap[key] || [];\n }\n return [];\n }\n\n private getTags(tag: string, repositoryMap: { [key: string]: string[] }, repository: string) {\n let tags: string[] = [];\n if (this.props.specifyTagByRegex) {\n if (tag && trim(tag) === '') {\n tag = undefined;\n }\n } else {\n if (repositoryMap) {\n tags = repositoryMap[repository] || [];\n if (!tags.includes(tag) && tag && !tag.includes('${')) {\n tag = undefined;\n }\n }\n }\n\n return { tag, tags };\n }\n\n public componentWillReceiveProps(nextProps: IDockerImageAndTagSelectorProps) {\n if (\n !this.images ||\n ['account', 'showRegistry'].some(\n (key: keyof IDockerImageAndTagSelectorProps) => this.props[key] !== nextProps[key],\n )\n ) {\n this.refreshImages(nextProps);\n } else if (\n ['organization', 'registry', 'repository'].some(\n (key: keyof IDockerImageAndTagSelectorProps) => this.props[key] !== nextProps[key],\n )\n ) {\n this.updateThings(nextProps);\n }\n\n if (nextProps.imageId && nextProps.imageId.includes('${')) {\n this.setState({ defineManually: true });\n }\n }\n\n private synchronizeChanges(values: IDockerImageParts, registry: string) {\n const { organization, repository, tag, digest } = values;\n if (this.props.onChange) {\n const imageId = DockerImageUtils.generateImageId({ organization, repository, tag, digest });\n const changes: IDockerImageAndTagChanges = {};\n if (tag !== this.props.tag) {\n changes.tag = tag;\n }\n if (imageId !== this.props.imageId) {\n changes.imageId = imageId;\n }\n if (organization !== this.props.organization) {\n changes.organization = organization;\n }\n if (registry !== this.props.registry) {\n changes.registry = registry;\n }\n if (repository !== this.props.repository) {\n changes.repository = repository;\n }\n if (digest !== this.props.digest) {\n changes.digest = digest;\n }\n if (Object.keys(changes).length > 0) {\n this.props.onChange(changes);\n }\n }\n }\n\n private updateThings(props: IDockerImageAndTagSelectorProps) {\n let { imageId, organization, registry, repository } = props;\n const { account, showRegistry } = props;\n\n organization =\n !this.organizations.includes(organization) && organization && !organization.includes('${') ? '' : organization;\n\n if (showRegistry) {\n registry = this.registryMap[account];\n }\n\n const repositories = this.getRepositoryList(this.organizationMap, organization, registry);\n\n if (!repositories.includes(repository) && repository && !repository.includes('${')) {\n repository = '';\n }\n\n const { tag, tags } = this.getTags(props.tag, this.repositoryMap, repository);\n\n if (!imageId || !imageId.includes('${')) {\n this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);\n }\n\n this.setState({\n accountOptions: this.newAccounts.sort().map(a => ({ label: a, value: a })),\n organizationOptions: this.organizations\n .filter(o => o)\n .sort()\n .map(o => ({ label: o, value: o })),\n imagesLoaded: true,\n repositoryOptions: repositories.sort().map(r => ({ label: r, value: r })),\n tagOptions: tags.sort().map(t => ({ label: t, value: t })),\n });\n }\n\n private initializeImages(props: IDockerImageAndTagSelectorProps, refresh?: boolean) {\n if (this.state.imagesLoading) {\n return;\n }\n\n const { showRegistry, account, registry } = props;\n\n const imageConfig: IFindImageParams = {\n provider: 'dockerRegistry',\n account: showRegistry ? account : registry,\n };\n\n this.setState({\n imagesLoading: true,\n imagesRefreshing: refresh ? true : false,\n });\n DockerImageReader.findImages(imageConfig)\n .then((images: IDockerImage[]) => {\n this.images = images;\n this.registryMap = this.getRegistryMap(this.images);\n this.accountMap = this.getAccountMap(this.images);\n this.newAccounts = this.accounts || Object.keys(this.accountMap);\n\n this.organizationMap = this.getOrganizationMap(this.images);\n this.repositoryMap = this.getRepositoryMap(this.images);\n this.organizations = this.getOrganizationsList(this.accountMap);\n this.updateThings(props);\n })\n .finally(() => {\n this.setState({\n imagesLoading: false,\n imagesRefreshing: false,\n });\n });\n }\n\n public handleRefreshImages = (): void => {\n this.refreshImages(this.props);\n };\n\n public refreshImages(props: IDockerImageAndTagSelectorProps): void {\n this.initializeImages(props, true);\n }\n\n private initializeAccounts(props: IDockerImageAndTagSelectorProps) {\n let { account } = props;\n AccountService.listAccounts('dockerRegistry').then((allAccounts: IAccount[]) => {\n const accounts = allAccounts.map((a: IAccount) => a.name);\n if (this.props.showRegistry && !account) {\n account = accounts[0];\n }\n this.accounts = accounts;\n this.refreshImages({ ...props, ...{ account } });\n });\n }\n\n private isNew(): boolean {\n const { account, organization, registry, repository, tag } = this.props;\n return !account && !organization && !registry && !repository && !tag;\n }\n\n public componentDidMount() {\n if (!this.props.deferInitialization && (this.props.registry || this.isNew())) {\n this.initializeAccounts(this.props);\n }\n }\n\n private valueChanged(name: string, value: string) {\n const changes = { [name]: value };\n if (imageFields.some(n => n === name)) {\n // values are parts of the image\n const { organization, repository, tag, digest } = this.props;\n const imageParts = { ...{ organization, repository, tag, digest }, ...changes };\n const imageId = DockerImageUtils.generateImageId(imageParts);\n changes.imageId = imageId;\n }\n this.props.onChange && this.props.onChange(changes);\n }\n\n private lookupTypeChanged = (o: Option<IDockerLookupType>) => {\n const newType = o.value;\n const oldType = this.state.lookupType;\n const oldValue = this.props[oldType];\n const cachedValue = this.cachedValues[newType];\n\n this.valueChanged(oldType, undefined);\n if (this.cachedValues[newType]) {\n this.valueChanged(newType, cachedValue);\n }\n this.setState({ lookupType: newType });\n this.cachedValues[oldType] = oldValue;\n };\n\n private showManualInput = (defineManually: boolean) => {\n if (!defineManually) {\n const newFields = DockerImageUtils.splitImageId(this.props.imageId || '');\n this.props.onChange(newFields);\n }\n this.setState({ defineManually });\n };\n\n public render() {\n const {\n account,\n digest,\n fieldClass,\n imageId,\n labelClass,\n organization,\n repository,\n showDigest,\n showRegistry,\n specifyTagByRegex,\n tag,\n } = this.props;\n const {\n accountOptions,\n imagesLoading,\n imagesRefreshing,\n lookupType,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n } = this.state;\n\n const manualInputToggle = (\n <div className=\"sp-formItem groupHeader\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Define Image ID</div>\n\n <div className=\"sp-formActions sp-formActions--mobile\">\n <span className=\"action\" />\n </div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n value={defineManually}\n disabled={imagesRefreshing}\n onChange={(o: Option<boolean>) => this.showManualInput(o.value)}\n options={defineOptions}\n clearable={false}\n />\n </span>\n </div>\n </div>\n </div>\n );\n\n if (defineManually) {\n return (\n <div className=\"sp-formGroup\">\n {manualInputToggle}\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Image ID</div>\n <div className=\"sp-formActions sp-formActions--mobile\">\n <span className=\"action\" />\n </div>\n </div>\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <input\n className=\"form-control input-sm\"\n value={imageId || ''}\n onChange={e => this.valueChanged('imageId', e.target.value)}\n />\n </span>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const Registry = showRegistry ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Registry Name</div>\n </div>\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n value={account}\n disabled={imagesRefreshing}\n onChange={(o: Option<string>) => this.valueChanged('account', o ? o.value : '')}\n options={accountOptions}\n isLoading={imagesRefreshing}\n />\n </span>\n <span className=\"sp-formActions sp-formActions--web\">\n <span className=\"action\">\n <Tooltip value={imagesRefreshing ? 'Images refreshing' : 'Refresh images list'}>\n <i\n className={`fa icon-button-refresh-arrows ${imagesRefreshing ? 'fa-spin' : ''}`}\n onClick={this.handleRefreshImages}\n />\n </Tooltip>\n </span>\n </span>\n </div>\n </div>\n </div>\n ) : null;\n\n const Organization = (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Organization</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {organization.includes('${') ? (\n <input\n disabled={imagesRefreshing}\n className=\"form-control input-sm\"\n value={organization || ''}\n onChange={e => this.valueChanged('organization', e.target.value)}\n />\n ) : (\n <Select\n value={organization || ''}\n disabled={imagesRefreshing}\n onChange={(o: Option<string>) => this.valueChanged('organization', (o && o.value) || '')}\n placeholder=\"No organization\"\n options={organizationOptions}\n isLoading={imagesRefreshing}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n );\n\n const Image = (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Image</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {repository.includes('${') ? (\n <input\n className=\"form-control input-sm\"\n disabled={imagesRefreshing}\n value={repository || ''}\n onChange={e => this.valueChanged('repository', e.target.value)}\n />\n ) : (\n <Select\n value={repository || ''}\n disabled={imagesRefreshing}\n onChange={(o: Option<string>) => this.valueChanged('repository', (o && o.value) || '')}\n options={repositoryOptions}\n required={true}\n isLoading={imagesRefreshing}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n );\n\n const Tag =\n lookupType === 'tag' ? (\n specifyTagByRegex ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">\n Tag <HelpField id=\"pipeline.config.docker.trigger.tag\" />\n </div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <input\n type=\"text\"\n className=\"form-control input-sm\"\n value={tag || ''}\n disabled={imagesRefreshing || !repository}\n onChange={e => this.valueChanged('tag', e.target.value)}\n />\n </span>\n </div>\n </div>\n </div>\n ) : (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Tag</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {tag && tag.includes('${') ? (\n <input\n className=\"form-control input-sm\"\n disabled={imagesRefreshing}\n value={tag || ''}\n onChange={e => this.valueChanged('tag', e.target.value)}\n required={true}\n />\n ) : (\n <Select\n value={tag || ''}\n disabled={imagesRefreshing || !repository}\n isLoading={imagesLoading}\n onChange={(o: Option<string>) => this.valueChanged('tag', o ? o.value : undefined)}\n options={tagOptions}\n placeholder=\"No tag\"\n required={true}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n )\n ) : null;\n\n const Digest =\n lookupType === 'digest' ? (\n <div className=\"form-group\">\n <div className={`sm-label-right ${labelClass}`}>\n Digest <HelpField id=\"pipeline.config.docker.trigger.digest\" />\n </div>\n <div className={fieldClass}>\n <input\n className=\"form-control input-sm\"\n placeholder=\"sha256:abc123\"\n value={digest || ''}\n onChange={e => this.valueChanged('digest', e.target.value)}\n required={true}\n />\n </div>\n </div>\n ) : null;\n\n const LookupTypeSelector = showDigest ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Type</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n clearable={false}\n value={lookupType}\n options={[{ value: 'digest', label: 'Digest' }, { value: 'tag', label: 'Tag' }]}\n onChange={this.lookupTypeChanged}\n />\n </span>\n </div>\n </div>\n </div>\n ) : null;\n\n return (\n <div className=\"sp-formGroup\">\n {manualInputToggle}\n {Registry}\n {Organization}\n {Image}\n {LookupTypeSelector}\n {Digest}\n {Tag}\n </div>\n );\n }\n}\n"]}]}
{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--5-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/ts-loader/index.js??ref--5-2!/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","mtime":1547133770278},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/ts-loader/index.js","mtime":1545367341714},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js","mtime":1543380580305}],"contextDependencies":[],"result":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst React = require(\"react\");\nconst react_select_1 = require(\"react-select\");\nconst lodash_1 = require(\"lodash\");\nconst core_1 = require(\"@spinnaker/core\");\nconst DockerImageReader_1 = require(\"./DockerImageReader\");\nconst DockerImageUtils_1 = require(\"./DockerImageUtils\");\nconst imageFields = ['organization', 'repository', 'tag', 'digest'];\nconst defineOptions = [{ label: 'Manually', value: true }, { label: 'Select from list', value: false }];\nclass DockerImageAndTagSelector extends React.Component {\n constructor(props) {\n super(props);\n this.cachedValues = {};\n this.handleRefreshImages = () => {\n this.refreshImages(this.props);\n };\n this.lookupTypeChanged = (o) => {\n const newType = o.value;\n const oldType = this.state.lookupType;\n const oldValue = this.props[oldType];\n const cachedValue = this.cachedValues[newType];\n this.valueChanged(oldType, undefined);\n if (this.cachedValues[newType]) {\n this.valueChanged(newType, cachedValue);\n }\n this.setState({ lookupType: newType });\n this.cachedValues[oldType] = oldValue;\n };\n this.showManualInput = (defineManually) => {\n if (!defineManually) {\n const newFields = DockerImageUtils_1.DockerImageUtils.splitImageId(this.props.imageId || '');\n this.props.onChange(newFields);\n if (this.state.switchedManualWarning) {\n this.setState({ switchedManualWarning: undefined });\n }\n }\n this.setState({ defineManually });\n };\n const accountOptions = props.account ? [{ label: props.account, value: props.account }] : [];\n const organizationOptions = props.organization && props.organization.length ? [{ label: props.organization, value: props.organization }] : [];\n const repositoryOptions = props.repository && props.repository.length ? [{ label: props.repository, value: props.repository }] : [];\n const tagOptions = props.tag && props.tag.length ? [{ label: props.tag, value: props.tag }] : [];\n const defineManually = Boolean(props.imageId && props.imageId.includes('${'));\n this.state = {\n accountOptions,\n switchedManualWarning: undefined,\n imagesLoaded: false,\n imagesLoading: false,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n lookupType: props.digest ? 'digest' : 'tag',\n };\n }\n getAccountMap(images) {\n const groupedImages = lodash_1.groupBy(images.filter(image => image.account), 'account');\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => `${i.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`));\n return acc;\n }, {});\n }\n getRegistryMap(images) {\n return images.reduce((m, image) => {\n m[image.account] = image.registry;\n return m;\n }, {});\n }\n getOrganizationMap(images) {\n const extractGroupByKey = (image) => `${image.account}/${image.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`;\n const groupedImages = lodash_1.groupBy(images.filter(image => image.repository), extractGroupByKey);\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => i.repository));\n return acc;\n }, {});\n }\n getRepositoryMap(images) {\n const groupedImages = lodash_1.groupBy(images.filter(image => image.account), 'repository');\n return lodash_1.reduce(groupedImages, (acc, image, key) => {\n acc[key] = lodash_1.uniq(image.map(i => i.tag));\n return acc;\n }, {});\n }\n getOrganizationsList(accountMap) {\n return accountMap ? accountMap[this.props.showRegistry ? this.props.account : this.props.registry] || [] : [];\n }\n getRepositoryList(organizationMap, organization, registry) {\n if (organizationMap) {\n const key = `${this.props.showRegistry ? this.props.account : registry}/${organization || ''}`;\n return organizationMap[key] || [];\n }\n return [];\n }\n getTags(tag, repositoryMap, repository) {\n let tags = [];\n if (this.props.specifyTagByRegex) {\n if (tag && lodash_1.trim(tag) === '') {\n tag = undefined;\n }\n }\n else {\n if (repositoryMap) {\n tags = repositoryMap[repository] || [];\n if (!tags.includes(tag) && tag && !tag.includes('${')) {\n tag = undefined;\n }\n }\n }\n return { tag, tags };\n }\n componentWillReceiveProps(nextProps) {\n if (!this.images ||\n ['account', 'showRegistry'].some((key) => this.props[key] !== nextProps[key])) {\n this.refreshImages(nextProps);\n }\n else if (['organization', 'registry', 'repository'].some((key) => this.props[key] !== nextProps[key])) {\n this.updateThings(nextProps);\n }\n if (nextProps.imageId && nextProps.imageId.includes('${')) {\n this.setState({ defineManually: true });\n }\n }\n synchronizeChanges(values, registry) {\n const { organization, repository, tag, digest } = values;\n if (this.props.onChange) {\n const imageId = DockerImageUtils_1.DockerImageUtils.generateImageId({ organization, repository, tag, digest });\n const changes = {};\n if (tag !== this.props.tag) {\n changes.tag = tag;\n }\n if (imageId !== this.props.imageId) {\n changes.imageId = imageId;\n }\n if (organization !== this.props.organization) {\n changes.organization = organization;\n }\n if (registry !== this.props.registry) {\n changes.registry = registry;\n }\n if (repository !== this.props.repository) {\n changes.repository = repository;\n }\n if (digest !== this.props.digest) {\n changes.digest = digest;\n }\n if (Object.keys(changes).length > 0) {\n this.props.onChange(changes);\n }\n }\n }\n updateThings(props) {\n let { imageId, organization, registry, repository } = props;\n if (props.showRegistry) {\n registry = this.registryMap[props.account];\n }\n const organizationFound = !organization || this.organizations.includes(organization) || organization.includes('${');\n if (!organizationFound) {\n organization = '';\n }\n const repositories = this.getRepositoryList(this.organizationMap, organization, registry);\n const repositoryFound = !repository || repository.includes('${') || repositories.includes(repository);\n if (!repositoryFound) {\n repository = '';\n }\n const { tag, tags } = this.getTags(props.tag, this.repositoryMap, repository);\n const tagFound = tag !== props.tag;\n const newState = {\n accountOptions: this.newAccounts.sort().map(a => ({ label: a, value: a })),\n organizationOptions: this.organizations\n .filter(o => o)\n .sort()\n .map(o => ({ label: o, value: o })),\n imagesLoaded: true,\n repositoryOptions: repositories.sort().map(r => ({ label: r, value: r })),\n tagOptions: tags.sort().map(t => ({ label: t, value: t })),\n };\n if (imageId && !this.state.imagesLoaded && (!organizationFound || !repositoryFound || !tagFound)) {\n newState.defineManually = true;\n const missingFields = [];\n if (!organizationFound) {\n missingFields.push('organization');\n }\n if (!repositoryFound) {\n missingFields.push('image');\n }\n if (!tagFound) {\n missingFields.push('tag');\n }\n newState.switchedManualWarning = `Could not find ${missingFields.join(' or ')}, switched to manual entry`;\n }\n else if (!imageId || !imageId.includes('${')) {\n this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);\n }\n this.setState(newState);\n }\n initializeImages(props) {\n if (this.state.imagesLoading) {\n return;\n }\n const { showRegistry, account, registry } = props;\n const imageConfig = {\n provider: 'dockerRegistry',\n account: showRegistry ? account : registry,\n };\n this.setState({\n imagesLoading: true,\n });\n DockerImageReader_1.DockerImageReader.findImages(imageConfig)\n .then((images) => {\n this.images = images;\n this.registryMap = this.getRegistryMap(this.images);\n this.accountMap = this.getAccountMap(this.images);\n this.newAccounts = this.accounts || Object.keys(this.accountMap);\n this.organizationMap = this.getOrganizationMap(this.images);\n this.repositoryMap = this.getRepositoryMap(this.images);\n this.organizations = this.getOrganizationsList(this.accountMap);\n this.updateThings(props);\n })\n .finally(() => {\n this.setState({\n imagesLoading: false,\n });\n });\n }\n refreshImages(props) {\n this.initializeImages(props);\n }\n initializeAccounts(props) {\n let { account } = props;\n core_1.AccountService.listAccounts('dockerRegistry').then((allAccounts) => {\n const accounts = allAccounts.map((a) => a.name);\n if (this.props.showRegistry && !account) {\n account = accounts[0];\n }\n this.accounts = accounts;\n this.refreshImages(Object.assign({}, props, { account }));\n });\n }\n isNew() {\n const { account, organization, registry, repository, tag } = this.props;\n return !account && !organization && !registry && !repository && !tag;\n }\n componentDidMount() {\n if (!this.props.deferInitialization && (this.props.registry || this.isNew())) {\n this.initializeAccounts(this.props);\n }\n }\n valueChanged(name, value) {\n const changes = { [name]: value };\n if (imageFields.some(n => n === name)) {\n // values are parts of the image\n const { organization, repository, tag, digest } = this.props;\n const imageParts = Object.assign({ organization, repository, tag, digest }, changes);\n const imageId = DockerImageUtils_1.DockerImageUtils.generateImageId(imageParts);\n changes.imageId = imageId;\n }\n this.props.onChange && this.props.onChange(changes);\n }\n render() {\n const { account, digest, fieldClass, imageId, labelClass, organization, repository, showDigest, showRegistry, specifyTagByRegex, tag, } = this.props;\n const { accountOptions, switchedManualWarning, imagesLoading, lookupType, organizationOptions, repositoryOptions, defineManually, tagOptions, } = this.state;\n const manualInputToggle = (React.createElement(\"div\", { className: \"sp-formItem groupHeader\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Define Image ID\"),\n React.createElement(\"div\", { className: \"sp-formActions sp-formActions--mobile\" },\n React.createElement(\"span\", { className: \"action\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { value: defineManually, disabled: imagesLoading, onChange: (o) => this.showManualInput(o.value), options: defineOptions, clearable: false }))))));\n const warning = switchedManualWarning ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" }),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"messageContainer warningMessage\" },\n React.createElement(\"i\", { className: \"fa icon-alert-triangle\" }),\n React.createElement(\"div\", { className: \"message\" }, switchedManualWarning))))) : null;\n if (defineManually) {\n return (React.createElement(\"div\", { className: \"sp-formGroup\" },\n manualInputToggle,\n React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Image ID\"),\n React.createElement(\"div\", { className: \"sp-formActions sp-formActions--mobile\" },\n React.createElement(\"span\", { className: \"action\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(\"input\", { className: \"form-control input-sm\", value: imageId || '', onChange: e => this.valueChanged('imageId', e.target.value) }))))),\n warning));\n }\n const Registry = showRegistry ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Registry Name\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { value: account, disabled: imagesLoading, onChange: (o) => this.valueChanged('account', o ? o.value : ''), options: accountOptions, isLoading: imagesLoading })),\n React.createElement(\"span\", { className: \"sp-formActions sp-formActions--web\" },\n React.createElement(\"span\", { className: \"action\" },\n React.createElement(core_1.Tooltip, { value: imagesLoading ? 'Images refreshing' : 'Refresh images list' },\n React.createElement(\"i\", { className: `fa icon-button-refresh-arrows ${imagesLoading ? 'fa-spin' : ''}`, onClick: this.handleRefreshImages })))))))) : null;\n const Organization = (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Organization\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, organization.includes('${') ? (React.createElement(\"input\", { disabled: imagesLoading, className: \"form-control input-sm\", value: organization || '', onChange: e => this.valueChanged('organization', e.target.value) })) : (React.createElement(react_select_1.default, { value: organization || '', disabled: imagesLoading, onChange: (o) => this.valueChanged('organization', (o && o.value) || ''), placeholder: \"No organization\", options: organizationOptions, isLoading: imagesLoading })))))));\n const Image = (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Image\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, repository.includes('${') ? (React.createElement(\"input\", { className: \"form-control input-sm\", disabled: imagesLoading, value: repository || '', onChange: e => this.valueChanged('repository', e.target.value) })) : (React.createElement(react_select_1.default, { value: repository || '', disabled: imagesLoading, onChange: (o) => this.valueChanged('repository', (o && o.value) || ''), options: repositoryOptions, required: true, isLoading: imagesLoading })))))));\n const Tag = lookupType === 'tag' ? (specifyTagByRegex ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" },\n \"Tag \",\n React.createElement(core_1.HelpField, { id: \"pipeline.config.docker.trigger.tag\" }))),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(\"input\", { type: \"text\", className: \"form-control input-sm\", value: tag || '', disabled: imagesLoading || !repository, onChange: e => this.valueChanged('tag', e.target.value) })))))) : (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Tag\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" }, tag && tag.includes('${') ? (React.createElement(\"input\", { className: \"form-control input-sm\", disabled: imagesLoading, value: tag || '', onChange: e => this.valueChanged('tag', e.target.value), required: true })) : (React.createElement(react_select_1.default, { value: tag || '', disabled: imagesLoading || !repository, isLoading: imagesLoading, onChange: (o) => this.valueChanged('tag', o ? o.value : undefined), options: tagOptions, placeholder: \"No tag\", required: true })))))))) : null;\n const Digest = lookupType === 'digest' ? (React.createElement(\"div\", { className: \"form-group\" },\n React.createElement(\"div\", { className: `sm-label-right ${labelClass}` },\n \"Digest \",\n React.createElement(core_1.HelpField, { id: \"pipeline.config.docker.trigger.digest\" })),\n React.createElement(\"div\", { className: fieldClass },\n React.createElement(\"input\", { className: \"form-control input-sm\", placeholder: \"sha256:abc123\", value: digest || '', onChange: e => this.valueChanged('digest', e.target.value), required: true })))) : null;\n const LookupTypeSelector = showDigest ? (React.createElement(\"div\", { className: \"sp-formItem\" },\n React.createElement(\"div\", { className: \"sp-formItem__left\" },\n React.createElement(\"div\", { className: \"sp-formLabel\" }, \"Type\")),\n React.createElement(\"div\", { className: \"sp-formItem__right\" },\n React.createElement(\"div\", { className: \"sp-form\" },\n React.createElement(\"span\", { className: \"field\" },\n React.createElement(react_select_1.default, { clearable: false, value: lookupType, options: [{ value: 'digest', label: 'Digest' }, { value: 'tag', label: 'Tag' }], onChange: this.lookupTypeChanged })))))) : null;\n return (React.createElement(\"div\", { className: \"sp-formGroup\" },\n manualInputToggle,\n Registry,\n Organization,\n Image,\n LookupTypeSelector,\n Digest,\n Tag));\n }\n}\nDockerImageAndTagSelector.defaultProps = {\n fieldClass: 'col-md-8',\n labelClass: 'col-md-3',\n organization: '',\n registry: '',\n repository: '',\n showDigest: true,\n};\nexports.DockerImageAndTagSelector = DockerImageAndTagSelector;\n",{"version":3,"file":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx","sourceRoot":"","sources":["/Users/chrisb/netflix/spinnaker/deck/node_modules/tslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/image/DockerImageAndTagSelector.tsx"],"names":[],"mappings":";;AAAA,+BAA+B;AAC/B,+CAA8C;AAC9C,mCAAqD;AAErD,0CAAiG;AAEjG,2DAAsE;AACtE,yDAAyE;AA2CzE,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAExG,MAAa,yBAA0B,SAAQ,KAAK,CAAC,SAGpD;IAqBC,YAAmB,KAAsC;QACvD,KAAK,CAAC,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AC;QAEX,MAAM,kBAAkB,GAAG,UAAU,CAAC,CAAC,CAAC,CACtC,6BAAK,SAAS,EAAC,aAAa;YAC1B,6BAAK,SAAS,EAAC,mBAAmB;gBAChC,6BAAK,SAAS,EAAC,cAAc,WAAW,CACpC;YAEN,6BAAK,SAAS,EAAC,oBAAoB;gBACjC,6BAAK,SAAS,EAAC,SAAS;oBACtB,8BAAM,SAAS,EAAC,OAAO;wBACrB,oBAAC,sBAAM,IACL,SAAS,EAAE,KAAK,EAChB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAC/E,QAAQ,EAAE,IAAI,CAAC,iBAAiB,GAChC,CACG,CACH,CACF,CACF,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;QAET,OAAO,CACL,6BAAK,SAAS,EAAC,cAAc;YAC1B,iBAAiB;YACjB,QAAQ;YACR,YAAY;YACZ,KAAK;YACL,kBAAkB;YAClB,MAAM;YACN,GAAG,CACA,CACP,CAAC;IACJ,CAAC;;AA3nBa,sCAAY,GAA6C;IACrE,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,IAAI;CACjB,CAAC;AAXJ,8DAgoBC","sourcesContent":["import * as React from 'react';\nimport Select, { Option } from 'react-select';\nimport { groupBy, reduce, trim, uniq } from 'lodash';\n\nimport { AccountService, HelpField, IAccount, IFindImageParams, Tooltip } from '@spinnaker/core';\n\nimport { DockerImageReader, IDockerImage } from './DockerImageReader';\nimport { DockerImageUtils, IDockerImageParts } from './DockerImageUtils';\n\nexport type IDockerLookupType = 'tag' | 'digest';\n\nexport interface IDockerImageAndTagChanges {\n account?: string;\n organization?: string;\n registry?: string;\n repository?: string;\n tag?: string;\n digest?: string;\n imageId?: string;\n}\n\nexport interface IDockerImageAndTagSelectorProps {\n specifyTagByRegex: boolean;\n imageId: string;\n organization: string;\n registry: string;\n repository: string;\n tag: string;\n digest: string;\n account: string;\n showRegistry?: boolean;\n labelClass?: string;\n fieldClass?: string;\n onChange: (changes: IDockerImageAndTagChanges) => void;\n deferInitialization?: boolean;\n showDigest?: boolean;\n}\n\nexport interface IDockerImageAndTagSelectorState {\n accountOptions: Array<Option<string>>;\n switchedManualWarning: string;\n imagesLoaded: boolean;\n imagesLoading: boolean;\n organizationOptions: Array<Option<string>>;\n repositoryOptions: Array<Option<string>>;\n defineManually: boolean;\n tagOptions: Array<Option<string>>;\n lookupType: IDockerLookupType;\n}\n\nconst imageFields = ['organization', 'repository', 'tag', 'digest'];\nconst defineOptions = [{ label: 'Manually', value: true }, { label: 'Select from list', value: false }];\n\nexport class DockerImageAndTagSelector extends React.Component<\n IDockerImageAndTagSelectorProps,\n IDockerImageAndTagSelectorState\n> {\n public static defaultProps: Partial<IDockerImageAndTagSelectorProps> = {\n fieldClass: 'col-md-8',\n labelClass: 'col-md-3',\n organization: '',\n registry: '',\n repository: '',\n showDigest: true,\n };\n\n private images: IDockerImage[];\n private accounts: string[];\n\n private registryMap: { [key: string]: string };\n private accountMap: { [key: string]: string[] };\n private newAccounts: string[];\n private organizationMap: { [key: string]: string[] };\n private repositoryMap: { [key: string]: string[] };\n private organizations: string[];\n private cachedValues: { [key: string]: string } = {};\n\n public constructor(props: IDockerImageAndTagSelectorProps) {\n super(props);\n\n const accountOptions = props.account ? [{ label: props.account, value: props.account }] : [];\n const organizationOptions =\n props.organization && props.organization.length ? [{ label: props.organization, value: props.organization }] : [];\n const repositoryOptions =\n props.repository && props.repository.length ? [{ label: props.repository, value: props.repository }] : [];\n const tagOptions = props.tag && props.tag.length ? [{ label: props.tag, value: props.tag }] : [];\n\n const defineManually = Boolean(props.imageId && props.imageId.includes('${'));\n\n this.state = {\n accountOptions,\n switchedManualWarning: undefined,\n imagesLoaded: false,\n imagesLoading: false,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n lookupType: props.digest ? 'digest' : 'tag',\n };\n }\n\n private getAccountMap(images: IDockerImage[]): { [key: string]: string[] } {\n const groupedImages = groupBy(images.filter(image => image.account), 'account');\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(\n image.map(\n i =>\n `${i.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`,\n ),\n );\n return acc;\n },\n {},\n );\n }\n\n private getRegistryMap(images: IDockerImage[]) {\n return images.reduce(\n (m: { [key: string]: string }, image: IDockerImage) => {\n m[image.account] = image.registry;\n return m;\n },\n {} as { [key: string]: string },\n );\n }\n\n private getOrganizationMap(images: IDockerImage[]): { [key: string]: string[] } {\n const extractGroupByKey = (image: IDockerImage) =>\n `${image.account}/${image.repository\n .split('/')\n .slice(0, -1)\n .join('/')}`;\n const groupedImages = groupBy(images.filter(image => image.repository), extractGroupByKey);\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(image.map(i => i.repository));\n return acc;\n },\n {},\n );\n }\n\n private getRepositoryMap(images: IDockerImage[]) {\n const groupedImages = groupBy(images.filter(image => image.account), 'repository');\n return reduce<IDockerImage[], { [key: string]: string[] }>(\n groupedImages,\n (acc, image, key) => {\n acc[key] = uniq(image.map(i => i.tag));\n return acc;\n },\n {},\n );\n }\n\n private getOrganizationsList(accountMap: { [key: string]: string[] }) {\n return accountMap ? accountMap[this.props.showRegistry ? this.props.account : this.props.registry] || [] : [];\n }\n\n private getRepositoryList(organizationMap: { [key: string]: string[] }, organization: string, registry: string) {\n if (organizationMap) {\n const key = `${this.props.showRegistry ? this.props.account : registry}/${organization || ''}`;\n return organizationMap[key] || [];\n }\n return [];\n }\n\n private getTags(tag: string, repositoryMap: { [key: string]: string[] }, repository: string) {\n let tags: string[] = [];\n if (this.props.specifyTagByRegex) {\n if (tag && trim(tag) === '') {\n tag = undefined;\n }\n } else {\n if (repositoryMap) {\n tags = repositoryMap[repository] || [];\n if (!tags.includes(tag) && tag && !tag.includes('${')) {\n tag = undefined;\n }\n }\n }\n\n return { tag, tags };\n }\n\n public componentWillReceiveProps(nextProps: IDockerImageAndTagSelectorProps) {\n if (\n !this.images ||\n ['account', 'showRegistry'].some(\n (key: keyof IDockerImageAndTagSelectorProps) => this.props[key] !== nextProps[key],\n )\n ) {\n this.refreshImages(nextProps);\n } else if (\n ['organization', 'registry', 'repository'].some(\n (key: keyof IDockerImageAndTagSelectorProps) => this.props[key] !== nextProps[key],\n )\n ) {\n this.updateThings(nextProps);\n }\n\n if (nextProps.imageId && nextProps.imageId.includes('${')) {\n this.setState({ defineManually: true });\n }\n }\n\n private synchronizeChanges(values: IDockerImageParts, registry: string) {\n const { organization, repository, tag, digest } = values;\n if (this.props.onChange) {\n const imageId = DockerImageUtils.generateImageId({ organization, repository, tag, digest });\n const changes: IDockerImageAndTagChanges = {};\n if (tag !== this.props.tag) {\n changes.tag = tag;\n }\n if (imageId !== this.props.imageId) {\n changes.imageId = imageId;\n }\n if (organization !== this.props.organization) {\n changes.organization = organization;\n }\n if (registry !== this.props.registry) {\n changes.registry = registry;\n }\n if (repository !== this.props.repository) {\n changes.repository = repository;\n }\n if (digest !== this.props.digest) {\n changes.digest = digest;\n }\n if (Object.keys(changes).length > 0) {\n this.props.onChange(changes);\n }\n }\n }\n\n private updateThings(props: IDockerImageAndTagSelectorProps) {\n let { imageId, organization, registry, repository } = props;\n\n if (props.showRegistry) {\n registry = this.registryMap[props.account];\n }\n\n const organizationFound = !organization || this.organizations.includes(organization) || organization.includes('${');\n if (!organizationFound) {\n organization = '';\n }\n\n const repositories = this.getRepositoryList(this.organizationMap, organization, registry);\n const repositoryFound = !repository || repository.includes('${') || repositories.includes(repository);\n\n if (!repositoryFound) {\n repository = '';\n }\n\n const { tag, tags } = this.getTags(props.tag, this.repositoryMap, repository);\n const tagFound = tag !== props.tag;\n\n const newState = {\n accountOptions: this.newAccounts.sort().map(a => ({ label: a, value: a })),\n organizationOptions: this.organizations\n .filter(o => o)\n .sort()\n .map(o => ({ label: o, value: o })),\n imagesLoaded: true,\n repositoryOptions: repositories.sort().map(r => ({ label: r, value: r })),\n tagOptions: tags.sort().map(t => ({ label: t, value: t })),\n } as IDockerImageAndTagSelectorState;\n\n if (imageId && !this.state.imagesLoaded && (!organizationFound || !repositoryFound || !tagFound)) {\n newState.defineManually = true;\n\n const missingFields: string[] = [];\n if (!organizationFound) {\n missingFields.push('organization');\n }\n if (!repositoryFound) {\n missingFields.push('image');\n }\n if (!tagFound) {\n missingFields.push('tag');\n }\n newState.switchedManualWarning = `Could not find ${missingFields.join(' or ')}, switched to manual entry`;\n } else if (!imageId || !imageId.includes('${')) {\n this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);\n }\n\n this.setState(newState);\n }\n\n private initializeImages(props: IDockerImageAndTagSelectorProps) {\n if (this.state.imagesLoading) {\n return;\n }\n\n const { showRegistry, account, registry } = props;\n\n const imageConfig: IFindImageParams = {\n provider: 'dockerRegistry',\n account: showRegistry ? account : registry,\n };\n\n this.setState({\n imagesLoading: true,\n });\n DockerImageReader.findImages(imageConfig)\n .then((images: IDockerImage[]) => {\n this.images = images;\n this.registryMap = this.getRegistryMap(this.images);\n this.accountMap = this.getAccountMap(this.images);\n this.newAccounts = this.accounts || Object.keys(this.accountMap);\n\n this.organizationMap = this.getOrganizationMap(this.images);\n this.repositoryMap = this.getRepositoryMap(this.images);\n this.organizations = this.getOrganizationsList(this.accountMap);\n this.updateThings(props);\n })\n .finally(() => {\n this.setState({\n imagesLoading: false,\n });\n });\n }\n\n public handleRefreshImages = (): void => {\n this.refreshImages(this.props);\n };\n\n public refreshImages(props: IDockerImageAndTagSelectorProps): void {\n this.initializeImages(props);\n }\n\n private initializeAccounts(props: IDockerImageAndTagSelectorProps) {\n let { account } = props;\n AccountService.listAccounts('dockerRegistry').then((allAccounts: IAccount[]) => {\n const accounts = allAccounts.map((a: IAccount) => a.name);\n if (this.props.showRegistry && !account) {\n account = accounts[0];\n }\n this.accounts = accounts;\n this.refreshImages({ ...props, ...{ account } });\n });\n }\n\n private isNew(): boolean {\n const { account, organization, registry, repository, tag } = this.props;\n return !account && !organization && !registry && !repository && !tag;\n }\n\n public componentDidMount() {\n if (!this.props.deferInitialization && (this.props.registry || this.isNew())) {\n this.initializeAccounts(this.props);\n }\n }\n\n private valueChanged(name: string, value: string) {\n const changes = { [name]: value };\n if (imageFields.some(n => n === name)) {\n // values are parts of the image\n const { organization, repository, tag, digest } = this.props;\n const imageParts = { ...{ organization, repository, tag, digest }, ...changes };\n const imageId = DockerImageUtils.generateImageId(imageParts);\n changes.imageId = imageId;\n }\n this.props.onChange && this.props.onChange(changes);\n }\n\n private lookupTypeChanged = (o: Option<IDockerLookupType>) => {\n const newType = o.value;\n const oldType = this.state.lookupType;\n const oldValue = this.props[oldType];\n const cachedValue = this.cachedValues[newType];\n\n this.valueChanged(oldType, undefined);\n if (this.cachedValues[newType]) {\n this.valueChanged(newType, cachedValue);\n }\n this.setState({ lookupType: newType });\n this.cachedValues[oldType] = oldValue;\n };\n\n private showManualInput = (defineManually: boolean) => {\n if (!defineManually) {\n const newFields = DockerImageUtils.splitImageId(this.props.imageId || '');\n this.props.onChange(newFields);\n if (this.state.switchedManualWarning) {\n this.setState({ switchedManualWarning: undefined });\n }\n }\n this.setState({ defineManually });\n };\n\n public render() {\n const {\n account,\n digest,\n fieldClass,\n imageId,\n labelClass,\n organization,\n repository,\n showDigest,\n showRegistry,\n specifyTagByRegex,\n tag,\n } = this.props;\n const {\n accountOptions,\n switchedManualWarning,\n imagesLoading,\n lookupType,\n organizationOptions,\n repositoryOptions,\n defineManually,\n tagOptions,\n } = this.state;\n\n const manualInputToggle = (\n <div className=\"sp-formItem groupHeader\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Define Image ID</div>\n\n <div className=\"sp-formActions sp-formActions--mobile\">\n <span className=\"action\" />\n </div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n value={defineManually}\n disabled={imagesLoading}\n onChange={(o: Option<boolean>) => this.showManualInput(o.value)}\n options={defineOptions}\n clearable={false}\n />\n </span>\n </div>\n </div>\n </div>\n );\n\n const warning = switchedManualWarning ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\" />\n <div className=\"sp-formItem__right\">\n <div className=\"messageContainer warningMessage\">\n <i className=\"fa icon-alert-triangle\" />\n <div className=\"message\">{switchedManualWarning}</div>\n </div>\n </div>\n </div>\n ) : null;\n\n if (defineManually) {\n return (\n <div className=\"sp-formGroup\">\n {manualInputToggle}\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Image ID</div>\n <div className=\"sp-formActions sp-formActions--mobile\">\n <span className=\"action\" />\n </div>\n </div>\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <input\n className=\"form-control input-sm\"\n value={imageId || ''}\n onChange={e => this.valueChanged('imageId', e.target.value)}\n />\n </span>\n </div>\n </div>\n </div>\n {warning}\n </div>\n );\n }\n\n const Registry = showRegistry ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Registry Name</div>\n </div>\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n value={account}\n disabled={imagesLoading}\n onChange={(o: Option<string>) => this.valueChanged('account', o ? o.value : '')}\n options={accountOptions}\n isLoading={imagesLoading}\n />\n </span>\n <span className=\"sp-formActions sp-formActions--web\">\n <span className=\"action\">\n <Tooltip value={imagesLoading ? 'Images refreshing' : 'Refresh images list'}>\n <i\n className={`fa icon-button-refresh-arrows ${imagesLoading ? 'fa-spin' : ''}`}\n onClick={this.handleRefreshImages}\n />\n </Tooltip>\n </span>\n </span>\n </div>\n </div>\n </div>\n ) : null;\n\n const Organization = (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Organization</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {organization.includes('${') ? (\n <input\n disabled={imagesLoading}\n className=\"form-control input-sm\"\n value={organization || ''}\n onChange={e => this.valueChanged('organization', e.target.value)}\n />\n ) : (\n <Select\n value={organization || ''}\n disabled={imagesLoading}\n onChange={(o: Option<string>) => this.valueChanged('organization', (o && o.value) || '')}\n placeholder=\"No organization\"\n options={organizationOptions}\n isLoading={imagesLoading}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n );\n\n const Image = (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Image</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {repository.includes('${') ? (\n <input\n className=\"form-control input-sm\"\n disabled={imagesLoading}\n value={repository || ''}\n onChange={e => this.valueChanged('repository', e.target.value)}\n />\n ) : (\n <Select\n value={repository || ''}\n disabled={imagesLoading}\n onChange={(o: Option<string>) => this.valueChanged('repository', (o && o.value) || '')}\n options={repositoryOptions}\n required={true}\n isLoading={imagesLoading}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n );\n\n const Tag =\n lookupType === 'tag' ? (\n specifyTagByRegex ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">\n Tag <HelpField id=\"pipeline.config.docker.trigger.tag\" />\n </div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <input\n type=\"text\"\n className=\"form-control input-sm\"\n value={tag || ''}\n disabled={imagesLoading || !repository}\n onChange={e => this.valueChanged('tag', e.target.value)}\n />\n </span>\n </div>\n </div>\n </div>\n ) : (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Tag</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n {tag && tag.includes('${') ? (\n <input\n className=\"form-control input-sm\"\n disabled={imagesLoading}\n value={tag || ''}\n onChange={e => this.valueChanged('tag', e.target.value)}\n required={true}\n />\n ) : (\n <Select\n value={tag || ''}\n disabled={imagesLoading || !repository}\n isLoading={imagesLoading}\n onChange={(o: Option<string>) => this.valueChanged('tag', o ? o.value : undefined)}\n options={tagOptions}\n placeholder=\"No tag\"\n required={true}\n />\n )}\n </span>\n </div>\n </div>\n </div>\n )\n ) : null;\n\n const Digest =\n lookupType === 'digest' ? (\n <div className=\"form-group\">\n <div className={`sm-label-right ${labelClass}`}>\n Digest <HelpField id=\"pipeline.config.docker.trigger.digest\" />\n </div>\n <div className={fieldClass}>\n <input\n className=\"form-control input-sm\"\n placeholder=\"sha256:abc123\"\n value={digest || ''}\n onChange={e => this.valueChanged('digest', e.target.value)}\n required={true}\n />\n </div>\n </div>\n ) : null;\n\n const LookupTypeSelector = showDigest ? (\n <div className=\"sp-formItem\">\n <div className=\"sp-formItem__left\">\n <div className=\"sp-formLabel\">Type</div>\n </div>\n\n <div className=\"sp-formItem__right\">\n <div className=\"sp-form\">\n <span className=\"field\">\n <Select\n clearable={false}\n value={lookupType}\n options={[{ value: 'digest', label: 'Digest' }, { value: 'tag', label: 'Tag' }]}\n onChange={this.lookupTypeChanged}\n />\n </span>\n </div>\n </div>\n </div>\n ) : null;\n\n return (\n <div className=\"sp-formGroup\">\n {manualInputToggle}\n {Registry}\n {Organization}\n {Image}\n {LookupTypeSelector}\n {Digest}\n {Tag}\n </div>\n );\n }\n}\n"]}]}

@@ -1,1 +0,1 @@

{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/bakeExecutionDetails.controller.js","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/bakeExecutionDetails.controller.js","mtime":1547003192118},{"path":"/Users/chrisb/netflix/spinnaker/deck/.babelrc","mtime":1547003191612},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1543380569460},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1543380571134},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1543380572493}],"contextDependencies":[],"result":["'use strict';\n\nvar _core = require('@spinnaker/core');\n\nconst angular = require('angular');\n\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bake.executionDetails.controller', [require('@uirouter/angularjs').default]).controller('dockerBakeExecutionDetailsCtrl', ['$scope', '$stateParams', 'executionDetailsSectionService', '$interpolate', function ($scope, $stateParams, executionDetailsSectionService, $interpolate) {\n $scope.configSections = ['bakeConfig', 'taskStatus'];\n\n let initialized = () => {\n $scope.detailsSection = $stateParams.details;\n $scope.provider = $scope.stage.context.cloudProviderType || 'docker';\n $scope.bakeryDetailUrl = $interpolate(_core.SETTINGS.bakeryDetailUrl);\n };\n\n let initialize = () => executionDetailsSectionService.synchronizeSection($scope.configSections, initialized);\n\n initialize();\n\n $scope.$on('$stateChangeSuccess', initialize);\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/bakeExecutionDetails.controller.js"],"names":["angular","require","module","exports","default","controller","$scope","$stateParams","executionDetailsSectionService","$interpolate","configSections","initialized","detailsSection","details","provider","stage","context","cloudProviderType","bakeryDetailUrl","initialize","synchronizeSection","$on"],"mappings":"AAAA;;AAIA;;AAFA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;AAIAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,kEADO,EAC6D,CAACD,QAAQ,qBAAR,EAA+BG,OAAhC,CAD7D,EAEdC,UAFc,CAEH,gCAFG,+EAE+B,UAC5CC,MAD4C,EAE5CC,YAF4C,EAG5CC,8BAH4C,EAI5CC,YAJ4C,EAK5C;AACAH,SAAOI,cAAP,GAAwB,CAAC,YAAD,EAAe,YAAf,CAAxB;;AAEA,MAAIC,cAAc,MAAM;AACtBL,WAAOM,cAAP,GAAwBL,aAAaM,OAArC;AACAP,WAAOQ,QAAP,GAAkBR,OAAOS,KAAP,CAAaC,OAAb,CAAqBC,iBAArB,IAA0C,QAA5D;AACAX,WAAOY,eAAP,GAAyBT,aAAa,eAASS,eAAtB,CAAzB;AACD,GAJD;;AAMA,MAAIC,aAAa,MAAMX,+BAA+BY,kBAA/B,CAAkDd,OAAOI,cAAzD,EAAyEC,WAAzE,CAAvB;;AAEAQ;;AAEAb,SAAOe,GAAP,CAAW,qBAAX,EAAkCF,UAAlC;AACD,CArBc,EAAjB","file":"bakeExecutionDetails.controller.js","sourceRoot":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\n\nimport { SETTINGS } from '@spinnaker/core';\n\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bake.executionDetails.controller', [require('@uirouter/angularjs').default])\n .controller('dockerBakeExecutionDetailsCtrl', function(\n $scope,\n $stateParams,\n executionDetailsSectionService,\n $interpolate,\n ) {\n $scope.configSections = ['bakeConfig', 'taskStatus'];\n\n let initialized = () => {\n $scope.detailsSection = $stateParams.details;\n $scope.provider = $scope.stage.context.cloudProviderType || 'docker';\n $scope.bakeryDetailUrl = $interpolate(SETTINGS.bakeryDetailUrl);\n };\n\n let initialize = () => executionDetailsSectionService.synchronizeSection($scope.configSections, initialized);\n\n initialize();\n\n $scope.$on('$stateChangeSuccess', initialize);\n });\n"]}]}
{"remainingRequest":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js??ref--4-1!/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js!/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/bakeExecutionDetails.controller.js","dependencies":[{"path":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker/src/pipeline/stages/bake/bakeExecutionDetails.controller.js","mtime":1547003192118},{"path":"/Users/chrisb/netflix/spinnaker/deck/.babelrc","mtime":1547049314072},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/cache-loader/dist/cjs.js","mtime":1543380570435},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/thread-loader/dist/cjs.js","mtime":1543380579739},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/babel-loader/lib/index.js","mtime":1543380569460},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/envify-loader/index.js","mtime":1543380571134},{"path":"/Users/chrisb/netflix/spinnaker/deck/node_modules/eslint-loader/index.js","mtime":1543380572493}],"contextDependencies":[],"result":["'use strict';\n\nvar _core = require('@spinnaker/core');\n\nconst angular = require('angular');\n\nmodule.exports = angular.module('spinnaker.docker.pipeline.stage.bake.executionDetails.controller', [require('@uirouter/angularjs').default]).controller('dockerBakeExecutionDetailsCtrl', ['$scope', '$stateParams', 'executionDetailsSectionService', '$interpolate', function ($scope, $stateParams, executionDetailsSectionService, $interpolate) {\n $scope.configSections = ['bakeConfig', 'taskStatus'];\n\n let initialized = () => {\n $scope.detailsSection = $stateParams.details;\n $scope.provider = $scope.stage.context.cloudProviderType || 'docker';\n $scope.bakeryDetailUrl = $interpolate(_core.SETTINGS.bakeryDetailUrl);\n };\n\n let initialize = () => executionDetailsSectionService.synchronizeSection($scope.configSections, initialized);\n\n initialize();\n\n $scope.$on('$stateChangeSuccess', initialize);\n}]);",{"version":3,"sources":["src/pipeline/stages/bake/bakeExecutionDetails.controller.js"],"names":["angular","require","module","exports","default","controller","$scope","$stateParams","executionDetailsSectionService","$interpolate","configSections","initialized","detailsSection","details","provider","stage","context","cloudProviderType","bakeryDetailUrl","initialize","synchronizeSection","$on"],"mappings":"AAAA;;AAIA;;AAFA,MAAMA,UAAUC,QAAQ,SAAR,CAAhB;;AAIAC,OAAOC,OAAP,GAAiBH,QACdE,MADc,CACP,kEADO,EAC6D,CAACD,QAAQ,qBAAR,EAA+BG,OAAhC,CAD7D,EAEdC,UAFc,CAEH,gCAFG,+EAE+B,UAC5CC,MAD4C,EAE5CC,YAF4C,EAG5CC,8BAH4C,EAI5CC,YAJ4C,EAK5C;AACAH,SAAOI,cAAP,GAAwB,CAAC,YAAD,EAAe,YAAf,CAAxB;;AAEA,MAAIC,cAAc,MAAM;AACtBL,WAAOM,cAAP,GAAwBL,aAAaM,OAArC;AACAP,WAAOQ,QAAP,GAAkBR,OAAOS,KAAP,CAAaC,OAAb,CAAqBC,iBAArB,IAA0C,QAA5D;AACAX,WAAOY,eAAP,GAAyBT,aAAa,eAASS,eAAtB,CAAzB;AACD,GAJD;;AAMA,MAAIC,aAAa,MAAMX,+BAA+BY,kBAA/B,CAAkDd,OAAOI,cAAzD,EAAyEC,WAAzE,CAAvB;;AAEAQ;;AAEAb,SAAOe,GAAP,CAAW,qBAAX,EAAkCF,UAAlC;AACD,CArBc,EAAjB","file":"bakeExecutionDetails.controller.js","sourceRoot":"/Users/chrisb/netflix/spinnaker/deck/app/scripts/modules/docker","sourcesContent":["'use strict';\n\nconst angular = require('angular');\n\nimport { SETTINGS } from '@spinnaker/core';\n\nmodule.exports = angular\n .module('spinnaker.docker.pipeline.stage.bake.executionDetails.controller', [require('@uirouter/angularjs').default])\n .controller('dockerBakeExecutionDetailsCtrl', function(\n $scope,\n $stateParams,\n executionDetailsSectionService,\n $interpolate,\n ) {\n $scope.configSections = ['bakeConfig', 'taskStatus'];\n\n let initialized = () => {\n $scope.detailsSection = $stateParams.details;\n $scope.provider = $scope.stage.context.cloudProviderType || 'docker';\n $scope.bakeryDetailUrl = $interpolate(SETTINGS.bakeryDetailUrl);\n };\n\n let initialize = () => executionDetailsSectionService.synchronizeSection($scope.configSections, initialized);\n\n initialize();\n\n $scope.$on('$stateChangeSuccess', initialize);\n });\n"]}]}

@@ -31,5 +31,5 @@ import * as React from 'react';

accountOptions: Array<Option<string>>;
switchedManualWarning: string;
imagesLoaded: boolean;
imagesLoading: boolean;
imagesRefreshing: boolean;
organizationOptions: Array<Option<string>>;

@@ -36,0 +36,0 @@ repositoryOptions: Array<Option<string>>;

@@ -34,2 +34,5 @@ "use strict";

this.props.onChange(newFields);
if (this.state.switchedManualWarning) {
this.setState({ switchedManualWarning: undefined });
}
}

@@ -45,5 +48,5 @@ this.setState({ defineManually });

accountOptions,
switchedManualWarning: undefined,
imagesLoaded: false,
imagesLoading: false,
imagesRefreshing: false,
organizationOptions,

@@ -159,17 +162,17 @@ repositoryOptions,

let { imageId, organization, registry, repository } = props;
const { account, showRegistry } = props;
organization =
!this.organizations.includes(organization) && organization && !organization.includes('${') ? '' : organization;
if (showRegistry) {
registry = this.registryMap[account];
if (props.showRegistry) {
registry = this.registryMap[props.account];
}
const organizationFound = !organization || this.organizations.includes(organization) || organization.includes('${');
if (!organizationFound) {
organization = '';
}
const repositories = this.getRepositoryList(this.organizationMap, organization, registry);
if (!repositories.includes(repository) && repository && !repository.includes('${')) {
const repositoryFound = !repository || repository.includes('${') || repositories.includes(repository);
if (!repositoryFound) {
repository = '';
}
const { tag, tags } = this.getTags(props.tag, this.repositoryMap, repository);
if (!imageId || !imageId.includes('${')) {
this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);
}
this.setState({
const tagFound = tag !== props.tag;
const newState = {
accountOptions: this.newAccounts.sort().map(a => ({ label: a, value: a })),

@@ -183,5 +186,23 @@ organizationOptions: this.organizations

tagOptions: tags.sort().map(t => ({ label: t, value: t })),
});
};
if (imageId && !this.state.imagesLoaded && (!organizationFound || !repositoryFound || !tagFound)) {
newState.defineManually = true;
const missingFields = [];
if (!organizationFound) {
missingFields.push('organization');
}
if (!repositoryFound) {
missingFields.push('image');
}
if (!tagFound) {
missingFields.push('tag');
}
newState.switchedManualWarning = `Could not find ${missingFields.join(' or ')}, switched to manual entry`;
}
else if (!imageId || !imageId.includes('${')) {
this.synchronizeChanges({ organization, repository, tag, digest: this.props.digest }, registry);
}
this.setState(newState);
}
initializeImages(props, refresh) {
initializeImages(props) {
if (this.state.imagesLoading) {

@@ -197,3 +218,2 @@ return;

imagesLoading: true,
imagesRefreshing: refresh ? true : false,
});

@@ -214,3 +234,2 @@ DockerImageReader_1.DockerImageReader.findImages(imageConfig)

imagesLoading: false,
imagesRefreshing: false,
});

@@ -220,3 +239,3 @@ });

refreshImages(props) {
this.initializeImages(props, true);
this.initializeImages(props);
}

@@ -256,3 +275,3 @@ initializeAccounts(props) {

const { account, digest, fieldClass, imageId, labelClass, organization, repository, showDigest, showRegistry, specifyTagByRegex, tag, } = this.props;
const { accountOptions, imagesLoading, imagesRefreshing, lookupType, organizationOptions, repositoryOptions, defineManually, tagOptions, } = this.state;
const { accountOptions, switchedManualWarning, imagesLoading, lookupType, organizationOptions, repositoryOptions, defineManually, tagOptions, } = this.state;
const manualInputToggle = (React.createElement("div", { className: "sp-formItem groupHeader" },

@@ -266,3 +285,9 @@ React.createElement("div", { className: "sp-formItem__left" },

React.createElement("span", { className: "field" },
React.createElement(react_select_1.default, { value: defineManually, disabled: imagesRefreshing, onChange: (o) => this.showManualInput(o.value), options: defineOptions, clearable: false }))))));
React.createElement(react_select_1.default, { value: defineManually, disabled: imagesLoading, onChange: (o) => this.showManualInput(o.value), options: defineOptions, clearable: false }))))));
const warning = switchedManualWarning ? (React.createElement("div", { className: "sp-formItem" },
React.createElement("div", { className: "sp-formItem__left" }),
React.createElement("div", { className: "sp-formItem__right" },
React.createElement("div", { className: "messageContainer warningMessage" },
React.createElement("i", { className: "fa icon-alert-triangle" }),
React.createElement("div", { className: "message" }, switchedManualWarning))))) : null;
if (defineManually) {

@@ -279,3 +304,4 @@ return (React.createElement("div", { className: "sp-formGroup" },

React.createElement("span", { className: "field" },
React.createElement("input", { className: "form-control input-sm", value: imageId || '', onChange: e => this.valueChanged('imageId', e.target.value) })))))));
React.createElement("input", { className: "form-control input-sm", value: imageId || '', onChange: e => this.valueChanged('imageId', e.target.value) }))))),
warning));
}

@@ -288,7 +314,7 @@ const Registry = showRegistry ? (React.createElement("div", { className: "sp-formItem" },

React.createElement("span", { className: "field" },
React.createElement(react_select_1.default, { value: account, disabled: imagesRefreshing, onChange: (o) => this.valueChanged('account', o ? o.value : ''), options: accountOptions, isLoading: imagesRefreshing })),
React.createElement(react_select_1.default, { value: account, disabled: imagesLoading, onChange: (o) => this.valueChanged('account', o ? o.value : ''), options: accountOptions, isLoading: imagesLoading })),
React.createElement("span", { className: "sp-formActions sp-formActions--web" },
React.createElement("span", { className: "action" },
React.createElement(core_1.Tooltip, { value: imagesRefreshing ? 'Images refreshing' : 'Refresh images list' },
React.createElement("i", { className: `fa icon-button-refresh-arrows ${imagesRefreshing ? 'fa-spin' : ''}`, onClick: this.handleRefreshImages })))))))) : null;
React.createElement(core_1.Tooltip, { value: imagesLoading ? 'Images refreshing' : 'Refresh images list' },
React.createElement("i", { className: `fa icon-button-refresh-arrows ${imagesLoading ? 'fa-spin' : ''}`, onClick: this.handleRefreshImages })))))))) : null;
const Organization = (React.createElement("div", { className: "sp-formItem" },

@@ -299,3 +325,3 @@ React.createElement("div", { className: "sp-formItem__left" },

React.createElement("div", { className: "sp-form" },
React.createElement("span", { className: "field" }, organization.includes('${') ? (React.createElement("input", { disabled: imagesRefreshing, className: "form-control input-sm", value: organization || '', onChange: e => this.valueChanged('organization', e.target.value) })) : (React.createElement(react_select_1.default, { value: organization || '', disabled: imagesRefreshing, onChange: (o) => this.valueChanged('organization', (o && o.value) || ''), placeholder: "No organization", options: organizationOptions, isLoading: imagesRefreshing })))))));
React.createElement("span", { className: "field" }, organization.includes('${') ? (React.createElement("input", { disabled: imagesLoading, className: "form-control input-sm", value: organization || '', onChange: e => this.valueChanged('organization', e.target.value) })) : (React.createElement(react_select_1.default, { value: organization || '', disabled: imagesLoading, onChange: (o) => this.valueChanged('organization', (o && o.value) || ''), placeholder: "No organization", options: organizationOptions, isLoading: imagesLoading })))))));
const Image = (React.createElement("div", { className: "sp-formItem" },

@@ -306,3 +332,3 @@ React.createElement("div", { className: "sp-formItem__left" },

React.createElement("div", { className: "sp-form" },
React.createElement("span", { className: "field" }, repository.includes('${') ? (React.createElement("input", { className: "form-control input-sm", disabled: imagesRefreshing, value: repository || '', onChange: e => this.valueChanged('repository', e.target.value) })) : (React.createElement(react_select_1.default, { value: repository || '', disabled: imagesRefreshing, onChange: (o) => this.valueChanged('repository', (o && o.value) || ''), options: repositoryOptions, required: true, isLoading: imagesRefreshing })))))));
React.createElement("span", { className: "field" }, repository.includes('${') ? (React.createElement("input", { className: "form-control input-sm", disabled: imagesLoading, value: repository || '', onChange: e => this.valueChanged('repository', e.target.value) })) : (React.createElement(react_select_1.default, { value: repository || '', disabled: imagesLoading, onChange: (o) => this.valueChanged('repository', (o && o.value) || ''), options: repositoryOptions, required: true, isLoading: imagesLoading })))))));
const Tag = lookupType === 'tag' ? (specifyTagByRegex ? (React.createElement("div", { className: "sp-formItem" },

@@ -316,3 +342,3 @@ React.createElement("div", { className: "sp-formItem__left" },

React.createElement("span", { className: "field" },
React.createElement("input", { type: "text", className: "form-control input-sm", value: tag || '', disabled: imagesRefreshing || !repository, onChange: e => this.valueChanged('tag', e.target.value) })))))) : (React.createElement("div", { className: "sp-formItem" },
React.createElement("input", { type: "text", className: "form-control input-sm", value: tag || '', disabled: imagesLoading || !repository, onChange: e => this.valueChanged('tag', e.target.value) })))))) : (React.createElement("div", { className: "sp-formItem" },
React.createElement("div", { className: "sp-formItem__left" },

@@ -322,3 +348,3 @@ React.createElement("div", { className: "sp-formLabel" }, "Tag")),

React.createElement("div", { className: "sp-form" },
React.createElement("span", { className: "field" }, tag && tag.includes('${') ? (React.createElement("input", { className: "form-control input-sm", disabled: imagesRefreshing, value: tag || '', onChange: e => this.valueChanged('tag', e.target.value), required: true })) : (React.createElement(react_select_1.default, { value: tag || '', disabled: imagesRefreshing || !repository, isLoading: imagesLoading, onChange: (o) => this.valueChanged('tag', o ? o.value : undefined), options: tagOptions, placeholder: "No tag", required: true })))))))) : null;
React.createElement("span", { className: "field" }, tag && tag.includes('${') ? (React.createElement("input", { className: "form-control input-sm", disabled: imagesLoading, value: tag || '', onChange: e => this.valueChanged('tag', e.target.value), required: true })) : (React.createElement(react_select_1.default, { value: tag || '', disabled: imagesLoading || !repository, isLoading: imagesLoading, onChange: (o) => this.valueChanged('tag', o ? o.value : undefined), options: tagOptions, placeholder: "No tag", required: true })))))))) : null;
const Digest = lookupType === 'digest' ? (React.createElement("div", { className: "form-group" },

@@ -325,0 +351,0 @@ React.createElement("div", { className: `sm-label-right ${labelClass}` },

@@ -1,2 +0,2 @@

!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory(require("@spinnaker/core")):"function"==typeof define&&define.amd?define("@spinnaker/docker",["@spinnaker/core"],factory):"object"==typeof exports?exports["@spinnaker/docker"]=factory(require("@spinnaker/core")):root["@spinnaker/docker"]=factory(root["@spinnaker/core"])}(window,function(__WEBPACK_EXTERNAL_MODULE__0__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,exports){module.exports=require("angular")},function(module,exports){module.exports=require("react")},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeStage.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeStageCtrl as bakeStageCtrl">\n <stage-config-field label="Package" help-key="pipeline.config.bake.package">\n <input type="text" class="form-control input-sm"\n ng-model="stage.package"/>\n </stage-config-field>\n <stage-config-field label="Organization" help-key="pipeline.config.docker.bake.organization">\n <input type="text" class="form-control input-sm"\n ng-model="stage.organization"/>\n </stage-config-field>\n <stage-config-field label="Image Name" help-key="pipeline.config.docker.bake.targetImage">\n <input type="text" class="form-control input-sm"\n ng-model="stage.ami_name"/>\n </stage-config-field>\n <stage-config-field label="Image tag" help-key="pipeline.config.docker.bake.targetImageTag">\n <input type="text" class="form-control input-sm"\n ng-model="stage.extendedAttributes[\'docker_target_image_tag\']"/>\n </stage-config-field>\n <stage-config-field label="Base OS">\n <bake-stage-choose-os model="stage.baseOs" base-os-options="baseOsOptions"></bake-stage-choose-os>\n </stage-config-field>\n\n <stage-config-field label="Base Label">\n <label class="radio-inline" ng-repeat="baseLabel in baseLabelOptions">\n <input type="radio"\n ng-model="stage.baseLabel"\n ng-value="baseLabel"/>\n {{baseLabel}}\n </label>\n </stage-config-field>\n <stage-config-field label="Rebake">\n <div class="checkbox" style="margin-bottom: 0">\n <label>\n <input type="checkbox"\n ng-model="stage.rebake">\n </input>\n Rebake image without regard to the status of any existing bake\n </label>\n </div>\n </stage-config-field>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeExecutionDetails.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'bakeConfig\'">\n <div class="row">\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt if-multiple-providers>Provider</dt>\n <dd if-multiple-providers>Docker</dd>\n <dt>Organization</dt>\n <dd>{{stage.context.organization}}</dd>\n <dt>Image Name</dt>\n <dd>{{stage.context.ami_name}}</dd>\n <dt>Image Tag</dt>\n <dd>{{stage.context.extendedAttributes[\'docker_target_image_tag\']}}</dd>\n <dt>Image</dt>\n <dd>{{stage.context.ami}}</dd>\n </dl>\n </div>\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt>Base OS</dt>\n <dd>{{stage.context.baseOs}}</dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Package</dt>\n <dd>{{stage.context.package}}</dd>\n <dt>Label</dt>\n <dd>{{stage.context.baseLabel}}</dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="stage.context.region && stage.context.status.resourceId">\n <div class="col-md-12">\n <div class="alert alert-{{stage.isFailed ? \'danger\' : \'info\'}}">\n <a target="_blank" href="{{ bakeryDetailUrl(stage) }}">\n View Bakery Details\n </a>\n </div>\n </div>\n </div>\n\n </div>\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DockerImageUtils=class{static splitImageId(imageId){const parts=imageId.split("/"),organization=parts.length>1?parts.shift():"",rest=parts.shift().split(":"),repository=organization.length>0?`${organization}/${rest.shift()}`:rest.shift(),lookup=rest.shift();let tag,digest;return lookup&&(lookup.startsWith("sha256:")?digest=lookup:tag=lookup),{organization:organization,repository:repository,digest:digest,tag:tag}}static generateImageId(parts){if(parts.repository&&(parts.digest||parts.tag))return`${parts.repository}:${parts.digest?parts.digest:parts.tag}`}}},function(module,exports){module.exports=require("lodash")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),react_select_1=__webpack_require__(20),lodash_1=__webpack_require__(6),core_1=__webpack_require__(0),DockerImageReader_1=__webpack_require__(8),DockerImageUtils_1=__webpack_require__(5),imageFields=["organization","repository","tag","digest"],defineOptions=[{label:"Manually",value:!0},{label:"Select from list",value:!1}];class DockerImageAndTagSelector extends React.Component{constructor(props){super(props),this.cachedValues={},this.handleRefreshImages=(()=>{this.refreshImages(this.props)}),this.lookupTypeChanged=(o=>{const newType=o.value,oldType=this.state.lookupType,oldValue=this.props[oldType],cachedValue=this.cachedValues[newType];this.valueChanged(oldType,void 0),this.cachedValues[newType]&&this.valueChanged(newType,cachedValue),this.setState({lookupType:newType}),this.cachedValues[oldType]=oldValue}),this.showManualInput=(defineManually=>{if(!defineManually){const newFields=DockerImageUtils_1.DockerImageUtils.splitImageId(this.props.imageId||"");this.props.onChange(newFields)}this.setState({defineManually:defineManually})});const accountOptions=props.account?[{label:props.account,value:props.account}]:[],organizationOptions=props.organization&&props.organization.length?[{label:props.organization,value:props.organization}]:[],repositoryOptions=props.repository&&props.repository.length?[{label:props.repository,value:props.repository}]:[],tagOptions=props.tag&&props.tag.length?[{label:props.tag,value:props.tag}]:[],defineManually=Boolean(props.imageId&&props.imageId.includes("${"));this.state={accountOptions:accountOptions,imagesLoaded:!1,imagesLoading:!1,imagesRefreshing:!1,organizationOptions:organizationOptions,repositoryOptions:repositoryOptions,defineManually:defineManually,tagOptions:tagOptions,lookupType:props.digest?"digest":"tag"}}getAccountMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.account),"account");return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>`${i.repository.split("/").slice(0,-1).join("/")}`)),acc),{})}getRegistryMap(images){return images.reduce((m,image)=>(m[image.account]=image.registry,m),{})}getOrganizationMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.repository),image=>`${image.account}/${image.repository.split("/").slice(0,-1).join("/")}`);return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>i.repository)),acc),{})}getRepositoryMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.account),"repository");return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>i.tag)),acc),{})}getOrganizationsList(accountMap){return accountMap&&accountMap[this.props.showRegistry?this.props.account:this.props.registry]||[]}getRepositoryList(organizationMap,organization,registry){if(organizationMap){return organizationMap[`${this.props.showRegistry?this.props.account:registry}/${organization||""}`]||[]}return[]}getTags(tag,repositoryMap,repository){let tags=[];return this.props.specifyTagByRegex?tag&&""===lodash_1.trim(tag)&&(tag=void 0):repositoryMap&&((tags=repositoryMap[repository]||[]).includes(tag)||!tag||tag.includes("${")||(tag=void 0)),{tag:tag,tags:tags}}componentWillReceiveProps(nextProps){!this.images||["account","showRegistry"].some(key=>this.props[key]!==nextProps[key])?this.refreshImages(nextProps):["organization","registry","repository"].some(key=>this.props[key]!==nextProps[key])&&this.updateThings(nextProps),nextProps.imageId&&nextProps.imageId.includes("${")&&this.setState({defineManually:!0})}synchronizeChanges(values,registry){const{organization:organization,repository:repository,tag:tag,digest:digest}=values;if(this.props.onChange){const imageId=DockerImageUtils_1.DockerImageUtils.generateImageId({organization:organization,repository:repository,tag:tag,digest:digest}),changes={};tag!==this.props.tag&&(changes.tag=tag),imageId!==this.props.imageId&&(changes.imageId=imageId),organization!==this.props.organization&&(changes.organization=organization),registry!==this.props.registry&&(changes.registry=registry),repository!==this.props.repository&&(changes.repository=repository),digest!==this.props.digest&&(changes.digest=digest),Object.keys(changes).length>0&&this.props.onChange(changes)}}updateThings(props){let{imageId:imageId,organization:organization,registry:registry,repository:repository}=props;const{account:account,showRegistry:showRegistry}=props;organization=this.organizations.includes(organization)||!organization||organization.includes("${")?organization:"",showRegistry&&(registry=this.registryMap[account]);const repositories=this.getRepositoryList(this.organizationMap,organization,registry);repositories.includes(repository)||!repository||repository.includes("${")||(repository="");const{tag:tag,tags:tags}=this.getTags(props.tag,this.repositoryMap,repository);imageId&&imageId.includes("${")||this.synchronizeChanges({organization:organization,repository:repository,tag:tag,digest:this.props.digest},registry),this.setState({accountOptions:this.newAccounts.sort().map(a=>({label:a,value:a})),organizationOptions:this.organizations.filter(o=>o).sort().map(o=>({label:o,value:o})),imagesLoaded:!0,repositoryOptions:repositories.sort().map(r=>({label:r,value:r})),tagOptions:tags.sort().map(t=>({label:t,value:t}))})}initializeImages(props,refresh){if(this.state.imagesLoading)return;const{showRegistry:showRegistry,account:account,registry:registry}=props,imageConfig={provider:"dockerRegistry",account:showRegistry?account:registry};this.setState({imagesLoading:!0,imagesRefreshing:!!refresh}),DockerImageReader_1.DockerImageReader.findImages(imageConfig).then(images=>{this.images=images,this.registryMap=this.getRegistryMap(this.images),this.accountMap=this.getAccountMap(this.images),this.newAccounts=this.accounts||Object.keys(this.accountMap),this.organizationMap=this.getOrganizationMap(this.images),this.repositoryMap=this.getRepositoryMap(this.images),this.organizations=this.getOrganizationsList(this.accountMap),this.updateThings(props)}).finally(()=>{this.setState({imagesLoading:!1,imagesRefreshing:!1})})}refreshImages(props){this.initializeImages(props,!0)}initializeAccounts(props){let{account:account}=props;core_1.AccountService.listAccounts("dockerRegistry").then(allAccounts=>{const accounts=allAccounts.map(a=>a.name);this.props.showRegistry&&!account&&(account=accounts[0]),this.accounts=accounts,this.refreshImages(Object.assign({},props,{account:account}))})}isNew(){const{account:account,organization:organization,registry:registry,repository:repository,tag:tag}=this.props;return!(account||organization||registry||repository||tag)}componentDidMount(){this.props.deferInitialization||!this.props.registry&&!this.isNew()||this.initializeAccounts(this.props)}valueChanged(name,value){const changes={[name]:value};if(imageFields.some(n=>n===name)){const{organization:organization,repository:repository,tag:tag,digest:digest}=this.props,imageParts=Object.assign({organization:organization,repository:repository,tag:tag,digest:digest},changes),imageId=DockerImageUtils_1.DockerImageUtils.generateImageId(imageParts);changes.imageId=imageId}this.props.onChange&&this.props.onChange(changes)}render(){const{account:account,digest:digest,fieldClass:fieldClass,imageId:imageId,labelClass:labelClass,organization:organization,repository:repository,showDigest:showDigest,showRegistry:showRegistry,specifyTagByRegex:specifyTagByRegex,tag:tag}=this.props,{accountOptions:accountOptions,imagesLoading:imagesLoading,imagesRefreshing:imagesRefreshing,lookupType:lookupType,organizationOptions:organizationOptions,repositoryOptions:repositoryOptions,defineManually:defineManually,tagOptions:tagOptions}=this.state,manualInputToggle=React.createElement("div",{className:"sp-formItem groupHeader"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Define Image ID"),React.createElement("div",{className:"sp-formActions sp-formActions--mobile"},React.createElement("span",{className:"action"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{value:defineManually,disabled:imagesRefreshing,onChange:o=>this.showManualInput(o.value),options:defineOptions,clearable:!1})))));if(defineManually)return React.createElement("div",{className:"sp-formGroup"},manualInputToggle,React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Image ID"),React.createElement("div",{className:"sp-formActions sp-formActions--mobile"},React.createElement("span",{className:"action"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement("input",{className:"form-control input-sm",value:imageId||"",onChange:e=>this.valueChanged("imageId",e.target.value)}))))));const Registry=showRegistry?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Registry Name")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{value:account,disabled:imagesRefreshing,onChange:o=>this.valueChanged("account",o?o.value:""),options:accountOptions,isLoading:imagesRefreshing})),React.createElement("span",{className:"sp-formActions sp-formActions--web"},React.createElement("span",{className:"action"},React.createElement(core_1.Tooltip,{value:imagesRefreshing?"Images refreshing":"Refresh images list"},React.createElement("i",{className:`fa icon-button-refresh-arrows ${imagesRefreshing?"fa-spin":""}`,onClick:this.handleRefreshImages}))))))):null,Organization=React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Organization")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},organization.includes("${")?React.createElement("input",{disabled:imagesRefreshing,className:"form-control input-sm",value:organization||"",onChange:e=>this.valueChanged("organization",e.target.value)}):React.createElement(react_select_1.default,{value:organization||"",disabled:imagesRefreshing,onChange:o=>this.valueChanged("organization",o&&o.value||""),placeholder:"No organization",options:organizationOptions,isLoading:imagesRefreshing}))))),Image=React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Image")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},repository.includes("${")?React.createElement("input",{className:"form-control input-sm",disabled:imagesRefreshing,value:repository||"",onChange:e=>this.valueChanged("repository",e.target.value)}):React.createElement(react_select_1.default,{value:repository||"",disabled:imagesRefreshing,onChange:o=>this.valueChanged("repository",o&&o.value||""),options:repositoryOptions,required:!0,isLoading:imagesRefreshing}))))),Tag="tag"===lookupType?specifyTagByRegex?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Tag ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.tag"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement("input",{type:"text",className:"form-control input-sm",value:tag||"",disabled:imagesRefreshing||!repository,onChange:e=>this.valueChanged("tag",e.target.value)}))))):React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Tag")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},tag&&tag.includes("${")?React.createElement("input",{className:"form-control input-sm",disabled:imagesRefreshing,value:tag||"",onChange:e=>this.valueChanged("tag",e.target.value),required:!0}):React.createElement(react_select_1.default,{value:tag||"",disabled:imagesRefreshing||!repository,isLoading:imagesLoading,onChange:o=>this.valueChanged("tag",o?o.value:void 0),options:tagOptions,placeholder:"No tag",required:!0}))))):null,Digest="digest"===lookupType?React.createElement("div",{className:"form-group"},React.createElement("div",{className:`sm-label-right ${labelClass}`},"Digest ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.digest"})),React.createElement("div",{className:fieldClass},React.createElement("input",{className:"form-control input-sm",placeholder:"sha256:abc123",value:digest||"",onChange:e=>this.valueChanged("digest",e.target.value),required:!0}))):null,LookupTypeSelector=showDigest?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Type")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{clearable:!1,value:lookupType,options:[{value:"digest",label:"Digest"},{value:"tag",label:"Tag"}],onChange:this.lookupTypeChanged}))))):null;return React.createElement("div",{className:"sp-formGroup"},manualInputToggle,Registry,Organization,Image,LookupTypeSelector,Digest,Tag)}}DockerImageAndTagSelector.defaultProps={fieldClass:"col-md-8",labelClass:"col-md-3",organization:"",registry:"",repository:"",showDigest:!0},exports.DockerImageAndTagSelector=DockerImageAndTagSelector},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(0);exports.DockerImageReader=class{static getImage(imageName,region,credentials){return core_1.API.all("images").one(credentials).one(region).one(imageName).withParams({provider:"docker"}).get().then(results=>results&&results.length?results[0]:null).catch(()=>null)}static findImages(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/find").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}static findTags(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/tags").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}}},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(8)),__export(__webpack_require__(7)),__export(__webpack_require__(5))},function(module,exports){module.exports=require("@uirouter/angularjs")},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(0);const angular=__webpack_require__(1);module.exports=angular.module("spinnaker.docker.pipeline.stage.bake.executionDetails.controller",[__webpack_require__(10).default]).controller("dockerBakeExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService","$interpolate",function($scope,$stateParams,executionDetailsSectionService,$interpolate){$scope.configSections=["bakeConfig","taskStatus"];let initialized=()=>{$scope.detailsSection=$stateParams.details,$scope.provider=$scope.stage.context.cloudProviderType||"docker",$scope.bakeryDetailUrl=$interpolate(_core.SETTINGS.bakeryDetailUrl)},initialize=()=>executionDetailsSectionService.synchronizeSection($scope.configSections,initialized);initialize(),$scope.$on("$stateChangeSuccess",initialize)}])},function(module,exports,__webpack_require__){"use strict";var obj,_lodash=__webpack_require__(6),_lodash2=(obj=_lodash)&&obj.__esModule?obj:{default:obj},_core=__webpack_require__(0);const angular=__webpack_require__(1);module.exports=angular.module("spinnaker.docker.pipeline.stage.bakeStage",[__webpack_require__(11).name]).config(function(){_core.Registry.pipeline.registerStage({provides:"bake",cloudProvider:"docker",label:"Bake",description:"Bakes an image",templateUrl:__webpack_require__(3),executionDetailsUrl:__webpack_require__(4),executionLabelComponent:_core.BakeExecutionLabel,extraLabelLines:stage=>stage.masterStage.context.allPreviouslyBaked||stage.masterStage.context.somePreviouslyBaked?1:0,defaultTimeoutMs:36e5,validators:[{type:"requiredField",fieldName:"package"}],restartable:!0})}).controller("dockerBakeStageCtrl",["$scope","$q",function($scope,$q){$scope.stage.region="global",$scope.stage.user||($scope.stage.user=_core.AuthenticationService.getAuthenticatedUser().name),$scope.viewState={loading:!0},$scope.$watch("stage",function(){_lodash2.default.forOwn($scope.stage,function(val,key){""===val&&delete $scope.stage[key]})},!0),$scope.viewState.providerSelected=!0,$q.all({baseOsOptions:_core.BakeryReader.getBaseOsOptions("docker"),baseLabelOptions:_core.BakeryReader.getBaseLabelOptions()}).then(function(results){$scope.baseOsOptions=results.baseOsOptions.baseImages,$scope.baseLabelOptions=results.baseLabelOptions,!$scope.stage.baseOs&&$scope.baseOsOptions&&$scope.baseOsOptions.length&&($scope.stage.baseOs=$scope.baseOsOptions[0].id),!$scope.stage.baseLabel&&$scope.baseLabelOptions&&$scope.baseLabelOptions.length&&($scope.stage.baseLabel=$scope.baseLabelOptions[0]),$scope.viewState.loading=!1})}])},function(module,exports,__webpack_require__){var map={"./pipeline/stages/bake/bakeExecutionDetails.html":4,"./pipeline/stages/bake/bakeStage.html":3};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){var id=map[req];if(!(id+1)){var e=new Error('Cannot find module "'+req+'".');throw e.code="MODULE_NOT_FOUND",e}return id}webpackContext.keys=function(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id=13},function(module,exports,__webpack_require__){"use strict";var __rest=this&&this.__rest||function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&(t[p[i]]=s[p[i]])}return t};Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),core_1=__webpack_require__(0),DockerImageAndTagSelector_1=__webpack_require__(7);exports.DockerTriggerConfig=class extends React.Component{constructor(){super(...arguments),this.state={fiatEnabled:core_1.SETTINGS.feature.fiatEnabled,serviceAccounts:[]},this.dockerChanged=(changes=>{const{imageId:imageId}=changes,rest=__rest(changes,["imageId"]);Object.assign(this.props.trigger,rest),this.props.fieldUpdated(),this.setState({})}),this.runAsUserChanged=(user=>{this.props.trigger.runAsUser=""!==user?user:null,this.props.fieldUpdated(),this.setState({})})}componentDidMount(){core_1.ServiceAccountReader.getServiceAccounts().then(serviceAccounts=>{this.setState({serviceAccounts:serviceAccounts})})}render(){const{trigger:trigger}=this.props,{fiatEnabled:fiatEnabled,serviceAccounts:serviceAccounts}=this.state;return React.createElement("div",{className:"form-horizontal"},React.createElement(DockerImageAndTagSelector_1.DockerImageAndTagSelector,{specifyTagByRegex:!0,account:trigger.account,organization:trigger.organization,registry:trigger.registry,repository:trigger.repository,tag:trigger.tag,showRegistry:!0,onChange:this.dockerChanged,showDigest:!1}),fiatEnabled&&React.createElement("div",{className:"form-group"},React.createElement(core_1.RunAsUser,{serviceAccounts:serviceAccounts,value:trigger.runAsUser,onChange:this.runAsUserChanged,selectClasses:"",selectColumns:8})))}}},function(module,exports){module.exports=require("rxjs")},function(module,exports){module.exports=require("ngimport")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),ngimport_1=__webpack_require__(16),rxjs_1=__webpack_require__(15),core_1=__webpack_require__(0),image_1=__webpack_require__(9),lookupTypeOptions=[{value:"digest",label:"Digest"},{value:"tag",label:"Tag"}];exports.DockerTriggerTemplate=class extends React.Component{constructor(props){super(props),this.queryStream=new rxjs_1.Subject,this.handleQuery=(()=>{const trigger=this.props.command.trigger;return rxjs_1.Observable.fromPromise(image_1.DockerImageReader.findTags({provider:"dockerRegistry",account:trigger.account,repository:trigger.repository}))}),this.lookupTypeChanged=(o=>{const newType=o.value;this.props.command.extraFields.tag="tag"===newType?this.state.selectedTag:this.state.digest,this.setState({lookupType:newType})}),this.updateSelectedTag=(tag=>{this.updateArtifact(this.props.command,tag),this.setState({selectedTag:tag}),this.props.command.triggerInvalid=!1}),this.updateDigest=(digest=>{this.updateArtifact(this.props.command,digest),this.setState({digest:digest})}),this.tagLoadSuccess=(tags=>{const{command:command}=this.props,trigger=command.trigger,newState={};if(newState.tags=tags,newState.tags.length){const defaultSelection=newState.tags.find(t=>t===trigger.tag)||newState.tags[0];newState.selectedTag=defaultSelection,this.updateSelectedTag(defaultSelection)}newState.tagsLoading=!1,this.setState(newState)}),this.tagLoadFailure=(()=>{this.setState({tagsLoading:!1,loadError:!0})}),this.initialize=(()=>{const{command:command}=this.props;command.triggerInvalid=!0,this.subscription=this.queryStream.debounceTime(250).switchMap(this.handleQuery).subscribe(this.tagLoadSuccess,this.tagLoadFailure),command.extraFields={},"docker"===command.trigger.type?this.searchTags():this.subscription.unsubscribe()}),this.searchTags=((query="")=>{this.setState({tags:[`<span>Finding tags${query&&` matching ${query}`}...</span>`]}),this.queryStream.next()}),this.state={digest:"",tags:[],tagsLoading:!0,loadError:!1,lookupType:"tag",selectedTag:""}}static formatLabel(trigger){return ngimport_1.$q.when(`(Docker Registry) ${trigger.account?trigger.account+":":""} ${trigger.repository||""}`)}updateArtifact(command,tag){command.extraFields.tag=tag;const trigger=command.trigger;if(trigger&&trigger.repository){let imageName="";trigger.registry&&(imageName+=trigger.registry+"/"),imageName+=trigger.repository,command.extraFields.artifacts=[{type:"docker/image",name:imageName,version:tag,reference:imageName+":"+tag}]}}componentWillReceiveProps(nextProps){nextProps.command!==this.props.command&&this.initialize()}componentDidMount(){this.initialize()}render(){const{digest:digest,tags:tags,tagsLoading:tagsLoading,loadError:loadError,selectedTag:selectedTag,lookupType:lookupType}=this.state,options=tags.map(tag=>({value:tag}));return React.createElement(React.Fragment,null,React.createElement("div",{className:"form-group"},React.createElement("div",{className:"sm-label-right col-md-4"},"Type"),React.createElement("div",{className:"col-md-3"},React.createElement(core_1.TetheredSelect,{clearable:!1,value:lookupType,options:lookupTypeOptions,onChange:this.lookupTypeChanged}))),"tag"===lookupType&&React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Tag"),tagsLoading&&React.createElement("div",{className:"col-md-6"},React.createElement("div",{className:"form-control-static text-center"},React.createElement(core_1.Spinner,{size:"small"}))),loadError&&React.createElement("div",{className:"col-md-6"},"Error loading tags!"),!tagsLoading&&React.createElement("div",{className:"col-md-6"},0===tags.length&&React.createElement("div",null,React.createElement("p",{className:"form-control-static"},"No tags found")),tags.length>0&&React.createElement(core_1.TetheredSelect,{options:options,optionRenderer:o=>React.createElement("span",null,o.value),clearable:!1,value:selectedTag,valueRenderer:o=>React.createElement("span",null,React.createElement("strong",null,o.value)),onChange:o=>this.updateSelectedTag(o.value)}))),"digest"===lookupType&&React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Digest ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.digest"})),React.createElement("div",{className:"col-md-6"},React.createElement("input",{value:digest,onChange:e=>this.updateDigest(e.target.value),className:"form-control input-sm",required:!0}))))}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(0),DockerTriggerTemplate_1=__webpack_require__(17),DockerTriggerConfig_1=__webpack_require__(14);core_1.Registry.pipeline.registerTrigger({label:"Docker Registry",description:"Executes the pipeline on an image update",key:"docker",component:DockerTriggerConfig_1.DockerTriggerConfig,manualExecutionComponent:DockerTriggerTemplate_1.DockerTriggerTemplate,validators:[{type:"requiredField",fieldName:"account",message:"<strong>Registry</strong> is a required field for Docker Registry triggers."},{type:"requiredField",fieldName:"repository",message:"<strong>Image</strong> is a required field for Docker Registry triggers."},{type:"serviceAccountAccess",preventSave:!0,message:"You do not have access to the service account configured in this pipeline's Docker Registry trigger.\n You will not be able to save your edits to this pipeline."}]})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(1);__webpack_require__(18);const templates=__webpack_require__(13);templates.keys().forEach(function(key){templates(key)}),exports.DOCKER_MODULE="spinnaker.docker",angular_1.module(exports.DOCKER_MODULE,[__webpack_require__(12).name])},function(module,exports){module.exports=require("react-select")},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(9)),__export(__webpack_require__(19))}])});
!function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory(require("@spinnaker/core")):"function"==typeof define&&define.amd?define("@spinnaker/docker",["@spinnaker/core"],factory):"object"==typeof exports?exports["@spinnaker/docker"]=factory(require("@spinnaker/core")):root["@spinnaker/docker"]=factory(root["@spinnaker/core"])}(window,function(__WEBPACK_EXTERNAL_MODULE__0__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=21)}([function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,exports){module.exports=require("angular")},function(module,exports){module.exports=require("react")},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeStage.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeStageCtrl as bakeStageCtrl">\n <stage-config-field label="Package" help-key="pipeline.config.bake.package">\n <input type="text" class="form-control input-sm"\n ng-model="stage.package"/>\n </stage-config-field>\n <stage-config-field label="Organization" help-key="pipeline.config.docker.bake.organization">\n <input type="text" class="form-control input-sm"\n ng-model="stage.organization"/>\n </stage-config-field>\n <stage-config-field label="Image Name" help-key="pipeline.config.docker.bake.targetImage">\n <input type="text" class="form-control input-sm"\n ng-model="stage.ami_name"/>\n </stage-config-field>\n <stage-config-field label="Image tag" help-key="pipeline.config.docker.bake.targetImageTag">\n <input type="text" class="form-control input-sm"\n ng-model="stage.extendedAttributes[\'docker_target_image_tag\']"/>\n </stage-config-field>\n <stage-config-field label="Base OS">\n <bake-stage-choose-os model="stage.baseOs" base-os-options="baseOsOptions"></bake-stage-choose-os>\n </stage-config-field>\n\n <stage-config-field label="Base Label">\n <label class="radio-inline" ng-repeat="baseLabel in baseLabelOptions">\n <input type="radio"\n ng-model="stage.baseLabel"\n ng-value="baseLabel"/>\n {{baseLabel}}\n </label>\n </stage-config-field>\n <stage-config-field label="Rebake">\n <div class="checkbox" style="margin-bottom: 0">\n <label>\n <input type="checkbox"\n ng-model="stage.rebake">\n </input>\n Rebake image without regard to the status of any existing bake\n </label>\n </div>\n </stage-config-field>\n</div>\n')}]),module.exports=path},function(module,exports){var path="docker/src/pipeline/stages/bake/bakeExecutionDetails.html";window.angular.module("ng").run(["$templateCache",function(c){c.put(path,'<div ng-controller="dockerBakeExecutionDetailsCtrl">\n <execution-details-section-nav sections="configSections"></execution-details-section-nav>\n <div class="step-section-details" ng-if="detailsSection === \'bakeConfig\'">\n <div class="row">\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt if-multiple-providers>Provider</dt>\n <dd if-multiple-providers>Docker</dd>\n <dt>Organization</dt>\n <dd>{{stage.context.organization}}</dd>\n <dt>Image Name</dt>\n <dd>{{stage.context.ami_name}}</dd>\n <dt>Image Tag</dt>\n <dd>{{stage.context.extendedAttributes[\'docker_target_image_tag\']}}</dd>\n <dt>Image</dt>\n <dd>{{stage.context.ami}}</dd>\n </dl>\n </div>\n <div class="col-md-6">\n <dl class="dl-narrow dl-horizontal">\n <dt>Base OS</dt>\n <dd>{{stage.context.baseOs}}</dd>\n <dt>Region</dt>\n <dd>{{stage.context.region}}</dd>\n <dt>Package</dt>\n <dd>{{stage.context.package}}</dd>\n <dt>Label</dt>\n <dd>{{stage.context.baseLabel}}</dd>\n </dl>\n </div>\n </div>\n <stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>\n\n <div class="row" ng-if="stage.context.region && stage.context.status.resourceId">\n <div class="col-md-12">\n <div class="alert alert-{{stage.isFailed ? \'danger\' : \'info\'}}">\n <a target="_blank" href="{{ bakeryDetailUrl(stage) }}">\n View Bakery Details\n </a>\n </div>\n </div>\n </div>\n\n </div>\n <div class="step-section-details" ng-if="detailsSection === \'taskStatus\'">\n <div class="row">\n <execution-step-details item="stage"></execution-step-details>\n </div>\n </div>\n</div>\n')}]),module.exports=path},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DockerImageUtils=class{static splitImageId(imageId){const parts=imageId.split("/"),organization=parts.length>1?parts.shift():"",rest=parts.shift().split(":"),repository=organization.length>0?`${organization}/${rest.shift()}`:rest.shift(),lookup=rest.shift();let tag,digest;return lookup&&(lookup.startsWith("sha256:")?digest=lookup:tag=lookup),{organization:organization,repository:repository,digest:digest,tag:tag}}static generateImageId(parts){if(parts.repository&&(parts.digest||parts.tag))return`${parts.repository}:${parts.digest?parts.digest:parts.tag}`}}},function(module,exports){module.exports=require("lodash")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),react_select_1=__webpack_require__(20),lodash_1=__webpack_require__(6),core_1=__webpack_require__(0),DockerImageReader_1=__webpack_require__(8),DockerImageUtils_1=__webpack_require__(5),imageFields=["organization","repository","tag","digest"],defineOptions=[{label:"Manually",value:!0},{label:"Select from list",value:!1}];class DockerImageAndTagSelector extends React.Component{constructor(props){super(props),this.cachedValues={},this.handleRefreshImages=(()=>{this.refreshImages(this.props)}),this.lookupTypeChanged=(o=>{const newType=o.value,oldType=this.state.lookupType,oldValue=this.props[oldType],cachedValue=this.cachedValues[newType];this.valueChanged(oldType,void 0),this.cachedValues[newType]&&this.valueChanged(newType,cachedValue),this.setState({lookupType:newType}),this.cachedValues[oldType]=oldValue}),this.showManualInput=(defineManually=>{if(!defineManually){const newFields=DockerImageUtils_1.DockerImageUtils.splitImageId(this.props.imageId||"");this.props.onChange(newFields),this.state.switchedManualWarning&&this.setState({switchedManualWarning:void 0})}this.setState({defineManually:defineManually})});const accountOptions=props.account?[{label:props.account,value:props.account}]:[],organizationOptions=props.organization&&props.organization.length?[{label:props.organization,value:props.organization}]:[],repositoryOptions=props.repository&&props.repository.length?[{label:props.repository,value:props.repository}]:[],tagOptions=props.tag&&props.tag.length?[{label:props.tag,value:props.tag}]:[],defineManually=Boolean(props.imageId&&props.imageId.includes("${"));this.state={accountOptions:accountOptions,switchedManualWarning:void 0,imagesLoaded:!1,imagesLoading:!1,organizationOptions:organizationOptions,repositoryOptions:repositoryOptions,defineManually:defineManually,tagOptions:tagOptions,lookupType:props.digest?"digest":"tag"}}getAccountMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.account),"account");return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>`${i.repository.split("/").slice(0,-1).join("/")}`)),acc),{})}getRegistryMap(images){return images.reduce((m,image)=>(m[image.account]=image.registry,m),{})}getOrganizationMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.repository),image=>`${image.account}/${image.repository.split("/").slice(0,-1).join("/")}`);return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>i.repository)),acc),{})}getRepositoryMap(images){const groupedImages=lodash_1.groupBy(images.filter(image=>image.account),"repository");return lodash_1.reduce(groupedImages,(acc,image,key)=>(acc[key]=lodash_1.uniq(image.map(i=>i.tag)),acc),{})}getOrganizationsList(accountMap){return accountMap&&accountMap[this.props.showRegistry?this.props.account:this.props.registry]||[]}getRepositoryList(organizationMap,organization,registry){if(organizationMap){return organizationMap[`${this.props.showRegistry?this.props.account:registry}/${organization||""}`]||[]}return[]}getTags(tag,repositoryMap,repository){let tags=[];return this.props.specifyTagByRegex?tag&&""===lodash_1.trim(tag)&&(tag=void 0):repositoryMap&&((tags=repositoryMap[repository]||[]).includes(tag)||!tag||tag.includes("${")||(tag=void 0)),{tag:tag,tags:tags}}componentWillReceiveProps(nextProps){!this.images||["account","showRegistry"].some(key=>this.props[key]!==nextProps[key])?this.refreshImages(nextProps):["organization","registry","repository"].some(key=>this.props[key]!==nextProps[key])&&this.updateThings(nextProps),nextProps.imageId&&nextProps.imageId.includes("${")&&this.setState({defineManually:!0})}synchronizeChanges(values,registry){const{organization:organization,repository:repository,tag:tag,digest:digest}=values;if(this.props.onChange){const imageId=DockerImageUtils_1.DockerImageUtils.generateImageId({organization:organization,repository:repository,tag:tag,digest:digest}),changes={};tag!==this.props.tag&&(changes.tag=tag),imageId!==this.props.imageId&&(changes.imageId=imageId),organization!==this.props.organization&&(changes.organization=organization),registry!==this.props.registry&&(changes.registry=registry),repository!==this.props.repository&&(changes.repository=repository),digest!==this.props.digest&&(changes.digest=digest),Object.keys(changes).length>0&&this.props.onChange(changes)}}updateThings(props){let{imageId:imageId,organization:organization,registry:registry,repository:repository}=props;props.showRegistry&&(registry=this.registryMap[props.account]);const organizationFound=!organization||this.organizations.includes(organization)||organization.includes("${");organizationFound||(organization="");const repositories=this.getRepositoryList(this.organizationMap,organization,registry),repositoryFound=!repository||repository.includes("${")||repositories.includes(repository);repositoryFound||(repository="");const{tag:tag,tags:tags}=this.getTags(props.tag,this.repositoryMap,repository),tagFound=tag!==props.tag,newState={accountOptions:this.newAccounts.sort().map(a=>({label:a,value:a})),organizationOptions:this.organizations.filter(o=>o).sort().map(o=>({label:o,value:o})),imagesLoaded:!0,repositoryOptions:repositories.sort().map(r=>({label:r,value:r})),tagOptions:tags.sort().map(t=>({label:t,value:t}))};if(!imageId||this.state.imagesLoaded||organizationFound&&repositoryFound&&tagFound)imageId&&imageId.includes("${")||this.synchronizeChanges({organization:organization,repository:repository,tag:tag,digest:this.props.digest},registry);else{newState.defineManually=!0;const missingFields=[];organizationFound||missingFields.push("organization"),repositoryFound||missingFields.push("image"),tagFound||missingFields.push("tag"),newState.switchedManualWarning=`Could not find ${missingFields.join(" or ")}, switched to manual entry`}this.setState(newState)}initializeImages(props){if(this.state.imagesLoading)return;const{showRegistry:showRegistry,account:account,registry:registry}=props,imageConfig={provider:"dockerRegistry",account:showRegistry?account:registry};this.setState({imagesLoading:!0}),DockerImageReader_1.DockerImageReader.findImages(imageConfig).then(images=>{this.images=images,this.registryMap=this.getRegistryMap(this.images),this.accountMap=this.getAccountMap(this.images),this.newAccounts=this.accounts||Object.keys(this.accountMap),this.organizationMap=this.getOrganizationMap(this.images),this.repositoryMap=this.getRepositoryMap(this.images),this.organizations=this.getOrganizationsList(this.accountMap),this.updateThings(props)}).finally(()=>{this.setState({imagesLoading:!1})})}refreshImages(props){this.initializeImages(props)}initializeAccounts(props){let{account:account}=props;core_1.AccountService.listAccounts("dockerRegistry").then(allAccounts=>{const accounts=allAccounts.map(a=>a.name);this.props.showRegistry&&!account&&(account=accounts[0]),this.accounts=accounts,this.refreshImages(Object.assign({},props,{account:account}))})}isNew(){const{account:account,organization:organization,registry:registry,repository:repository,tag:tag}=this.props;return!(account||organization||registry||repository||tag)}componentDidMount(){this.props.deferInitialization||!this.props.registry&&!this.isNew()||this.initializeAccounts(this.props)}valueChanged(name,value){const changes={[name]:value};if(imageFields.some(n=>n===name)){const{organization:organization,repository:repository,tag:tag,digest:digest}=this.props,imageParts=Object.assign({organization:organization,repository:repository,tag:tag,digest:digest},changes),imageId=DockerImageUtils_1.DockerImageUtils.generateImageId(imageParts);changes.imageId=imageId}this.props.onChange&&this.props.onChange(changes)}render(){const{account:account,digest:digest,fieldClass:fieldClass,imageId:imageId,labelClass:labelClass,organization:organization,repository:repository,showDigest:showDigest,showRegistry:showRegistry,specifyTagByRegex:specifyTagByRegex,tag:tag}=this.props,{accountOptions:accountOptions,switchedManualWarning:switchedManualWarning,imagesLoading:imagesLoading,lookupType:lookupType,organizationOptions:organizationOptions,repositoryOptions:repositoryOptions,defineManually:defineManually,tagOptions:tagOptions}=this.state,manualInputToggle=React.createElement("div",{className:"sp-formItem groupHeader"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Define Image ID"),React.createElement("div",{className:"sp-formActions sp-formActions--mobile"},React.createElement("span",{className:"action"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{value:defineManually,disabled:imagesLoading,onChange:o=>this.showManualInput(o.value),options:defineOptions,clearable:!1}))))),warning=switchedManualWarning?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"}),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"messageContainer warningMessage"},React.createElement("i",{className:"fa icon-alert-triangle"}),React.createElement("div",{className:"message"},switchedManualWarning)))):null;if(defineManually)return React.createElement("div",{className:"sp-formGroup"},manualInputToggle,React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Image ID"),React.createElement("div",{className:"sp-formActions sp-formActions--mobile"},React.createElement("span",{className:"action"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement("input",{className:"form-control input-sm",value:imageId||"",onChange:e=>this.valueChanged("imageId",e.target.value)}))))),warning);const Registry=showRegistry?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Registry Name")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{value:account,disabled:imagesLoading,onChange:o=>this.valueChanged("account",o?o.value:""),options:accountOptions,isLoading:imagesLoading})),React.createElement("span",{className:"sp-formActions sp-formActions--web"},React.createElement("span",{className:"action"},React.createElement(core_1.Tooltip,{value:imagesLoading?"Images refreshing":"Refresh images list"},React.createElement("i",{className:`fa icon-button-refresh-arrows ${imagesLoading?"fa-spin":""}`,onClick:this.handleRefreshImages}))))))):null,Organization=React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Organization")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},organization.includes("${")?React.createElement("input",{disabled:imagesLoading,className:"form-control input-sm",value:organization||"",onChange:e=>this.valueChanged("organization",e.target.value)}):React.createElement(react_select_1.default,{value:organization||"",disabled:imagesLoading,onChange:o=>this.valueChanged("organization",o&&o.value||""),placeholder:"No organization",options:organizationOptions,isLoading:imagesLoading}))))),Image=React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Image")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},repository.includes("${")?React.createElement("input",{className:"form-control input-sm",disabled:imagesLoading,value:repository||"",onChange:e=>this.valueChanged("repository",e.target.value)}):React.createElement(react_select_1.default,{value:repository||"",disabled:imagesLoading,onChange:o=>this.valueChanged("repository",o&&o.value||""),options:repositoryOptions,required:!0,isLoading:imagesLoading}))))),Tag="tag"===lookupType?specifyTagByRegex?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Tag ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.tag"}))),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement("input",{type:"text",className:"form-control input-sm",value:tag||"",disabled:imagesLoading||!repository,onChange:e=>this.valueChanged("tag",e.target.value)}))))):React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Tag")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},tag&&tag.includes("${")?React.createElement("input",{className:"form-control input-sm",disabled:imagesLoading,value:tag||"",onChange:e=>this.valueChanged("tag",e.target.value),required:!0}):React.createElement(react_select_1.default,{value:tag||"",disabled:imagesLoading||!repository,isLoading:imagesLoading,onChange:o=>this.valueChanged("tag",o?o.value:void 0),options:tagOptions,placeholder:"No tag",required:!0}))))):null,Digest="digest"===lookupType?React.createElement("div",{className:"form-group"},React.createElement("div",{className:`sm-label-right ${labelClass}`},"Digest ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.digest"})),React.createElement("div",{className:fieldClass},React.createElement("input",{className:"form-control input-sm",placeholder:"sha256:abc123",value:digest||"",onChange:e=>this.valueChanged("digest",e.target.value),required:!0}))):null,LookupTypeSelector=showDigest?React.createElement("div",{className:"sp-formItem"},React.createElement("div",{className:"sp-formItem__left"},React.createElement("div",{className:"sp-formLabel"},"Type")),React.createElement("div",{className:"sp-formItem__right"},React.createElement("div",{className:"sp-form"},React.createElement("span",{className:"field"},React.createElement(react_select_1.default,{clearable:!1,value:lookupType,options:[{value:"digest",label:"Digest"},{value:"tag",label:"Tag"}],onChange:this.lookupTypeChanged}))))):null;return React.createElement("div",{className:"sp-formGroup"},manualInputToggle,Registry,Organization,Image,LookupTypeSelector,Digest,Tag)}}DockerImageAndTagSelector.defaultProps={fieldClass:"col-md-8",labelClass:"col-md-3",organization:"",registry:"",repository:"",showDigest:!0},exports.DockerImageAndTagSelector=DockerImageAndTagSelector},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(0);exports.DockerImageReader=class{static getImage(imageName,region,credentials){return core_1.API.all("images").one(credentials).one(region).one(imageName).withParams({provider:"docker"}).get().then(results=>results&&results.length?results[0]:null).catch(()=>null)}static findImages(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/find").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}static findTags(params){return core_1.RetryService.buildRetrySequence(()=>core_1.API.all("images/tags").getList(params),results=>results.length>0,10,1e3).then(results=>results).catch(()=>[])}}},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(8)),__export(__webpack_require__(7)),__export(__webpack_require__(5))},function(module,exports){module.exports=require("@uirouter/angularjs")},function(module,exports,__webpack_require__){"use strict";var _core=__webpack_require__(0);const angular=__webpack_require__(1);module.exports=angular.module("spinnaker.docker.pipeline.stage.bake.executionDetails.controller",[__webpack_require__(10).default]).controller("dockerBakeExecutionDetailsCtrl",["$scope","$stateParams","executionDetailsSectionService","$interpolate",function($scope,$stateParams,executionDetailsSectionService,$interpolate){$scope.configSections=["bakeConfig","taskStatus"];let initialized=()=>{$scope.detailsSection=$stateParams.details,$scope.provider=$scope.stage.context.cloudProviderType||"docker",$scope.bakeryDetailUrl=$interpolate(_core.SETTINGS.bakeryDetailUrl)},initialize=()=>executionDetailsSectionService.synchronizeSection($scope.configSections,initialized);initialize(),$scope.$on("$stateChangeSuccess",initialize)}])},function(module,exports,__webpack_require__){"use strict";var obj,_lodash=__webpack_require__(6),_lodash2=(obj=_lodash)&&obj.__esModule?obj:{default:obj},_core=__webpack_require__(0);const angular=__webpack_require__(1);module.exports=angular.module("spinnaker.docker.pipeline.stage.bakeStage",[__webpack_require__(11).name]).config(function(){_core.Registry.pipeline.registerStage({provides:"bake",cloudProvider:"docker",label:"Bake",description:"Bakes an image",templateUrl:__webpack_require__(3),executionDetailsUrl:__webpack_require__(4),executionLabelComponent:_core.BakeExecutionLabel,extraLabelLines:stage=>stage.masterStage.context.allPreviouslyBaked||stage.masterStage.context.somePreviouslyBaked?1:0,defaultTimeoutMs:36e5,validators:[{type:"requiredField",fieldName:"package"}],restartable:!0})}).controller("dockerBakeStageCtrl",["$scope","$q",function($scope,$q){$scope.stage.region="global",$scope.stage.user||($scope.stage.user=_core.AuthenticationService.getAuthenticatedUser().name),$scope.viewState={loading:!0},$scope.$watch("stage",function(){_lodash2.default.forOwn($scope.stage,function(val,key){""===val&&delete $scope.stage[key]})},!0),$scope.viewState.providerSelected=!0,$q.all({baseOsOptions:_core.BakeryReader.getBaseOsOptions("docker"),baseLabelOptions:_core.BakeryReader.getBaseLabelOptions()}).then(function(results){$scope.baseOsOptions=results.baseOsOptions.baseImages,$scope.baseLabelOptions=results.baseLabelOptions,!$scope.stage.baseOs&&$scope.baseOsOptions&&$scope.baseOsOptions.length&&($scope.stage.baseOs=$scope.baseOsOptions[0].id),!$scope.stage.baseLabel&&$scope.baseLabelOptions&&$scope.baseLabelOptions.length&&($scope.stage.baseLabel=$scope.baseLabelOptions[0]),$scope.viewState.loading=!1})}])},function(module,exports,__webpack_require__){var map={"./pipeline/stages/bake/bakeExecutionDetails.html":4,"./pipeline/stages/bake/bakeStage.html":3};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){var id=map[req];if(!(id+1)){var e=new Error('Cannot find module "'+req+'".');throw e.code="MODULE_NOT_FOUND",e}return id}webpackContext.keys=function(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id=13},function(module,exports,__webpack_require__){"use strict";var __rest=this&&this.__rest||function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&(t[p[i]]=s[p[i]])}return t};Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),core_1=__webpack_require__(0),DockerImageAndTagSelector_1=__webpack_require__(7);exports.DockerTriggerConfig=class extends React.Component{constructor(){super(...arguments),this.state={fiatEnabled:core_1.SETTINGS.feature.fiatEnabled,serviceAccounts:[]},this.dockerChanged=(changes=>{const{imageId:imageId}=changes,rest=__rest(changes,["imageId"]);Object.assign(this.props.trigger,rest),this.props.fieldUpdated(),this.setState({})}),this.runAsUserChanged=(user=>{this.props.trigger.runAsUser=""!==user?user:null,this.props.fieldUpdated(),this.setState({})})}componentDidMount(){core_1.ServiceAccountReader.getServiceAccounts().then(serviceAccounts=>{this.setState({serviceAccounts:serviceAccounts})})}render(){const{trigger:trigger}=this.props,{fiatEnabled:fiatEnabled,serviceAccounts:serviceAccounts}=this.state;return React.createElement("div",{className:"form-horizontal"},React.createElement(DockerImageAndTagSelector_1.DockerImageAndTagSelector,{specifyTagByRegex:!0,account:trigger.account,organization:trigger.organization,registry:trigger.registry,repository:trigger.repository,tag:trigger.tag,showRegistry:!0,onChange:this.dockerChanged,showDigest:!1}),fiatEnabled&&React.createElement("div",{className:"form-group"},React.createElement(core_1.RunAsUser,{serviceAccounts:serviceAccounts,value:trigger.runAsUser,onChange:this.runAsUserChanged,selectClasses:"",selectColumns:8})))}}},function(module,exports){module.exports=require("rxjs")},function(module,exports){module.exports=require("ngimport")},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const React=__webpack_require__(2),ngimport_1=__webpack_require__(16),rxjs_1=__webpack_require__(15),core_1=__webpack_require__(0),image_1=__webpack_require__(9),lookupTypeOptions=[{value:"digest",label:"Digest"},{value:"tag",label:"Tag"}];exports.DockerTriggerTemplate=class extends React.Component{constructor(props){super(props),this.queryStream=new rxjs_1.Subject,this.handleQuery=(()=>{const trigger=this.props.command.trigger;return rxjs_1.Observable.fromPromise(image_1.DockerImageReader.findTags({provider:"dockerRegistry",account:trigger.account,repository:trigger.repository}))}),this.lookupTypeChanged=(o=>{const newType=o.value;this.props.command.extraFields.tag="tag"===newType?this.state.selectedTag:this.state.digest,this.setState({lookupType:newType})}),this.updateSelectedTag=(tag=>{this.updateArtifact(this.props.command,tag),this.setState({selectedTag:tag}),this.props.command.triggerInvalid=!1}),this.updateDigest=(digest=>{this.updateArtifact(this.props.command,digest),this.setState({digest:digest})}),this.tagLoadSuccess=(tags=>{const{command:command}=this.props,trigger=command.trigger,newState={};if(newState.tags=tags,newState.tags.length){const defaultSelection=newState.tags.find(t=>t===trigger.tag)||newState.tags[0];newState.selectedTag=defaultSelection,this.updateSelectedTag(defaultSelection)}newState.tagsLoading=!1,this.setState(newState)}),this.tagLoadFailure=(()=>{this.setState({tagsLoading:!1,loadError:!0})}),this.initialize=(()=>{const{command:command}=this.props;command.triggerInvalid=!0,this.subscription=this.queryStream.debounceTime(250).switchMap(this.handleQuery).subscribe(this.tagLoadSuccess,this.tagLoadFailure),command.extraFields={},"docker"===command.trigger.type?this.searchTags():this.subscription.unsubscribe()}),this.searchTags=((query="")=>{this.setState({tags:[`<span>Finding tags${query&&` matching ${query}`}...</span>`]}),this.queryStream.next()}),this.state={digest:"",tags:[],tagsLoading:!0,loadError:!1,lookupType:"tag",selectedTag:""}}static formatLabel(trigger){return ngimport_1.$q.when(`(Docker Registry) ${trigger.account?trigger.account+":":""} ${trigger.repository||""}`)}updateArtifact(command,tag){command.extraFields.tag=tag;const trigger=command.trigger;if(trigger&&trigger.repository){let imageName="";trigger.registry&&(imageName+=trigger.registry+"/"),imageName+=trigger.repository,command.extraFields.artifacts=[{type:"docker/image",name:imageName,version:tag,reference:imageName+":"+tag}]}}componentWillReceiveProps(nextProps){nextProps.command!==this.props.command&&this.initialize()}componentDidMount(){this.initialize()}render(){const{digest:digest,tags:tags,tagsLoading:tagsLoading,loadError:loadError,selectedTag:selectedTag,lookupType:lookupType}=this.state,options=tags.map(tag=>({value:tag}));return React.createElement(React.Fragment,null,React.createElement("div",{className:"form-group"},React.createElement("div",{className:"sm-label-right col-md-4"},"Type"),React.createElement("div",{className:"col-md-3"},React.createElement(core_1.TetheredSelect,{clearable:!1,value:lookupType,options:lookupTypeOptions,onChange:this.lookupTypeChanged}))),"tag"===lookupType&&React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Tag"),tagsLoading&&React.createElement("div",{className:"col-md-6"},React.createElement("div",{className:"form-control-static text-center"},React.createElement(core_1.Spinner,{size:"small"}))),loadError&&React.createElement("div",{className:"col-md-6"},"Error loading tags!"),!tagsLoading&&React.createElement("div",{className:"col-md-6"},0===tags.length&&React.createElement("div",null,React.createElement("p",{className:"form-control-static"},"No tags found")),tags.length>0&&React.createElement(core_1.TetheredSelect,{options:options,optionRenderer:o=>React.createElement("span",null,o.value),clearable:!1,value:selectedTag,valueRenderer:o=>React.createElement("span",null,React.createElement("strong",null,o.value)),onChange:o=>this.updateSelectedTag(o.value)}))),"digest"===lookupType&&React.createElement("div",{className:"form-group"},React.createElement("label",{className:"col-md-4 sm-label-right"},"Digest ",React.createElement(core_1.HelpField,{id:"pipeline.config.docker.trigger.digest"})),React.createElement("div",{className:"col-md-6"},React.createElement("input",{value:digest,onChange:e=>this.updateDigest(e.target.value),className:"form-control input-sm",required:!0}))))}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=__webpack_require__(0),DockerTriggerTemplate_1=__webpack_require__(17),DockerTriggerConfig_1=__webpack_require__(14);core_1.Registry.pipeline.registerTrigger({label:"Docker Registry",description:"Executes the pipeline on an image update",key:"docker",component:DockerTriggerConfig_1.DockerTriggerConfig,manualExecutionComponent:DockerTriggerTemplate_1.DockerTriggerTemplate,validators:[{type:"requiredField",fieldName:"account",message:"<strong>Registry</strong> is a required field for Docker Registry triggers."},{type:"requiredField",fieldName:"repository",message:"<strong>Image</strong> is a required field for Docker Registry triggers."},{type:"serviceAccountAccess",preventSave:!0,message:"You do not have access to the service account configured in this pipeline's Docker Registry trigger.\n You will not be able to save your edits to this pipeline."}]})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const angular_1=__webpack_require__(1);__webpack_require__(18);const templates=__webpack_require__(13);templates.keys().forEach(function(key){templates(key)}),exports.DOCKER_MODULE="spinnaker.docker",angular_1.module(exports.DOCKER_MODULE,[__webpack_require__(12).name])},function(module,exports){module.exports=require("react-select")},function(module,exports,__webpack_require__){"use strict";function __export(m){for(var p in m)exports.hasOwnProperty(p)||(exports[p]=m[p])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(__webpack_require__(9)),__export(__webpack_require__(19))}])});
//# sourceMappingURL=lib.js.map
{
"name": "@spinnaker/docker",
"version": "0.0.28",
"version": "0.0.29",
"main": "lib/lib.js",

@@ -5,0 +5,0 @@ "typings": "lib/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc