@@ -102,11 +102,13 @@ export class StreamDeployComponent implements OnInit, OnDestroy {
102
102
( config : any , deploymentInfo : StreamDefinition ) => {
103
103
const properties = [ ] ;
104
104
const ignoreProperties = [ ] ;
105
+ const cleanValue = ( v ) => ( v && v . length > 1 && v . startsWith ( '"' ) && v . endsWith ( '"' ) )
106
+ ? v . substring ( 1 , v . length - 1 ) : v ;
105
107
106
108
// Deployer properties
107
109
Object . keys ( deploymentInfo . deploymentProperties ) . map ( app => {
108
110
Object . keys ( deploymentInfo . deploymentProperties [ app ] ) . forEach ( ( key : string ) => {
109
- const value = deploymentInfo . deploymentProperties [ app ] [ key ] ;
111
+ const value = cleanValue ( deploymentInfo . deploymentProperties [ app ] [ key ] ) ;
110
112
if ( key === StreamDeployService . version . keyEdit ) {
111
113
properties . push ( `version.${ app } =${ value } ` ) ;
112
114
} else if ( key . startsWith ( StreamDeployService . deployer . keyEdit ) ) {
@@ -129,6 +131,7 @@ export class StreamDeployComponent implements OnInit, OnDestroy {
129
131
const appType = node [ 'name' ] ;
130
132
if ( node [ 'options' ] ) {
131
133
node . options . forEach ( ( value , key ) => {
134
+ value = cleanValue ( value ) ;
132
135
let keyShort = key ;
133
136
if ( key . startsWith ( `${ appType } .` ) ) {
134
137
keyShort = key . substring ( `${ appType } .` . length , key . length ) ;
@@ -139,8 +142,9 @@ export class StreamDeployComponent implements OnInit, OnDestroy {
139
142
}
140
143
} ) ;
141
144
this . properties = properties ;
142
- if ( ! config . skipper ) {
143
- this . ignoreProperties = ignoreProperties ;
145
+ this . ignoreProperties = ignoreProperties ;
146
+ if ( config . skipper ) {
147
+ this . ignoreProperties = Object . assign ( [ ] , this . properties ) ;
144
148
}
145
149
config . streamDefinition = deploymentInfo ;
146
150
return config ;
@@ -189,6 +193,8 @@ export class StreamDeployComponent implements OnInit, OnDestroy {
189
193
runDeploy ( value : Array < string > ) {
190
194
this . update ( value ) ;
191
195
const propertiesMap = { } ;
196
+ const cleanValue = ( v ) => ( v && v . length > 1 && v . startsWith ( '"' ) && v . endsWith ( '"' ) )
197
+ ? v . substring ( 1 , v . length - 1 ) : v ;
192
198
value . forEach ( ( val ) => {
193
199
if ( this . ignoreProperties . indexOf ( val ) === - 1 ) {
194
200
const arr = val . split ( / = ( .* ) / ) ;
@@ -199,7 +205,7 @@ export class StreamDeployComponent implements OnInit, OnDestroy {
199
205
if ( arr [ 1 ] === `'******'` ) {
200
206
console . log ( `Sensitive property ${ arr [ 0 ] } is ignored` ) ;
201
207
} else {
202
- propertiesMap [ arr [ 0 ] ] = arr [ 1 ] ;
208
+ propertiesMap [ arr [ 0 ] ] = cleanValue ( arr [ 1 ] ) ;
203
209
}
204
210
}
205
211
}
0 commit comments