File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 Region ,
1515 Type ,
1616)
17+ from linode_api4 .util import drop_null_keys
1718
1819
1920class LKEType (Base ):
@@ -574,7 +575,7 @@ def control_plane_acl_update(
574575 result = self ._client .put (
575576 f"{ LKECluster .api_endpoint } /control_plane_acl" ,
576577 model = self ,
577- data = {"acl" : acl },
578+ data = {"acl" : drop_null_keys ( acl ) },
578579 )
579580
580581 acl = result .get ("acl" )
Original file line number Diff line number Diff line change @@ -498,3 +498,18 @@ def test_populate_with_mixed_types(self):
498498 assert self .pool .nodes [0 ].id == "node7"
499499 assert self .pool .nodes [1 ].id == "node8"
500500 assert self .pool .nodes [2 ].id == "node9"
501+
502+ def test_cluster_update_null_addresses (self ):
503+ cluster = LKECluster (self .client , 18881 )
504+
505+ with self .mock_put ("lke/clusters/18881/control_plane_acl" ) as m :
506+ cluster .control_plane_acl_update (
507+ LKEClusterControlPlaneACLOptions (
508+ enabled = True ,
509+ addresses = None ,
510+ )
511+ )
512+
513+ # Addresses should not be included in the API request if it's null
514+ # See: TPT-3489
515+ assert m .call_data == {"acl" : {"enabled" : True }}
You can’t perform that action at this time.
0 commit comments