From f2e54847137232e15f494c517ff07a3f71370a33 Mon Sep 17 00:00:00 2001 From: Laure-di Date: Wed, 8 Jan 2025 13:59:19 +0100 Subject: [PATCH 1/2] feat(apple-silicon): add contract message information --- .../namespaces/applesilicon/v1alpha1/custom_server.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/namespaces/applesilicon/v1alpha1/custom_server.go b/internal/namespaces/applesilicon/v1alpha1/custom_server.go index b86fa8d4c..a871ebf38 100644 --- a/internal/namespaces/applesilicon/v1alpha1/custom_server.go +++ b/internal/namespaces/applesilicon/v1alpha1/custom_server.go @@ -36,6 +36,17 @@ var serverStatusMarshalSpecs = human.EnumMarshalSpecs{ func serverCreateBuilder(c *core.Command) *core.Command { c.ArgSpecs.GetByName("type").AutoCompleteFunc = autocompleteServerType + + c.AddInterceptors(func(ctx context.Context, argsI interface{}, runner core.CommandRunner) (i interface{}, err error) { + args := argsI.(*applesilicon.CreateServerRequest) + bareMetalLink := "\u001B[38;2;121;45;212;4m\u001B]8;;https://console.scaleway.com/organization/contracts\u001B\\Bare Metal Specific Conditions\u001B]8;;\u001B\\\u001B[0m (\u001B[38;2;121;45;212mhttps://console.scaleway.com/organization/contracts\u001B[0m)" + appleLink := "\u001B[4m\u001B[38;2;121;45;212m\u001B]8;;https://www.apple.com/legal/sla/\u001B\\macOS License Agreement\u001B]8;;\u001B\\\u001B[0m (https://www.apple.com/legal/sla/)" + + fmt.Println("Please note: Signing the " + bareMetalLink + " and the " + appleLink + " is mandatory.") + return runner(ctx, args) + }, + ) + c.WaitFunc = waitForServerFunc(serverActionCreate) return c } From c7a037fa7e26ef5d74ce9b5fc2573b7eddb83500 Mon Sep 17 00:00:00 2001 From: Laure-di Date: Wed, 8 Jan 2025 14:01:37 +0100 Subject: [PATCH 2/2] feat(baremetal): add contract message information --- internal/namespaces/baremetal/v1/custom_server_create.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/namespaces/baremetal/v1/custom_server_create.go b/internal/namespaces/baremetal/v1/custom_server_create.go index fa4fb7e89..a0a3429a7 100644 --- a/internal/namespaces/baremetal/v1/custom_server_create.go +++ b/internal/namespaces/baremetal/v1/custom_server_create.go @@ -45,6 +45,11 @@ func serverCreateBuilder(c *core.Command) *core.Command { client := core.ExtractClient(ctx) api := baremetal.NewAPI(client) + bareMetalLink := "\u001B[38;2;121;45;212;4m\u001B]8;;https://console.scaleway.com/organization/contracts\u001B\\Bare Metal Specific Conditions\u001B]8;;\u001B\\\u001B[0m (\u001B[38;2;121;45;212mhttps://console.scaleway.com/organization/contracts\u001B[0m)" + appleLink := "\u001B[4m\u001B[38;2;121;45;212m\u001B]8;;https://www.apple.com/legal/sla/\u001B\\macOS License Agreement\u001B]8;;\u001B\\\u001B[0m (https://www.apple.com/legal/sla/)" + + fmt.Println("Please note: Signing the " + bareMetalLink + " and the " + appleLink + " is mandatory.") + tmpRequest := argsI.(*baremetalCreateServerRequestCustom) request := &baremetal.CreateServerRequest{ Zone: tmpRequest.Zone,