Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions plugins/modules/lke_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ def _attempt_update_acl(self, cluster: LKECluster) -> None:
ipv4 = configured_addresses.get("ipv4")
ipv6 = configured_addresses.get("ipv6")

configured_acl["addresses"]["ipv4"] = None if ipv4 == [] else ipv4
configured_acl["addresses"]["ipv6"] = None if ipv6 == [] else ipv6
configured_acl["addresses"]["ipv4"] = [] if not ipv4 else ipv4
configured_acl["addresses"]["ipv6"] = [] if not ipv6 else ipv6

user_defined_keys = set(linode_lke_cluster_acl.keys())
current_acl = control_plane_acl if control_plane_acl is not None else {}
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/targets/lke_cluster_acl/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
- update_cluster.cluster.region == "us-mia"
- update_cluster.cluster.control_plane.acl.enabled
- update_cluster.cluster.control_plane.acl.addresses.ipv4[0] == "10.0.0.5/32"
- update_cluster.cluster.control_plane.acl.addresses.ipv6 == None

- update_cluster.cluster.control_plane.acl.addresses.ipv6 == []

- name: Don't change the cluster
linode.cloud.lke_cluster:
Expand All @@ -93,8 +92,7 @@
- not unchanged_cluster.changed
- unchanged_cluster.cluster.control_plane.acl.enabled
- unchanged_cluster.cluster.control_plane.acl.addresses.ipv4[0] == "10.0.0.5/32"
- unchanged_cluster.cluster.control_plane.acl.addresses.ipv6 == None

- unchanged_cluster.cluster.control_plane.acl.addresses.ipv6 == []

- name: Disable ACLs on the cluster
linode.cloud.lke_cluster:
Expand All @@ -118,6 +116,8 @@
that:
- acl_disabled_cluster.changed
- not acl_disabled_cluster.cluster.control_plane.acl.enabled
- acl_disabled_cluster.cluster.control_plane.acl.addresses.ipv4 == []
- acl_disabled_cluster.cluster.control_plane.acl.addresses.ipv6 == []
always:
- ignore_errors: yes
block:
Expand Down
Loading