Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model service network #896

Merged
merged 54 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
31840ff
subtract 161.26.0.0/16 and 166.8.0.0/14 from PublicInternetAddressList
olasaadi99 Sep 29, 2024
36dc49d
model service network
olasaadi99 Sep 30, 2024
9255b7f
Merge branch 'main' into 401_service_network
olasaadi99 Oct 2, 2024
63aff7a
remove files
olasaadi99 Oct 7, 2024
4bf91aa
fix sgwList, use one pointer
olasaadi99 Oct 7, 2024
19e890b
add doc
olasaadi99 Oct 7, 2024
1094103
fiX
olasaadi99 Oct 7, 2024
f12feb3
fix
olasaadi99 Oct 10, 2024
3a182eb
fix
olasaadi99 Oct 10, 2024
d6ab6ca
fix
olasaadi99 Oct 14, 2024
d7db215
remove
olasaadi99 Oct 14, 2024
69a9635
Merge branch 'main' into 401_service_network
olasaadi99 Oct 20, 2024
f344e77
add singleton for network address lists
olasaadi99 Oct 21, 2024
b688a8d
fix ibm analysis tests
olasaadi99 Oct 21, 2024
ce1ef1e
fix
olasaadi99 Oct 21, 2024
aaf2f5a
fix diff
olasaadi99 Oct 21, 2024
a8f26d9
fix explainability
olasaadi99 Oct 21, 2024
a67dadf
fix lint test
olasaadi99 Oct 21, 2024
951fe27
fix tests
olasaadi99 Oct 21, 2024
d27c56c
fix lint
olasaadi99 Oct 21, 2024
0ffb6c8
fix
olasaadi99 Oct 21, 2024
5693ae6
fix
olasaadi99 Oct 21, 2024
d424b24
fix
olasaadi99 Oct 21, 2024
6aa5352
fixes
olasaadi99 Oct 22, 2024
39cd24d
adding icon
haim-kermany Oct 27, 2024
57e6dec
lint
haim-kermany Oct 27, 2024
aa3cfb8
Merge branch 'main' into 401_service_network
olasaadi99 Oct 30, 2024
2ec8714
add tests
olasaadi99 Oct 30, 2024
19b350c
Merge branch 'main' into 401_service_network
olasaadi99 Nov 4, 2024
52e2a35
fix merge
olasaadi99 Nov 4, 2024
ccb8bfa
fix
olasaadi99 Nov 7, 2024
f6c671a
fix
olasaadi99 Nov 7, 2024
d7aa567
fix
olasaadi99 Nov 7, 2024
f0a33fd
fix
olasaadi99 Nov 7, 2024
8f0f000
fix
olasaadi99 Nov 7, 2024
a5985ec
fix
olasaadi99 Nov 7, 2024
afc710d
fix copy funcs
olasaadi99 Nov 7, 2024
64e2af7
fix diff
olasaadi99 Nov 7, 2024
e9d38a4
Interpreted destination(s): field
olasaadi99 Nov 7, 2024
1098061
fix serviceGateway name
olasaadi99 Nov 11, 2024
b36bef3
fix Interpreted destination(s)
olasaadi99 Nov 11, 2024
ae72bec
fix lint
zivnevo Nov 11, 2024
503c14f
NS to SN
haim-kermany Nov 11, 2024
3c59d4b
SN layout
haim-kermany Nov 11, 2024
8293a45
fix sn for groupedExternalNodes
haim-kermany Nov 12, 2024
34f75a8
fixes
olasaadi99 Nov 18, 2024
04acb74
fix
olasaadi99 Nov 18, 2024
4ddb680
fix
olasaadi99 Nov 20, 2024
8473966
fix
olasaadi99 Nov 21, 2024
7a71b12
fix
olasaadi99 Nov 21, 2024
48f04d1
fix
olasaadi99 Nov 21, 2024
f64c5de
fix
olasaadi99 Nov 21, 2024
51ad779
fix
olasaadi99 Nov 21, 2024
4dac4c6
fix
olasaadi99 Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/analyzer/subcmds/vpcconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func vpcConfigsFromFiles(fileNames []string, inArgs *inArgs) (*vpcmodel.Multiple
var rc commonvpc.ResourcesContainer
switch provider {
case common.IBM:
rc = &ibmvpc.IBMresourcesContainer{}
rc = ibmvpc.NewIBMresourcesContainer()
case common.AWS:
rc = &awsvpc.AWSresourcesContainer{}
rc = awsvpc.NewAWSresourcesContainer()
default:
return nil, fmt.Errorf(notSupportedYet, provider)
}
Expand All @@ -78,9 +78,9 @@ func vpcConfigsFromAccount(inArgs *inArgs) (*vpcmodel.MultipleVPCConfigs, error)
var commonRC commonvpc.ResourcesContainer
switch inArgs.provider {
case common.IBM:
commonRC, err = ibmvpc.NewIBMresourcesContainer(rc)
commonRC, err = ibmvpc.CopyIBMresourcesContainer(rc)
case common.AWS:
commonRC, err = awsvpc.NewAWSresourcesContainer(rc)
commonRC, err = awsvpc.CopyAWSresourcesContainer(rc)
default:
return nil, fmt.Errorf(notSupportedYet, inArgs.provider.String())
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/awsvpc/analysis_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var tests = []*testfunc.VpcAnalysisTest{
// tests is the list of tests to run
for testIdx := range tests {
tt := tests[testIdx]
tt.TestAnalysisSingleTest(t, testfunc.OutputGeneration, &AWSresourcesContainer{}, analysisOut, tt.InputConfig)
tt.TestAnalysisSingleTest(t, testfunc.OutputGeneration, NewAWSresourcesContainer(), analysisOut, tt.InputConfig)
}
fmt.Println("done")
}*/
Expand All @@ -76,7 +76,7 @@ func TestReportWithComparison(t *testing.T) {
// tests is the list of tests to run
for testIdx := range tests {
tt := tests[testIdx]
tt.TestAnalysisSingleTest(t, testfunc.OutputComparison, &AWSresourcesContainer{}, analysisOut, tt.InputConfig)
tt.TestAnalysisSingleTest(t, testfunc.OutputComparison, NewAWSresourcesContainer(), analysisOut, tt.InputConfig)
}
fmt.Println("done")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Explaining connectivity from 147.235.0.0/16 to 10.240.0.96 within mixed
Interpreted source(s): 147.235.0.0/16 (external)
Interpreted source(s): 147.235.0.0/16 (Public Internet)
Interpreted destination(s): p3[10.240.0.96]
=======================================================================

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Explaining connectivity from 10.240.20.245 to 161.26.0.0 within vpc0
Interpreted source(s): app1[10.240.20.245]
Interpreted destination(s): 161.26.0.0 (external)
Interpreted destination(s): 161.26.0.0 (Public Internet)
====================================================================

No connectivity from app1[10.240.20.245] to Public Internet 161.26.0.0/32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Explaining connectivity from 10.240.20.245 to 161.26.0.0 within vpc0
Interpreted source(s): app1[10.240.20.245]
Interpreted destination(s): 161.26.0.0 (external)
Interpreted destination(s): 161.26.0.0 (Public Internet)
====================================================================

No connectivity from app1[10.240.20.245] to Public Internet 161.26.0.0/32;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Explaining connectivity from 10.240.10.42 to 161.26.0.0 within vpc0
Interpreted source(s): proxy[10.240.10.42]
Interpreted destination(s): 161.26.0.0 (external)
Interpreted destination(s): 161.26.0.0 (Public Internet)
===================================================================

Connections from proxy[10.240.10.42] to Public Internet 161.26.0.0/32: All Connections
Expand Down
4 changes: 2 additions & 2 deletions pkg/awsvpc/explainability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestExplainWithComparsion(t *testing.T) {
// explainTests is the list of tests to run
for testIdx := range explainTests {
tt := explainTests[testIdx]
tt.TestSingleExplain(t, testfunc.OutputComparison, &AWSresourcesContainer{}, tt.Name)
tt.TestSingleExplain(t, testfunc.OutputComparison, NewAWSresourcesContainer(), tt.Name)
}
fmt.Println("done")
}
Expand All @@ -112,7 +112,7 @@ func TestExplainWithComparsion(t *testing.T) {
// tests is the list of tests to run
for testIdx := range explainTests {
tt := explainTests[testIdx]
tt.TestSingleExplain(t, commonvpc.OutputGeneration, &AWSresourcesContainer{}, tt.Name)
tt.TestSingleExplain(t, commonvpc.OutputGeneration, NewAWSresourcesContainer(), tt.Name)
}
fmt.Println("done")
}*/
4 changes: 2 additions & 2 deletions pkg/awsvpc/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestLintWithComparsion(t *testing.T) {
tt.Mode = testfunc.OutputComparison
t.Run(tt.Name, func(t *testing.T) {
t.Parallel()
rc := &AWSresourcesContainer{}
rc := NewAWSresourcesContainer()
tt.TestSingleLint(t, rc)
})
}
Expand All @@ -63,7 +63,7 @@ func TestLintWithComparsion(t *testing.T) {
tt.Mode = testfunc.OutputGeneration
t.Run(tt.Name, func(t *testing.T) {
t.Parallel()
rc := &AWSresourcesContainer{}
rc := NewAWSresourcesContainer()
tt.TestSingleLint(t, rc)
})
}
Expand Down
16 changes: 13 additions & 3 deletions pkg/awsvpc/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ type AWSresourcesContainer struct {
aws.ResourcesContainer
}

func NewAWSresourcesContainer(rc common.ResourcesContainerInf) (*AWSresourcesContainer, error) {
// NewAWSresourcesContainer is used to return empty NewAWSresourcesContainer and also initialize
// vpcmodel.NetworkAddressLists with aws Public internet and service network
// if you do not use this function, you need to initialize vpcmodel.NetworkAddressLists
func NewAWSresourcesContainer() *AWSresourcesContainer {
vpcmodel.InitNetworkAddressLists(vpcmodel.GetDefaultPublicInternetAddressList(), []string{})
return &AWSresourcesContainer{}
}

func CopyAWSresourcesContainer(rc common.ResourcesContainerInf) (*AWSresourcesContainer, error) {
zivnevo marked this conversation as resolved.
Show resolved Hide resolved
awsResources, ok := rc.GetResources().(*aws.ResourcesContainer)
if !ok {
return nil, fmt.Errorf("error casting resources to *aws.ResourcesContainerModel type")
}
return &AWSresourcesContainer{ResourcesContainer: *awsResources}, nil
awsRC := NewAWSresourcesContainer()
awsRC.ResourcesContainer = *awsResources
return awsRC, nil
}

// parseResourcesFromFile returns aws.ResourcesContainer object, containing the configured resources structs
Expand Down Expand Up @@ -79,7 +89,7 @@ func mergeResourcesContainers(rc1, rc2 *AWSresourcesContainer) (*AWSresourcesCon
func (rc *AWSresourcesContainer) VpcConfigsFromFiles(fileNames []string, resourceGroup string, vpcIDs, regions []string) (
*vpcmodel.MultipleVPCConfigs, error) {
for _, file := range fileNames {
mergedRC := &AWSresourcesContainer{}
mergedRC := NewAWSresourcesContainer()
err1 := mergedRC.ParseResourcesFromFile(file)
if err1 != nil {
return nil, fmt.Errorf("error parsing input vpc resources file: %w", err1)
Expand Down
33 changes: 17 additions & 16 deletions pkg/commonvpc/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,23 @@ const (

// Resource types const strings, used in the generated resources of this pkg
const (
ResourceTypeVSI = "VSI"
ResourceTypeNetworkInterface = "NetworkInterface"
ResourceTypeSubnet = "Subnet"
ResourceTypePublicGateway = "PublicGateway"
ResourceTypeInternetGateway = "InternetGateway"
ResourceTypeFloatingIP = "FloatingIP"
ResourceTypeVPC = "VPC"
ResourceTypeSG = "SG"
ResourceTypeNACL = "NACL"
ResourceTypeIKSNode = "IKSNodeNetworkInterface"
ResourceTypeVPE = "VPE"
ResourceTypeTGW = "TGW"
ResourceTypeReservedIP = "ReservedIP"
ResourceTypeLoadBalancer = "LoadBalancer"
ResourceTypePrivateIP = "PrivateIP"
ResourceTypeRoutingTable = "RoutingTable"
ResourceTypeVSI = "VSI"
ResourceTypeNetworkInterface = "NetworkInterface"
ResourceTypeSubnet = "Subnet"
ResourceTypePublicGateway = "PublicGateway"
ResourceTypeInternetGateway = "InternetGateway"
ResourceTypeFloatingIP = "FloatingIP"
ResourceTypeVPC = "VPC"
ResourceTypeSG = "SG"
ResourceTypeNACL = "NACL"
ResourceTypeIKSNode = "IKSNodeNetworkInterface"
ResourceTypeVPE = "VPE"
ResourceTypeTGW = "TGW"
ResourceTypeReservedIP = "ReservedIP"
ResourceTypeLoadBalancer = "LoadBalancer"
ResourceTypePrivateIP = "PrivateIP"
ResourceTypeRoutingTable = "RoutingTable"
ResourceTypeServiceNetworkGateway = "ServiceGateway"
)

// Implemented by AWSresourcesContainer and IBMresourcesContainer
Expand Down
11 changes: 11 additions & 0 deletions pkg/drawio/iconTreeNode.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,14 @@ func NewInternetServiceTreeNode(parent SquareTreeNodeInterface, name string) *In
parent.addIconTreeNode(&inter)
return &inter
}

// ////////////////////////////////////////////////////////////////
type ServiceNetworkTreeNode struct {
abstractIconTreeNode
}

func NewServiceNetworkTreeNode(parent SquareTreeNodeInterface, name string) *ServiceNetworkTreeNode {
sn := ServiceNetworkTreeNode{newAbstractIconTreeNode(parent, name)}
parent.addIconTreeNode(&sn)
return &sn
}
1 change: 1 addition & 0 deletions pkg/drawio/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ func (ly *layoutS) setIconsLocations() {
}
ly.setTgwLocations(region)
}
ly.setIconsLocationsOnTop(cloud)
}
ly.setPublicNetworkIconsLocations()
ly.setGroupingIconLocations()
Expand Down
2 changes: 1 addition & 1 deletion pkg/drawio/nodesRelations.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func tnRelations(network TreeNodeInterface) map[TreeNodeInterface][]TreeNodeInte
// each node related to a line get all the other nodes:
lineRelations := lineRelation(info)
for _, relatedTn := range lineRelations {
res[relatedTn] = append(res[relatedTn], lineRelations...)
res[relatedTn] = append(res[relatedTn], lineRelations...) //nolint:gocritic // false positive
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/drawio/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var images = map[common.Provider]map[reflect.Type]string{
reflect.TypeOf(TransitGatewayTreeNode{}): "PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0OSA0OSI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMxMTkyZTg7fS5jbHMtMiwuY2xzLTR7ZmlsbDpub25lO30uY2xzLTJ7ZmlsbC1ydWxlOmV2ZW5vZGQ7fS5jbHMtM3tmaWxsOi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IgeT0iMzAuNDMiIHdpZHRoPSIyLjUiIGhlaWdodD0iMi4zNyIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgeD0iMjMuMjUiIHk9IjMwLjQzIiB3aWR0aD0iMi41IiBoZWlnaHQ9IjIuMzciLz48cmVjdCBjbGFzcz0iY2xzLTIiIHg9IjI5LjUiIHk9IjMwLjQzIiB3aWR0aD0iMi41IiBoZWlnaHQ9IjIuMzciLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjE0LjUiIHk9IjE1IiB3aWR0aD0iMjAiIGhlaWdodD0iMTguOTkiLz48cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0yMC4xMiwxNi4xOXY1Ljk0aDguNzZWMTYuMTlabTEuMjYsMS4xOWgxLjI0djMuNTZIMjEuMzhabTYuMjQsMy41NkgyMy44OFYxNy4zOGgzLjc0WiIvPjwvc3ZnPg==",
reflect.TypeOf(PrivateIPTreeNode{}): privateIPImage,
},
Expand Down
13 changes: 10 additions & 3 deletions pkg/ibmvpc/analysis_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,13 @@ var tests = []*testfunc.VpcAnalysisTest{
GroupingType: vpcmodel.GroupingWithConsistencyEdges,
NoLbAbstract: true,
},
{
VpcTestCommon: testfunc.VpcTestCommon{
InputConfig: "service_network_test",
UseCases: []vpcmodel.OutputUseCase{vpcmodel.AllEndpoints},
Format: vpcmodel.Text,
},
},
}

// uncomment the function below to run for updating the expected output
Expand All @@ -761,7 +768,7 @@ var tests = []*testfunc.VpcAnalysisTest{
// tests is the list of tests to run
for testIdx := range tests {
tt := tests[testIdx]
tt.TestAnalysisSingleTest(t, testfunc.OutputGeneration, &IBMresourcesContainer{}, analysisOut, tt.InputConfig)
tt.TestAnalysisSingleTest(t, testfunc.OutputGeneration, NewIBMresourcesContainer(), analysisOut, tt.InputConfig)
}
fmt.Println("done")
}*/
Expand All @@ -770,7 +777,7 @@ func TestReportWithComparison(t *testing.T) {
// tests is the list of tests to run
for testIdx := range tests {
tt := tests[testIdx]
tt.TestAnalysisSingleTest(t, testfunc.OutputComparison, &IBMresourcesContainer{}, analysisOut, tt.InputConfig)
tt.TestAnalysisSingleTest(t, testfunc.OutputComparison, NewIBMresourcesContainer(), analysisOut, tt.InputConfig)
}
fmt.Println("done")
}
Expand Down Expand Up @@ -809,7 +816,7 @@ func TestUnsupportedAnalysis(t *testing.T) {
// tests is the list of tests to run
for testIdx := range tests {
tt := tests[testIdx]
tt.TestAnalysisSingleTest(t, tt.Mode, &IBMresourcesContainer{}, analysisOut, tt.Name)
tt.TestAnalysisSingleTest(t, tt.Mode, NewIBMresourcesContainer(), analysisOut, tt.Name)
}
fmt.Println("done")
}
16 changes: 8 additions & 8 deletions pkg/ibmvpc/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ var diffTests = []*testfunc.VpcDiffTest{
// uncomment the function below to run for updating the expected output

/*
func TestDiffWithGeneration(t *testing.T) {
// tests is the list of tests to run
for testIdx := range diffTests {
tt := diffTests[testIdx]
tt.TestDiffSingle(t, testfunc.OutputGeneration, &IBMresourcesContainer{}, analysisOut, tt.InputConfig)
func TestDiffWithGeneration(t *testing.T) {
// tests is the list of tests to run
for testIdx := range diffTests {
tt := diffTests[testIdx]
tt.TestDiffSingle(t, testfunc.OutputGeneration, NewIBMresourcesContainer(), diffOut, tt.InputConfig)
}
fmt.Println("done")
}
fmt.Println("done")
}
*/

const diffOut = "diff_out"
Expand All @@ -111,7 +111,7 @@ func TestDiffWithComparison(t *testing.T) {
// tests is the list of tests to run
for testIdx := range diffTests {
tt := diffTests[testIdx]
tt.TestDiffSingle(t, testfunc.OutputComparison, &IBMresourcesContainer{}, diffOut, tt.InputConfig)
tt.TestDiffSingle(t, testfunc.OutputComparison, NewIBMresourcesContainer(), diffOut, tt.InputConfig)
}
fmt.Println("done")
}
Loading
Loading