Skip to content

Conversation

@jremy42
Copy link
Contributor

@jremy42 jremy42 commented Sep 29, 2025

close #3754

@jremy42 jremy42 requested review from a team and remyleone as code owners September 29, 2025 08:22
@github-actions github-actions bot added the rdb Managed MySQL and PostgreSQL issues, bugs and feature requests label Sep 29, 2025
@jremy42 jremy42 force-pushed the feat/rdb_acl_multiple_descriptions branch from e14ff10 to e350e72 Compare September 30, 2025 14:54
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2025

❌ 11 Tests Failed:

Tests completed Failed Passed Skipped
2090 11 2079 17
View the top 3 failed test(s) by shortest run time
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_AddACL
Stack Traces | 0s run time
=== RUN   Test_AddACL
--- FAIL: Test_AddACL (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_DeleteACL
Stack Traces | 0s run time
=== RUN   Test_DeleteACL
--- FAIL: Test_DeleteACL (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_SetACL
Stack Traces | 0s run time
=== RUN   Test_SetACL
--- FAIL: Test_SetACL (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_SetACL/Multiple_with_general_description_and_specific_descriptions
Stack Traces | 0s run time
=== RUN   Test_SetACL/Multiple_with_general_description_and_specific_descriptions
=== PAUSE Test_SetACL/Multiple_with_general_description_and_specific_descriptions
=== CONT  Test_SetACL/Multiple_with_general_description_and_specific_descriptions
    custom_acl_test.go:233: 
        	Error Trace:	.../scaleway-cli/core/testing.go:443
        	Error:      	Received unexpected error:
        	            	scaleway-sdk-go: denied authentication: API key does not exist
        	Test:       	Test_SetACL/Multiple_with_general_description_and_specific_descriptions
        	Messages:   	error executing BeforeFunc
--- FAIL: Test_SetACL/Multiple_with_general_description_and_specific_descriptions (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_SetACL/Multiple_with_individual_descriptions
Stack Traces | 0s run time
=== RUN   Test_SetACL/Multiple_with_individual_descriptions
=== PAUSE Test_SetACL/Multiple_with_individual_descriptions
=== CONT  Test_SetACL/Multiple_with_individual_descriptions
    custom_acl_test.go:199: 
        	Error Trace:	.../scaleway-cli/core/testing.go:443
        	Error:      	Received unexpected error:
        	            	scaleway-sdk-go: denied authentication: API key does not exist
        	Test:       	Test_SetACL/Multiple_with_individual_descriptions
        	Messages:   	error executing BeforeFunc
--- FAIL: Test_SetACL/Multiple_with_individual_descriptions (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_SetACL/Multiple_with_partial_descriptions
Stack Traces | 0s run time
=== RUN   Test_SetACL/Multiple_with_partial_descriptions
=== PAUSE Test_SetACL/Multiple_with_partial_descriptions
=== CONT  Test_SetACL/Multiple_with_partial_descriptions
    custom_acl_test.go:216: 
        	Error Trace:	.../scaleway-cli/core/testing.go:443
        	Error:      	Received unexpected error:
        	            	scaleway-sdk-go: denied authentication: API key does not exist
        	Test:       	Test_SetACL/Multiple_with_partial_descriptions
        	Messages:   	error executing BeforeFunc
--- FAIL: Test_SetACL/Multiple_with_partial_descriptions (0.00s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_AddACL/Multiple
Stack Traces | 0.03s run time
=== RUN   Test_AddACL/Multiple
=== PAUSE Test_AddACL/Multiple
=== CONT  Test_AddACL/Multiple
    custom_acl_test.go:46: 
        	Error Trace:	.../scaleway-cli/core/testing.go:747
        	            				.../scaleway-cli/core/testing.go:660
        	            				.../scaleway-cli/core/testing.go:498
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ ACL rule 1.2.3.4/32 successfully added.\nIP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0   23007  tcp       inbound    allow   Allow All\n1.2.3.4/32  23007  tcp       inbound    allow   Allow 1.2.3.4/32\n✅ ACL rule 192.168.1.0/30 successfully added.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       23007  tcp       inbound    allow   Allow All\n1.2.3.4/32      23007  tcp       inbound    allow   Allow 1.2.3.4/32\n192.168.1.0/30  23007  tcp       inbound    allow   Allow 192.168.1.0/30\n✅ ACL rule 10.10.10.10/32 successfully added.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       23007  tcp       inbound    allow   Allow All\n1.2.3.4/32      23007  tcp       inbound    allow   Allow 1.2.3.4/32\n10.10.10.10/32  23007  tcp       inbound    allow   Allow 10.10.10.10/32\n192.168.1.0/30  23007  tcp       inbound    allow   Allow 192.168.1.0/30\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n[\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 1.2.3.4/32\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 1.2.3.4/32 successfully added\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 1.2.3.4/32\"\n      },\n      {\n        \"ip\": \"192.168.1.0/30\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 192.168.1.0/30\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 192.168.1.0/30 successfully added\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 1.2.3.4/32\"\n      },\n      {\n        \"ip\": \"10.10.10.10/32\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 10.10.10.10/32\"\n      },\n      {\n        \"ip\": \"192.168.1.0/30\",\n        \"port\": 23007,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 192.168.1.0/30\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 10.10.10.10/32 successfully added\",\n      \"details\": \"\"\n    }\n  }\n]\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ 3 ACL rules successfully added.\nIP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0   23007  tcp       inbound    allow   Allow All\n1.2.3.4/32  23007  tcp       inbound    allow   Allow 1.2.3.4/32\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n{\n  \"Rules\": [\n    {\n      \"ip\": \"0.0.0.0/0\",\n      \"port\": 23007,\n      \"protocol\": \"tcp\",\n      \"direction\": \"inbound\",\n      \"action\": \"allow\",\n      \"description\": \"Allow All\"\n    },\n    {\n      \"ip\": \"1.2.3.4/32\",\n      \"port\": 23007,\n      \"protocol\": \"tcp\",\n      \"direction\": \"inbound\",\n      \"action\": \"allow\",\n      \"description\": \"Allow 1.2.3.4/32\"\n    }\n  ],\n  \"Success\": {\n    \"message\": \"3 ACL rules successfully added\",\n    \"details\": \"\"\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,3 @@
        	            	 🟩🟩🟩 STDOUT️ 🟩🟩🟩️
        	            	-✅ ACL rule 1.2.3.4/32 successfully added.
        	            	+✅ 3 ACL rules successfully added.
        	            	 IP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	@@ -6,112 +6,27 @@
        	            	 1.2.3.4/32  23007  tcp       inbound    allow   Allow 1.2.3.4/32
        	            	-✅ ACL rule 192.168.1.0/30 successfully added.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       23007  tcp       inbound    allow   Allow All
        	            	-1.2.3.4/32      23007  tcp       inbound    allow   Allow 1.2.3.4/32
        	            	-192.168.1.0/30  23007  tcp       inbound    allow   Allow 192.168.1.0/30
        	            	-✅ ACL rule 10.10.10.10/32 successfully added.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       23007  tcp       inbound    allow   Allow All
        	            	-1.2.3.4/32      23007  tcp       inbound    allow   Allow 1.2.3.4/32
        	            	-10.10.10.10/32  23007  tcp       inbound    allow   Allow 10.10.10.10/32
        	            	-192.168.1.0/30  23007  tcp       inbound    allow   Allow 192.168.1.0/30
        	            	 🟩🟩🟩 JSON STDOUT 🟩🟩🟩
        	            	-[
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 1.2.3.4/32"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 1.2.3.4/32 successfully added",
        	            	-      "details": ""
        	            	+{
        	            	+  "Rules": [
        	            	+    {
        	            	+      "ip": "0.0.0.0/0",
        	            	+      "port": 23007,
        	            	+      "protocol": "tcp",
        	            	+      "direction": "inbound",
        	            	+      "action": "allow",
        	            	+      "description": "Allow All"
        	            	+    },
        	            	+    {
        	            	+      "ip": "1.2.3.4/32",
        	            	+      "port": 23007,
        	            	+      "protocol": "tcp",
        	            	+      "direction": "inbound",
        	            	+      "action": "allow",
        	            	+      "description": "Allow 1.2.3.4/32"
        	            	     }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 1.2.3.4/32"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/30",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 192.168.1.0/30"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 192.168.1.0/30 successfully added",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 1.2.3.4/32"
        	            	-      },
        	            	-      {
        	            	-        "ip": "10.10.10.10/32",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 10.10.10.10/32"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/30",
        	            	-        "port": 23007,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 192.168.1.0/30"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 10.10.10.10/32 successfully added",
        	            	-      "details": ""
        	            	-    }
        	            	+  ],
        	            	+  "Success": {
        	            	+    "message": "3 ACL rules successfully added",
        	            	+    "details": ""
        	            	   }
        	            	-]
        	            	+}
        	            	 
        	Test:       	Test_AddACL/Multiple
    custom_acl_test.go:46: expected rule for 10.10.10.10/32, got none
    custom_acl_test.go:46: expected rule for 192.168.1.0/30, got none
--- FAIL: Test_AddACL/Multiple (0.03s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_AddACL/Multiple_with_description
Stack Traces | 0.03s run time
=== RUN   Test_AddACL/Multiple_with_description
=== PAUSE Test_AddACL/Multiple_with_description
=== CONT  Test_AddACL/Multiple_with_description
    custom_acl_test.go:67: 
        	Error Trace:	.../scaleway-cli/core/testing.go:747
        	            				.../scaleway-cli/core/testing.go:660
        	            				.../scaleway-cli/core/testing.go:498
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ ACL rule 1.2.3.4/32 successfully added.\nIP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0   13907  tcp       inbound    allow   Allow All\n1.2.3.4/32  13907  tcp       inbound    allow   some-unique-description\n✅ ACL rule 192.168.1.0/30 successfully added.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       13907  tcp       inbound    allow   Allow All\n1.2.3.4/32      13907  tcp       inbound    allow   some-unique-description\n192.168.1.0/30  13907  tcp       inbound    allow   some-unique-description\n✅ ACL rule 10.10.10.10/32 successfully added.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       13907  tcp       inbound    allow   Allow All\n1.2.3.4/32      13907  tcp       inbound    allow   some-unique-description\n10.10.10.10/32  13907  tcp       inbound    allow   some-unique-description\n192.168.1.0/30  13907  tcp       inbound    allow   some-unique-description\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n[\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 1.2.3.4/32 successfully added\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      },\n      {\n        \"ip\": \"192.168.1.0/30\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 192.168.1.0/30 successfully added\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"1.2.3.4/32\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      },\n      {\n        \"ip\": \"10.10.10.10/32\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      },\n      {\n        \"ip\": \"192.168.1.0/30\",\n        \"port\": 13907,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"some-unique-description\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 10.10.10.10/32 successfully added\",\n      \"details\": \"\"\n    }\n  }\n]\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ 3 ACL rules successfully added.\nIP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0   13907  tcp       inbound    allow   Allow All\n1.2.3.4/32  13907  tcp       inbound    allow   some-unique-description\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n{\n  \"Rules\": [\n    {\n      \"ip\": \"0.0.0.0/0\",\n      \"port\": 13907,\n      \"protocol\": \"tcp\",\n      \"direction\": \"inbound\",\n      \"action\": \"allow\",\n      \"description\": \"Allow All\"\n    },\n    {\n      \"ip\": \"1.2.3.4/32\",\n      \"port\": 13907,\n      \"protocol\": \"tcp\",\n      \"direction\": \"inbound\",\n      \"action\": \"allow\",\n      \"description\": \"some-unique-description\"\n    }\n  ],\n  \"Success\": {\n    \"message\": \"3 ACL rules successfully added\",\n    \"details\": \"\"\n  }\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,3 +2,3 @@
        	            	 🟩🟩🟩 STDOUT️ 🟩🟩🟩️
        	            	-✅ ACL rule 1.2.3.4/32 successfully added.
        	            	+✅ 3 ACL rules successfully added.
        	            	 IP          PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	@@ -6,112 +6,27 @@
        	            	 1.2.3.4/32  13907  tcp       inbound    allow   some-unique-description
        	            	-✅ ACL rule 192.168.1.0/30 successfully added.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       13907  tcp       inbound    allow   Allow All
        	            	-1.2.3.4/32      13907  tcp       inbound    allow   some-unique-description
        	            	-192.168.1.0/30  13907  tcp       inbound    allow   some-unique-description
        	            	-✅ ACL rule 10.10.10.10/32 successfully added.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       13907  tcp       inbound    allow   Allow All
        	            	-1.2.3.4/32      13907  tcp       inbound    allow   some-unique-description
        	            	-10.10.10.10/32  13907  tcp       inbound    allow   some-unique-description
        	            	-192.168.1.0/30  13907  tcp       inbound    allow   some-unique-description
        	            	 🟩🟩🟩 JSON STDOUT 🟩🟩🟩
        	            	-[
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 1.2.3.4/32 successfully added",
        	            	-      "details": ""
        	            	+{
        	            	+  "Rules": [
        	            	+    {
        	            	+      "ip": "0.0.0.0/0",
        	            	+      "port": 13907,
        	            	+      "protocol": "tcp",
        	            	+      "direction": "inbound",
        	            	+      "action": "allow",
        	            	+      "description": "Allow All"
        	            	+    },
        	            	+    {
        	            	+      "ip": "1.2.3.4/32",
        	            	+      "port": 13907,
        	            	+      "protocol": "tcp",
        	            	+      "direction": "inbound",
        	            	+      "action": "allow",
        	            	+      "description": "some-unique-description"
        	            	     }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/30",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 192.168.1.0/30 successfully added",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "1.2.3.4/32",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      },
        	            	-      {
        	            	-        "ip": "10.10.10.10/32",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/30",
        	            	-        "port": 13907,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "some-unique-description"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 10.10.10.10/32 successfully added",
        	            	-      "details": ""
        	            	-    }
        	            	+  ],
        	            	+  "Success": {
        	            	+    "message": "3 ACL rules successfully added",
        	            	+    "details": ""
        	            	   }
        	            	-]
        	            	+}
        	            	 
        	Test:       	Test_AddACL/Multiple_with_description
    custom_acl_test.go:67: expected rule for 192.168.1.0/30, got none
    custom_acl_test.go:67: expected rule for 10.10.10.10/32, got none
--- FAIL: Test_AddACL/Multiple_with_description (0.03s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_DeleteACL/Multiple_when_not_set
Stack Traces | 0.03s run time
=== RUN   Test_DeleteACL/Multiple_when_not_set
=== PAUSE Test_DeleteACL/Multiple_when_not_set
=== CONT  Test_DeleteACL/Multiple_when_not_set
    custom_acl_test.go:127: 
        	Error Trace:	.../scaleway-cli/core/testing.go:747
        	            				.../scaleway-cli/core/testing.go:660
        	            				.../scaleway-cli/core/testing.go:498
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ ACL rule 1.2.3.4/32 was not set.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       10511  tcp       inbound    allow   Allow All\n192.168.1.0/32  10511  tcp       inbound    allow   Allow 192.168.1.0/32\n✅ ACL rule 192.168.1.0/32 successfully deleted.\nIP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0  10511  tcp       inbound    allow   Allow All\n✅ ACL rule 10.10.10.10/32 was not set.\nIP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0  10511  tcp       inbound    allow   Allow All\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n[\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10511,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"192.168.1.0/32\",\n        \"port\": 10511,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 192.168.1.0/32\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 1.2.3.4/32 was not set\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10511,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 192.168.1.0/32 successfully deleted\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10511,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 10.10.10.10/32 was not set\",\n      \"details\": \"\"\n    }\n  }\n]\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲\n🟥🟥🟥 STDERR️️ 🟥🟥🟥️\nMissing required argument 'acl-rule-ips'\n🟥🟥🟥 JSON STDERR 🟥🟥🟥\n{\n  \"message\": \"missing required argument 'acl-rule-ips'\",\n  \"error\": {}\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,72 +1,9 @@
        	            	-🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
        	            	-🟩🟩🟩 STDOUT️ 🟩🟩🟩️
        	            	-✅ ACL rule 1.2.3.4/32 was not set.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       10511  tcp       inbound    allow   Allow All
        	            	-192.168.1.0/32  10511  tcp       inbound    allow   Allow 192.168.1.0/32
        	            	-✅ ACL rule 192.168.1.0/32 successfully deleted.
        	            	-IP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0  10511  tcp       inbound    allow   Allow All
        	            	-✅ ACL rule 10.10.10.10/32 was not set.
        	            	-IP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0  10511  tcp       inbound    allow   Allow All
        	            	-🟩🟩🟩 JSON STDOUT 🟩🟩🟩
        	            	-[
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10511,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/32",
        	            	-        "port": 10511,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 192.168.1.0/32"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 1.2.3.4/32 was not set",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10511,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 192.168.1.0/32 successfully deleted",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10511,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 10.10.10.10/32 was not set",
        	            	-      "details": ""
        	            	-    }
        	            	-  }
        	            	-]
        	            	+🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
        	            	+🟥🟥🟥 STDERR️️ 🟥🟥🟥️
        	            	+Missing required argument 'acl-rule-ips'
        	            	+🟥🟥🟥 JSON STDERR 🟥🟥🟥
        	            	+{
        	            	+  "message": "missing required argument 'acl-rule-ips'",
        	            	+  "error": {}
        	            	+}
        	            	 
        	Test:       	Test_DeleteACL/Multiple_when_not_set
    custom_acl_test.go:127: action is undefined for this type
--- FAIL: Test_DeleteACL/Multiple_when_not_set (0.03s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_DeleteACL/Multiple_when_set
Stack Traces | 0.03s run time
=== RUN   Test_DeleteACL/Multiple_when_set
=== PAUSE Test_DeleteACL/Multiple_when_set
=== CONT  Test_DeleteACL/Multiple_when_set
    custom_acl_test.go:107: 
        	Error Trace:	.../scaleway-cli/core/testing.go:747
        	            				.../scaleway-cli/core/testing.go:660
        	            				.../scaleway-cli/core/testing.go:498
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ ACL rule 1.2.3.4/32 successfully deleted.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       10411  tcp       inbound    allow   Allow All\n10.10.10.10/32  10411  tcp       inbound    allow   Allow 10.10.10.10/32\n192.168.1.0/32  10411  tcp       inbound    allow   Allow 192.168.1.0/32\n✅ ACL rule 192.168.1.0/32 successfully deleted.\nIP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0       10411  tcp       inbound    allow   Allow All\n10.10.10.10/32  10411  tcp       inbound    allow   Allow 10.10.10.10/32\n✅ ACL rule 10.10.10.10/32 successfully deleted.\nIP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n0.0.0.0/0  10411  tcp       inbound    allow   Allow All\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n[\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"10.10.10.10/32\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 10.10.10.10/32\"\n      },\n      {\n        \"ip\": \"192.168.1.0/32\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 192.168.1.0/32\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 1.2.3.4/32 successfully deleted\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      },\n      {\n        \"ip\": \"10.10.10.10/32\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow 10.10.10.10/32\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 192.168.1.0/32 successfully deleted\",\n      \"details\": \"\"\n    }\n  },\n  {\n    \"Rules\": [\n      {\n        \"ip\": \"0.0.0.0/0\",\n        \"port\": 10411,\n        \"protocol\": \"tcp\",\n        \"direction\": \"inbound\",\n        \"action\": \"allow\",\n        \"description\": \"Allow All\"\n      }\n    ],\n    \"Success\": {\n      \"message\": \"ACL rule 10.10.10.10/32 successfully deleted\",\n      \"details\": \"\"\n    }\n  }\n]\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲\n🟥🟥🟥 STDERR️️ 🟥🟥🟥️\nMissing required argument 'acl-rule-ips'\n🟥🟥🟥 JSON STDERR 🟥🟥🟥\n{\n  \"message\": \"missing required argument 'acl-rule-ips'\",\n  \"error\": {}\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,90 +1,9 @@
        	            	-🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
        	            	-🟩🟩🟩 STDOUT️ 🟩🟩🟩️
        	            	-✅ ACL rule 1.2.3.4/32 successfully deleted.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       10411  tcp       inbound    allow   Allow All
        	            	-10.10.10.10/32  10411  tcp       inbound    allow   Allow 10.10.10.10/32
        	            	-192.168.1.0/32  10411  tcp       inbound    allow   Allow 192.168.1.0/32
        	            	-✅ ACL rule 192.168.1.0/32 successfully deleted.
        	            	-IP              PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0       10411  tcp       inbound    allow   Allow All
        	            	-10.10.10.10/32  10411  tcp       inbound    allow   Allow 10.10.10.10/32
        	            	-✅ ACL rule 10.10.10.10/32 successfully deleted.
        	            	-IP         PORT   PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-0.0.0.0/0  10411  tcp       inbound    allow   Allow All
        	            	-🟩🟩🟩 JSON STDOUT 🟩🟩🟩
        	            	-[
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "10.10.10.10/32",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 10.10.10.10/32"
        	            	-      },
        	            	-      {
        	            	-        "ip": "192.168.1.0/32",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 192.168.1.0/32"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 1.2.3.4/32 successfully deleted",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      },
        	            	-      {
        	            	-        "ip": "10.10.10.10/32",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow 10.10.10.10/32"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 192.168.1.0/32 successfully deleted",
        	            	-      "details": ""
        	            	-    }
        	            	-  },
        	            	-  {
        	            	-    "Rules": [
        	            	-      {
        	            	-        "ip": "0.0.0.0/0",
        	            	-        "port": 10411,
        	            	-        "protocol": "tcp",
        	            	-        "direction": "inbound",
        	            	-        "action": "allow",
        	            	-        "description": "Allow All"
        	            	-      }
        	            	-    ],
        	            	-    "Success": {
        	            	-      "message": "ACL rule 10.10.10.10/32 successfully deleted",
        	            	-      "details": ""
        	            	-    }
        	            	-  }
        	            	-]
        	            	+🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
        	            	+🟥🟥🟥 STDERR️️ 🟥🟥🟥️
        	            	+Missing required argument 'acl-rule-ips'
        	            	+🟥🟥🟥 JSON STDERR 🟥🟥🟥
        	            	+{
        	            	+  "message": "missing required argument 'acl-rule-ips'",
        	            	+  "error": {}
        	            	+}
        	            	 
        	Test:       	Test_DeleteACL/Multiple_when_set
    custom_acl_test.go:107: action is undefined for this type
--- FAIL: Test_DeleteACL/Multiple_when_set (0.03s)
github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1::Test_DeleteACL/Simple
Stack Traces | 0.03s run time
=== RUN   Test_DeleteACL/Simple
=== PAUSE Test_DeleteACL/Simple
=== CONT  Test_DeleteACL/Simple
    custom_acl_test.go:90: 
        	Error Trace:	.../scaleway-cli/core/testing.go:747
        	            				.../scaleway-cli/core/testing.go:660
        	            				.../scaleway-cli/core/testing.go:498
        	Error:      	Not equal: 
        	            	expected: "🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲\n🟩🟩🟩 STDOUT️ 🟩🟩🟩️\n✅ ACL rule 0.0.0.0/0 successfully deleted.\nIP   PORT  PROTOCOL  DIRECTION  ACTION  DESCRIPTION\n🟩🟩🟩 JSON STDOUT 🟩🟩🟩\n{\n  \"Rules\": null,\n  \"Success\": {\n    \"message\": \"ACL rule 0.0.0.0/0 successfully deleted\",\n    \"details\": \"\"\n  }\n}\n"
        	            	actual  : "🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲\n🟥🟥🟥 STDERR️️ 🟥🟥🟥️\nMissing required argument 'acl-rule-ips'\n🟥🟥🟥 JSON STDERR 🟥🟥🟥\n{\n  \"message\": \"missing required argument 'acl-rule-ips'\",\n  \"error\": {}\n}\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,12 +1,8 @@
        	            	-🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
        	            	-🟩🟩🟩 STDOUT️ 🟩🟩🟩️
        	            	-✅ ACL rule 0.0.0.0/0 successfully deleted.
        	            	-IP   PORT  PROTOCOL  DIRECTION  ACTION  DESCRIPTION
        	            	-🟩🟩🟩 JSON STDOUT 🟩🟩🟩
        	            	+🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
        	            	+🟥🟥🟥 STDERR️️ 🟥🟥🟥️
        	            	+Missing required argument 'acl-rule-ips'
        	            	+🟥🟥🟥 JSON STDERR 🟥🟥🟥
        	            	 {
        	            	-  "Rules": null,
        	            	-  "Success": {
        	            	-    "message": "ACL rule 0.0.0.0/0 successfully deleted",
        	            	-    "details": ""
        	            	-  }
        	            	+  "message": "missing required argument 'acl-rule-ips'",
        	            	+  "error": {}
        	            	 }
        	Test:       	Test_DeleteACL/Simple
    custom_acl_test.go:90: action is undefined for this type
--- FAIL: Test_DeleteACL/Simple (0.03s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rdb Managed MySQL and PostgreSQL issues, bugs and feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rdb: acl: handle multiple descriptions when adding ACLs

3 participants