Skip to content

Commit

Permalink
contract check validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di committed Jan 27, 2025
1 parent cd22451 commit 5a1ac2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/namespaces/applesilicon/v1alpha1/custom_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ func serverCreateBuilder(c *core.Command) *core.Command {
args := argsI.(*applesilicon.CreateServerRequest)
client := core.ExtractClient(ctx)
contractAPI := account.NewContractAPI(client)
orgaID, _ := client.GetDefaultProjectID()
organizationID, _ := client.GetDefaultProjectID()
req := &account.ContractAPICheckContractSignatureRequest{
OrganizationID: orgaID,
OrganizationID: organizationID,
ContractType: "BAREMETAL",
ContractName: "Specific Conditions Services Baremetal",
}
contractInfo, err := contractAPI.CheckContractSignature(req)
if err != nil {
return nil, err
}
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/)"
if contractInfo.Validated {
if contractInfo != nil && contractInfo.Validated {
fmt.Println("Please note: Signing the " + appleLink + " is mandatory.")
} else {
fmt.Println("Please note: Signing the " + bareMetalLink + " and the " + appleLink + " is mandatory.")
Expand Down

0 comments on commit 5a1ac2e

Please sign in to comment.