Skip to content

Commit a2e68a0

Browse files
authored
[GCU] Marking fields under MIRROR_SESSION as create-only (sonic-net#2104)
What I did Fix sonic-net#2068 Changes to fields under MIRROR_SESSION using GCU are not reflected and removal will result in orchagent crash unless each key is deleted and added back. This means the fields are create-only. How I did it Mark the fields under MIRROR_SESSION as create-only How to verify it unit-test
1 parent 1cf1d03 commit a2e68a0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

generic_config_updater/patch_sorter.py

+1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def __init__(self, path_addressing):
589589
["BGP_MONITORS", "*", "local_addr"],
590590
["BGP_MONITORS", "*", "nhopself"],
591591
["BGP_MONITORS", "*", "rrclient"],
592+
["MIRROR_SESSION", "*", "*"],
592593
],
593594
path_addressing)
594595

tests/generic_config_updater/patch_sorter_test.py

+14
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,15 @@ def test_hard_coded_create_only_paths(self):
10331033
"nhopself": "0",
10341034
"rrclient": "0"
10351035
}
1036+
},
1037+
"MIRROR_SESSION": {
1038+
"mirror_session_dscp": {
1039+
"dscp": "5",
1040+
"dst_ip": "2.2.2.2",
1041+
"src_ip": "1.1.1.1",
1042+
"ttl": "32",
1043+
"type": "ERSPAN"
1044+
}
10361045
}
10371046
}
10381047
expected = [
@@ -1058,6 +1067,11 @@ def test_hard_coded_create_only_paths(self):
10581067
"/BGP_MONITORS/5.6.7.8/name",
10591068
"/BGP_MONITORS/5.6.7.8/nhopself",
10601069
"/BGP_MONITORS/5.6.7.8/rrclient",
1070+
"/MIRROR_SESSION/mirror_session_dscp/dscp",
1071+
"/MIRROR_SESSION/mirror_session_dscp/dst_ip",
1072+
"/MIRROR_SESSION/mirror_session_dscp/src_ip",
1073+
"/MIRROR_SESSION/mirror_session_dscp/ttl",
1074+
"/MIRROR_SESSION/mirror_session_dscp/type",
10611075
]
10621076

10631077
actual = self.validator._get_create_only_paths(config)

0 commit comments

Comments
 (0)