Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olasaadi99 committed Jan 13, 2024
1 parent 0b0797b commit 009d8cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/analyzer/parse_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var supportedOutputFormatsMap = map[string]bool{
// supportedAnalysisTypesMap is a map from analysis type to its list of supported output formats
var supportedAnalysisTypesMap = map[string][]string{
allEndpoints: {TEXTFormat, MDFormat, JSONFormat, DRAWIOFormat, ARCHDRAWIOFormat, DEBUGFormat},
allSubnets: {TEXTFormat, JSONFormat, DRAWIOFormat, ARCHDRAWIOFormat},
allSubnets: {TEXTFormat, MDFormat, JSONFormat, DRAWIOFormat, ARCHDRAWIOFormat},
singleSubnet: {TEXTFormat},
allEndpointsDiff: {TEXTFormat, MDFormat},
allSubnetsDiff: {TEXTFormat, MDFormat},
Expand Down
16 changes: 7 additions & 9 deletions pkg/vpcmodel/mdOutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ func (m *MDoutputFormatter) WriteOutput(c1, c2 *VPCConfig,
return nil, err
}
out = "# " + out
lines := []string{mdDefaultTitle, mdDefaultHeader}
var connLines []string
switch uc {
case AllEndpoints:
lines := []string{mdDefaultTitle, mdDefaultHeader}
connLines := m.getGroupedOutput(conn.GroupedConnectivity)
out += linesToOutput(connLines, lines)
connLines = m.getGroupedOutput(conn.GroupedConnectivity)
case AllSubnets:
lines := []string{mdDefaultTitle, mdDefaultHeader}
connLines := m.getGroupedOutput(subnetsConn.GroupedConnectivity)
out += linesToOutput(connLines, lines)
connLines = m.getGroupedOutput(subnetsConn.GroupedConnectivity)
case SubnetsDiff, EndpointsDiff:
var mdTitle, mdHeader string
if uc == EndpointsDiff {
Expand All @@ -56,12 +54,12 @@ func (m *MDoutputFormatter) WriteOutput(c1, c2 *VPCConfig,
mdTitle = mdSubnetsDiffTitle
mdHeader = mdSubnetsDiffHeader
}
lines := []string{mdTitle, mdHeader}
connLines := m.getGroupedDiffOutput(cfgsDiff)
out += linesToOutput(connLines, lines)
lines = []string{mdTitle, mdHeader}
connLines = m.getGroupedDiffOutput(cfgsDiff)
case SingleSubnet:
return nil, errors.New("DebugSubnet use case not supported for md format currently ")
}
out += linesToOutput(connLines, lines)

_, err = WriteToFile(out, outFile)
return &SingleAnalysisOutput{Output: out, VPC1Name: c1.VPC.Name(), VPC2Name: v2Name, format: MD}, err
Expand Down

0 comments on commit 009d8cb

Please sign in to comment.