@@ -23,9 +23,10 @@ export default class DeployController {
2323 * @param {!angular.$resource } $resource
2424 * @param {!angular.$log } $log
2525 * @param {!ui.router.$state } $state
26+ * @param {!backendApi.NamespaceList } namespaces
2627 * @ngInject
2728 */
28- constructor ( $resource , $log , $state ) {
29+ constructor ( $resource , $log , $state , namespaces ) {
2930 /** @export {string} */
3031 this . name = '' ;
3132
@@ -45,11 +46,23 @@ export default class DeployController {
4546 /** @export {!Array<!backendApi.PortMapping>} */
4647 this . portMappings = [ this . newEmptyPortMapping_ ( this . protocols [ 0 ] ) ] ;
4748
49+ /**
50+ * List of available namespaces.
51+ * @export {!Array<string>}
52+ */
53+ this . namespaces = namespaces . namespaces ;
54+
55+ /**
56+ * Currently chosen namespace.
57+ * @export {(string|undefined)}
58+ */
59+ this . namespace = this . namespaces . length > 0 ? this . namespaces [ 0 ] : undefined ;
60+
4861 /** @export {boolean} */
4962 this . isExternal = false ;
5063
51- /** @private {!angular.Resource<!backendApi.AppDeployment> } */
52- this . resource_ = $resource ( '/api/deploy' ) ;
64+ /** @private {!angular.$resource } */
65+ this . resource_ = $resource ;
5366
5467 /** @private {!angular.$log} */
5568 this . log_ = $log ;
@@ -76,10 +89,14 @@ export default class DeployController {
7689 name : this . name ,
7790 portMappings : this . portMappings . filter ( this . isPortMappingEmpty_ ) ,
7891 replicas : this . replicas ,
92+ namespace : this . namespace ,
7993 } ;
8094
95+ /** @type {!angular.Resource<!backendApi.AppDeployment> } */
96+ let resource = this . resource_ ( '/api/deploy' ) ;
97+
8198 this . isDeployInProgress_ = true ;
82- this . resource_ . save (
99+ resource . save (
83100 deployAppConfig ,
84101 ( savedConfig ) => {
85102 this . isDeployInProgress_ = false ;
0 commit comments