Skip to content

Commit cf321a4

Browse files
committed
version 12.1.5 adds optional output to rule-export
1 parent 7c3f5b3 commit cf321a4

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

cmd/ruleexport/headers.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const (
4343
HeaderNetworkType = "network_type"
4444
HeaderExternalDataSet = "external_data_set"
4545
HeaderExternalDataReference = "external_data_reference"
46+
HeaderPolicyVersionNumber = "policy_version_number"
4647
)
4748

4849
func getCSVHeaders(templateFormat bool) []string {
@@ -92,9 +93,13 @@ func getCSVHeaders(templateFormat bool) []string {
9293
return headers
9394
}
9495

95-
func createEntrySlice(csvEntryMap map[string]string, templateFormat bool, useSubnets bool) []string {
96+
func createEntrySlice(csvEntryMap map[string]string, templateFormat bool, useSubnets bool, includePolicyVersionNumber bool) []string {
9697
entry := []string{}
97-
for _, h := range getCSVHeaders(templateFormat) {
98+
r := getCSVHeaders(templateFormat)
99+
if includePolicyVersionNumber {
100+
r = append(r, HeaderPolicyVersionNumber)
101+
}
102+
for _, h := range r {
98103
if !useSubnets && (h == HeaderSrcUseWorkloadSubnets || h == HeaderDstUseWorkloadSubnets) {
99104
continue
100105
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.24.2
55
require (
66
github.com/aws/aws-sdk-go v1.44.243
77
github.com/brian1917/illumioapi v1.85.0
8-
github.com/brian1917/illumioapi/v2 v2.0.8
8+
github.com/brian1917/illumioapi/v2 v2.0.9
99
github.com/brian1917/illumiocloudapi v1.0.5
1010
github.com/brian1917/ns v1.2.0
1111
github.com/brian1917/workloader/utils v1.7.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ github.com/brian1917/illumioapi v1.85.0 h1:f24Qdl4CBGmLATY/w1E4Yw5EC6P+24EawUsk3
4444
github.com/brian1917/illumioapi v1.85.0/go.mod h1:jREIUsMQeaaL7Mde0nTG2ehSDJjRSU79WFgFXcm0XhQ=
4545
github.com/brian1917/illumioapi/v2 v2.0.8 h1:ZMZo+CmGjFPR8arHYNnSbEaHvbvKFq3GjETQQUAq2KY=
4646
github.com/brian1917/illumioapi/v2 v2.0.8/go.mod h1:2uy7bernq5Ein6PiTS+9a4VvjYEMKi3vAGybByDZ2c8=
47+
github.com/brian1917/illumioapi/v2 v2.0.9 h1:ROZjTxq2cHwBj11Uz0pg7Q1gF794y0LKTAjDgD6MfKg=
48+
github.com/brian1917/illumioapi/v2 v2.0.9/go.mod h1:2uy7bernq5Ein6PiTS+9a4VvjYEMKi3vAGybByDZ2c8=
4749
github.com/brian1917/illumiocloudapi v1.0.5 h1:1+JGrIftRAEAK3lHT/2qRcUWbHNcwWR/hBJSb3PB32I=
4850
github.com/brian1917/illumiocloudapi v1.0.5/go.mod h1:AxwAtYegEvb2h4DzH9gx0HQrNIeXEFppjRUcvBoyskM=
4951
github.com/brian1917/ns v1.2.0 h1:8z9dR8WhaqJPTi8Ygyf6VHrYGoP8dbNV8hoD30/k/8c=

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.1.4
1+
12.1.5

0 commit comments

Comments
 (0)