File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed
interface/cli/commands/pipeline2 Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
apiVersion : v1
2
2
kind : pipeline
3
- name : new-pipeline
4
3
metadata :
4
+ name : new-pipeline
5
5
labels :
6
6
repo : ArikMaor/ping-server
7
+ appPort : 3000
7
8
spec :
8
9
triggers :
9
10
- type : scm
Original file line number Diff line number Diff line change @@ -31,17 +31,17 @@ const command = new Command({
31
31
throw new CFError ( 'Pipeline definitions file must be provided' ) ;
32
32
}
33
33
34
- if ( ! filename . name && ! name ) {
34
+ if ( ! _ . get ( filename , 'metadata .name' ) && ! name ) {
35
35
throw new CFError ( 'Name must be provided' ) ;
36
36
}
37
37
38
38
const data = argv . filename ;
39
39
if ( name ) {
40
- data . name = name ;
40
+ _ . set ( data , 'metadata .name' , name ) ;
41
41
}
42
42
43
43
await pipeline2 . createPipeline ( data ) ;
44
- console . log ( `Pipeline '${ data . name } ' created` ) ;
44
+ console . log ( `Pipeline '${ data . metadata . name } ' created` ) ;
45
45
} ,
46
46
} ) ;
47
47
Original file line number Diff line number Diff line change @@ -31,17 +31,17 @@ const command = new Command({
31
31
throw new CFError ( 'Pipeline definitions file must be provided' ) ;
32
32
}
33
33
34
- if ( ! filename . name && ! name ) {
34
+ if ( ! _ . get ( filename , 'metadata .name' ) && ! name ) {
35
35
throw new CFError ( 'Name must be provided' ) ;
36
36
}
37
37
38
38
const data = argv . filename ;
39
39
if ( name ) {
40
- data . name = name ;
40
+ _ . set ( data , 'metadata .name' , name ) ;
41
41
} ;
42
42
43
- await pipeline2 . replaceByName ( data . name , data ) ;
44
- console . log ( `Pipeline '${ data . name } ' updated` ) ;
43
+ await pipeline2 . replaceByName ( data . metadata . name , data ) ;
44
+ console . log ( `Pipeline '${ data . metadata . name } ' updated` ) ;
45
45
} ,
46
46
} ) ;
47
47
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ const Pipeline = require('../entities/Pipeline2');
5
5
6
6
const _extractFieldsForPipelineEntity = pipeline => ( {
7
7
id : pipeline . id ,
8
- name : pipeline . name ,
9
8
metadata : pipeline . metadata ,
10
9
spec : pipeline . spec ,
11
10
} ) ;
Original file line number Diff line number Diff line change 1
1
const yaml = require ( 'js-yaml' ) ;
2
-
2
+ const _ = require ( 'lodash' ) ;
3
3
class Entity {
4
4
// get all the information about the entity
5
5
getInfo ( ) {
@@ -30,7 +30,7 @@ class Entity {
30
30
extractValues ( columns ) {
31
31
const values = { } ;
32
32
columns . forEach ( ( key ) => {
33
- values [ key ] = this . info [ key ] ;
33
+ values [ key . replace ( / ^ . * \. / , '' ) ] = _ . get ( this . info , key ) ;
34
34
} ) ;
35
35
return values ;
36
36
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Pipeline2 extends Entity {
5
5
super ( ) ;
6
6
this . entityType = 'pipeline2' ;
7
7
this . info = data ;
8
- this . defaultColumns = [ 'id' , 'name' ] ;
8
+ this . defaultColumns = [ 'id' , 'metadata. name' ] ;
9
9
this . wideColumns = this . defaultColumns . concat ( [ ] ) ;
10
10
}
11
11
}
You can’t perform that action at this time.
0 commit comments