@@ -61,7 +61,7 @@ var _ = Describe("Validation", func() {
6161
6262 ComDetailsMatrix , err := types .ParseToComDetailsList (commatrixFileContent , types .FormatCSV )
6363 Expect (err ).ToNot (HaveOccurred (), "Failed to parse generated commatrix" )
64- commatrix = & types.ComMatrix {Matrix : ComDetailsMatrix }
64+ commatrix = & types.ComMatrix {Ports : ComDetailsMatrix }
6565 })
6666
6767 It ("generated communication matrix should be equal to documented communication matrix" , func () {
@@ -93,7 +93,7 @@ var _ = Describe("Validation", func() {
9393
9494 docComDetailsList , err := types .ParseToComDetailsList (docCommatrixFileContent , types .FormatCSV )
9595 Expect (err ).ToNot (HaveOccurred (), "Failed to parse documented communication matrix" )
96- docComMatrix := & types.ComMatrix {Matrix : docComDetailsList }
96+ docComMatrix := & types.ComMatrix {Ports : docComDetailsList }
9797
9898 By ("generating diff between matrices for testing purposes" )
9999 endpointslicesDiffWithDocMat := matrixdiff .Generate (commatrix , docComMatrix )
@@ -106,7 +106,7 @@ var _ = Describe("Validation", func() {
106106 By ("comparing new and documented commatrices" )
107107 // Get ports that are in the documented commatrix but not in the generated commatrix.
108108 notUsedPortsMat := endpointslicesDiffWithDocMat .GetUniqueSecondary ()
109- if len (notUsedPortsMat .Matrix ) > 0 {
109+ if len (notUsedPortsMat .Ports ) > 0 {
110110 logrus .Warningf ("the following ports are documented but are not used:\n %s" , notUsedPortsMat )
111111 }
112112
@@ -124,15 +124,15 @@ var _ = Describe("Validation", func() {
124124
125125 portsToIgnoreComDetails , err := types .ParseToComDetailsList (portsToIgnoreFileContent , openPortsToIgnoreFormat )
126126 Expect (err ).ToNot (HaveOccurred ())
127- portsToIgnoreMat = & types.ComMatrix {Matrix : portsToIgnoreComDetails }
127+ portsToIgnoreMat = & types.ComMatrix {Ports : portsToIgnoreComDetails }
128128
129129 // generate the diff matrix between the open ports to ignore matrix and the missing ports in the documented commatrix (based on the diff between the enpointslice and the doc matrix)
130130 nonDocumentedEndpointslicesMat := endpointslicesDiffWithDocMat .GetUniquePrimary ()
131131 endpointslicesDiffWithIgnoredPorts := matrixdiff .Generate (nonDocumentedEndpointslicesMat , portsToIgnoreMat )
132132 missingPortsMat = endpointslicesDiffWithIgnoredPorts .GetUniquePrimary ()
133133 }
134134
135- if len (missingPortsMat .Matrix ) > 0 {
135+ if len (missingPortsMat .Ports ) > 0 {
136136 err := fmt .Errorf ("the following ports are used but are not documented:\n %s" , missingPortsMat )
137137 Expect (err ).ToNot (HaveOccurred ())
138138 }
@@ -150,13 +150,13 @@ var _ = Describe("Validation", func() {
150150 missingEPSMat , err := extractEPSMatByStatus (matDiffSSFileContent , Missing )
151151 Expect (err ).ToNot (HaveOccurred (), "Failed to extract missing EPS Matrix" )
152152
153- if len (notUsedEPSMat .Matrix ) > 0 {
153+ if len (notUsedEPSMat .Ports ) > 0 {
154154 logrus .Warningf ("the following ports are not used: \n %s" , notUsedEPSMat )
155155 }
156156
157157 missingEPSMat , err = filterKnownPorts (missingEPSMat )
158158 Expect (err ).ToNot (HaveOccurred (), "Failed to filter the known ports" )
159- if len (missingEPSMat .Matrix ) > 0 {
159+ if len (missingEPSMat .Ports ) > 0 {
160160 err := fmt .Errorf ("the following ports are used but don't have an endpointslice: \n %s" , missingEPSMat )
161161 Expect (err ).ToNot (HaveOccurred ())
162162 }
@@ -190,7 +190,7 @@ func filterKnownPorts(mat *types.ComMatrix) (*types.ComMatrix, error) {
190190 }
191191
192192 res := []types.ComDetails {}
193- for _ , cd := range mat .Matrix {
193+ for _ , cd := range mat .Ports {
194194 // Skip "ovnkube" ports in the nodePort range, these are dynamic open ports on the node,
195195 // no need to mention them in the matrix diff
196196 if cd .Service == "ovnkube" && cd .Port >= nodePortMin && cd .Port <= nodePortMax {
@@ -219,7 +219,7 @@ func filterKnownPorts(mat *types.ComMatrix) (*types.ComMatrix, error) {
219219 res = append (res , cd )
220220 }
221221
222- return & types.ComMatrix {Matrix : res }, nil
222+ return & types.ComMatrix {Ports : res }, nil
223223}
224224
225225// extractEPSMatByStatus extracts and returns ComMatrix by filtering lines of a CSV content based on a EPS status.
@@ -231,7 +231,7 @@ func extractEPSMatByStatus(csvContent []byte, status EPSStatus) (*types.ComMatri
231231 return nil , err
232232 }
233233
234- return & types.ComMatrix {Matrix : prefixEPSMat }, nil
234+ return & types.ComMatrix {Ports : prefixEPSMat }, nil
235235}
236236
237237// extractDiffByStatus filter the lines of the csv content based on the EPS status
0 commit comments