diff --git a/cmd/scw/testdata/test-all-usage-k8s-acl-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-acl-usage.golden new file mode 100644 index 0000000000..ed9561c3ab --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-k8s-acl-usage.golden @@ -0,0 +1,15 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules. + +USAGE: + scw k8s acl + +FLAGS: + -h, --help help for acl + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-k8s-usage.golden b/cmd/scw/testdata/test-all-usage-k8s-usage.golden index e575455463..b2b1d347e1 100644 --- a/cmd/scw/testdata/test-all-usage-k8s-usage.golden +++ b/cmd/scw/testdata/test-all-usage-k8s-usage.golden @@ -6,6 +6,7 @@ USAGE: scw k8s AVAILABLE COMMANDS: + acl Access Control List (ACL) management commands cluster Kapsule cluster management commands cluster-type Cluster type management commands kubeconfig Manage your Kubernetes Kapsule cluster's kubeconfig files diff --git a/docs/commands/k8s.md b/docs/commands/k8s.md index a03bce77c1..9430786040 100644 --- a/docs/commands/k8s.md +++ b/docs/commands/k8s.md @@ -2,6 +2,7 @@ # Documentation for `scw k8s` This API allows you to manage Kubernetes Kapsule and Kosmos clusters. +- [Access Control List (ACL) management commands](#access-control-list-(acl)-management-commands) - [Kapsule cluster management commands](#kapsule-cluster-management-commands) - [Create a new Cluster](#create-a-new-cluster) - [Delete a Cluster](#delete-a-cluster) @@ -40,6 +41,20 @@ This API allows you to manage Kubernetes Kapsule and Kosmos clusters. - [List all available Versions](#list-all-available-versions) +## Access Control List (ACL) management commands + +Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules. + +Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules. + +**Usage:** + +``` +scw k8s acl +``` + + + ## Kapsule cluster management commands A cluster is a fully managed Kubernetes cluster diff --git a/go.mod b/go.mod index 19f5ba0bfb..8054ce2984 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/mattn/go-isatty v0.0.20 github.com/moby/buildkit v0.13.2 github.com/opencontainers/go-digest v1.0.0 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725041911-1cd5fcfaf214 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725100043-c4e7d505fef5 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 24c46e01b5..889a0b1309 100644 --- a/go.sum +++ b/go.sum @@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI= github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725041911-1cd5fcfaf214 h1:OvbLG2G2BmPcxjarPKe/6dC17INl7SSr6q8f11tT0ho= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725041911-1cd5fcfaf214/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725100043-c4e7d505fef5 h1:4QeufrUuqSmaDRLyEUAk6bLrARCruhfxWL5kVr0VVg8= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29.0.20240725100043-c4e7d505fef5/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA= diff --git a/internal/namespaces/instance/v1/testdata/test-create-server-scratch-storage-default-scratch-storage.golden b/internal/namespaces/instance/v1/testdata/test-create-server-scratch-storage-default-scratch-storage.golden index e18382e7e4..2e2eb31845 100644 --- a/internal/namespaces/instance/v1/testdata/test-create-server-scratch-storage-default-scratch-storage.golden +++ b/internal/namespaces/instance/v1/testdata/test-create-server-scratch-storage-default-scratch-storage.golden @@ -51,7 +51,6 @@ Bootscript x86_64 mainline 4.4.230 rev1 BootType local Volumes.0.ID 08424d6f-cf09-4498-94b5-042ef6eb38f1 Volumes.0.Name Ubuntu Jammy GPU OS 12 passthrough -Volumes.0.ExportURI - Volumes.0.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Volumes.0.Server.ID 475ad734-23b2-4f8d-b5be-6d08cc547079 Volumes.0.Server.Name cli-srv-dazzling-einstein @@ -65,7 +64,6 @@ Volumes.0.Boot false Volumes.0.Zone fr-par-2 Volumes.1.ID 318bd18f-ef0c-4595-825b-097757fdf331 Volumes.1.Name default-cli-scratch-volume -Volumes.1.ExportURI - Volumes.1.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Volumes.1.Server.ID 475ad734-23b2-4f8d-b5be-6d08cc547079 Volumes.1.Server.Name cli-srv-dazzling-einstein @@ -173,7 +171,7 @@ Zone fr-par-2 "0": { "id": "08424d6f-cf09-4498-94b5-042ef6eb38f1", "name": "Ubuntu Jammy GPU OS 12 passthrough", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "475ad734-23b2-4f8d-b5be-6d08cc547079", @@ -191,7 +189,7 @@ Zone fr-par-2 "1": { "id": "318bd18f-ef0c-4595-825b-097757fdf331", "name": "default-cli-scratch-volume", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "475ad734-23b2-4f8d-b5be-6d08cc547079", diff --git a/internal/namespaces/instance/v1/testdata/test-create-server-simple-default.golden b/internal/namespaces/instance/v1/testdata/test-create-server-simple-default.golden index 8061049044..38b900850d 100644 --- a/internal/namespaces/instance/v1/testdata/test-create-server-simple-default.golden +++ b/internal/namespaces/instance/v1/testdata/test-create-server-simple-default.golden @@ -51,7 +51,6 @@ Bootscript x86_64 mainline 4.4.230 rev1 BootType local Volumes.0.ID b2a541e6-cd3a-418d-9cb2-c3e10ae4b3f3 Volumes.0.Name Ubuntu 22.04 Jammy Jellyfish -Volumes.0.ExportURI - Volumes.0.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Volumes.0.Server.ID 3aafe9b5-d477-4eb3-b7b0-9c8777302878 Volumes.0.Server.Name cli-srv-dreamy-haslett @@ -159,7 +158,7 @@ Zone fr-par-1 "0": { "id": "b2a541e6-cd3a-418d-9cb2-c3e10ae4b3f3", "name": "Ubuntu 22.04 Jammy Jellyfish", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "3aafe9b5-d477-4eb3-b7b0-9c8777302878", diff --git a/internal/namespaces/instance/v1/testdata/test-get-server-simple.golden b/internal/namespaces/instance/v1/testdata/test-get-server-simple.golden index b82407fe54..1451df42e1 100644 --- a/internal/namespaces/instance/v1/testdata/test-get-server-simple.golden +++ b/internal/namespaces/instance/v1/testdata/test-get-server-simple.golden @@ -153,7 +153,7 @@ ID MAC ADDRESS PRIVATE NETWORK NAME PRIVATE NETWORK ID "0": { "id": "a6abb479-db47-4429-900f-b0ce63e3c6f3", "name": "Ubuntu 18.04 Bionic Beaver", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "75b0d534-42c9-4d62-862f-27aa7efebc6b", @@ -184,7 +184,7 @@ ID MAC ADDRESS PRIVATE NETWORK NAME PRIVATE NETWORK ID { "id": "a6abb479-db47-4429-900f-b0ce63e3c6f3", "name": "Ubuntu 18.04 Bionic Beaver", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "75b0d534-42c9-4d62-862f-27aa7efebc6b", diff --git a/internal/namespaces/instance/v1/testdata/test-server-action-manual-poweron.golden b/internal/namespaces/instance/v1/testdata/test-server-action-manual-poweron.golden index 2b088a33a3..8bd682866f 100644 --- a/internal/namespaces/instance/v1/testdata/test-server-action-manual-poweron.golden +++ b/internal/namespaces/instance/v1/testdata/test-server-action-manual-poweron.golden @@ -55,7 +55,6 @@ Bootscript x86_64 mainline 4.4.230 rev1 BootType local Volumes.0.ID 2c0392b4-a294-46d8-a393-39f4bfacf77f Volumes.0.Name Ubuntu 22.04 Jammy Jellyfish -Volumes.0.ExportURI - Volumes.0.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Volumes.0.Server.ID 41687115-b01c-4ebd-a78e-695a01433a77 Volumes.0.Server.Name cli-srv-youthful-lederberg @@ -172,7 +171,7 @@ Zone fr-par-1 "0": { "id": "2c0392b4-a294-46d8-a393-39f4bfacf77f", "name": "Ubuntu 22.04 Jammy Jellyfish", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "41687115-b01c-4ebd-a78e-695a01433a77", diff --git a/internal/namespaces/instance/v1/testdata/test-server-enable-routed-ip-simple.golden b/internal/namespaces/instance/v1/testdata/test-server-enable-routed-ip-simple.golden index b9974fb23e..263ebf944b 100644 --- a/internal/namespaces/instance/v1/testdata/test-server-enable-routed-ip-simple.golden +++ b/internal/namespaces/instance/v1/testdata/test-server-enable-routed-ip-simple.golden @@ -55,7 +55,6 @@ Bootscript x86_64 mainline 4.4.230 rev1 BootType local Volumes.0.ID 8c935774-18e4-4747-8765-820399eaaab8 Volumes.0.Name Ubuntu 22.04 Jammy Jellyfish -Volumes.0.ExportURI - Volumes.0.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Volumes.0.Server.ID 1ffc7827-8cdc-48b9-a203-860a05499050 Volumes.0.Server.Name cli-srv-condescending-faraday @@ -172,7 +171,7 @@ Zone fr-par-3 "0": { "id": "8c935774-18e4-4747-8765-820399eaaab8", "name": "Ubuntu 22.04 Jammy Jellyfish", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "1ffc7827-8cdc-48b9-a203-860a05499050", diff --git a/internal/namespaces/instance/v1/testdata/test-server-update-simple.golden b/internal/namespaces/instance/v1/testdata/test-server-update-simple.golden index 69d5d6c3c8..f1a6f232c2 100644 --- a/internal/namespaces/instance/v1/testdata/test-server-update-simple.golden +++ b/internal/namespaces/instance/v1/testdata/test-server-update-simple.golden @@ -51,7 +51,6 @@ Server.Bootscript x86_64 mainline 4.4.230 rev1 Server.BootType local Server.Volumes.0.ID 5af49971-524e-4cc5-9919-55824de6a87b Server.Volumes.0.Name Ubuntu 18.04 Bionic Beaver -Server.Volumes.0.ExportURI - Server.Volumes.0.Organization ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b Server.Volumes.0.Server.ID a3be4ab5-651a-4136-9a41-ec47da2ca7d2 Server.Volumes.0.Server.Name cli-srv-epic-cohen @@ -160,7 +159,7 @@ Server.Zone fr-par-1 "0": { "id": "5af49971-524e-4cc5-9919-55824de6a87b", "name": "Ubuntu 18.04 Bionic Beaver", - "export_uri": "", + "export_uri": null, "organization": "ee7bd9e1-9cbd-4724-b2f4-19e50f3cf38b", "server": { "id": "a3be4ab5-651a-4136-9a41-ec47da2ca7d2", diff --git a/internal/namespaces/k8s/v1/k8s_cli.go b/internal/namespaces/k8s/v1/k8s_cli.go index 69886d5a63..87c61f3918 100644 --- a/internal/namespaces/k8s/v1/k8s_cli.go +++ b/internal/namespaces/k8s/v1/k8s_cli.go @@ -25,6 +25,7 @@ func GetGeneratedCommands() *core.Commands { k8sNode(), k8sVersion(), k8sClusterType(), + k8sACL(), k8sClusterList(), k8sClusterCreate(), k8sClusterGet(), @@ -109,6 +110,15 @@ A cluster type represents the different commercial types of clusters offered by } } +func k8sACL() *core.Command { + return &core.Command{ + Short: `Access Control List (ACL) management commands`, + Long: `Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules.`, + Namespace: "k8s", + Resource: "acl", + } +} + func k8sClusterList() *core.Command { return &core.Command{ Short: `List Clusters`,