File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @metlo/cli" ,
3
- "version" : " 0.0.12 " ,
3
+ "version" : " 0.0.13 " ,
4
4
"license" : " MIT" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -581,7 +581,7 @@ const resolveImageURL = (zone) => {
581
581
}
582
582
}
583
583
584
- export const gcpTrafficMirrorSetup = async ( ) => {
584
+ export const gcpTrafficMirrorSetup = async ( { force } ) => {
585
585
const id = uuidv4 ( )
586
586
const data = { }
587
587
try {
@@ -590,9 +590,11 @@ export const gcpTrafficMirrorSetup = async () => {
590
590
const conn = new GCP_CONN ( key , zone , project ) ;
591
591
data [ "zone" ] = zone
592
592
data [ "project" ] = project
593
-
594
- let [ packetMirrors ] = await conn . list_packet_mirroring ( )
595
- packetMirrors = packetMirrors . filter ( mirror => mirror . network . url == networkUrl )
593
+ let packetMirrors = [ ]
594
+ if ( ! force ) {
595
+ [ packetMirrors ] = await conn . list_packet_mirroring ( )
596
+ packetMirrors = packetMirrors . filter ( mirror => mirror . network . url == networkUrl )
597
+ }
596
598
597
599
if ( packetMirrors . length > 0 ) {
598
600
console . log ( chalk . blue ( "Updating the existing Packet Mirroring instance instead of creating new." ) )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ trafficMirrorAws.command("remove").action(awsTrafficMirrorRemove)
39
39
const trafficMirrorGcp = trafficMirror
40
40
. command ( "gcp" )
41
41
. description ( "Set up traffic mirroring for GCP" )
42
- trafficMirrorGcp . command ( "new" ) . action ( gcpTrafficMirrorSetup )
42
+ trafficMirrorGcp . command ( "new" ) . action ( gcpTrafficMirrorSetup ) . option ( "-f,--force" , "Force creation of new instance" )
43
43
trafficMirrorGcp . command ( "list" ) . action ( gcpTrafficMirrorList )
44
44
trafficMirrorGcp . command ( "remove" ) . action ( gcpTrafficMirrorDelete )
45
45
trafficMirrorGcp . command ( "cleanup" ) . action ( gcpTrafficMirrorCleanUp )
You can’t perform that action at this time.
0 commit comments