diff --git a/docs/metal_gateway_create.md b/docs/metal_gateway_create.md index 5dbed1ce..d72683d5 100644 --- a/docs/metal_gateway_create.md +++ b/docs/metal_gateway_create.md @@ -23,11 +23,11 @@ metal gateway create -p --virtual-network ### Options ``` - -h, --help help for create - -r, --ip-reservation-id string UUID of the Public or VRF IP Reservation to assign. - -s, --private-subnet-size int32 Size of the private subnet to request (8 for /29) - -p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable. - -v, --virtual-network string UUID of the Virtual Network to assign. + -h, --help help for create + -r, --ip-reservation-id string UUID of the Public or VRF IP Reservation to assign. + -s, --private-subnet-size int Integer size of the private subnet to request (ex: 8 for Integer s29) + -p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable. + -v, --virtual-network string UUID of the Virtual Network to assign. ``` ### Options inherited from parent commands diff --git a/internal/gateway/create.go b/internal/gateway/create.go index f99d17bf..c624be34 100644 --- a/internal/gateway/create.go +++ b/internal/gateway/create.go @@ -32,7 +32,7 @@ import ( func (c *Client) Create() *cobra.Command { var projectID, vnID, reservationID string - var netSize int32 + var netSize int // createMetalGatewayCmd represents the createMetalGateway command createMetalGatewayCmd := &cobra.Command{ @@ -61,7 +61,7 @@ func (c *Client) Create() *cobra.Command { if reservationID != "" { req.MetalGatewayCreateInput.SetIpReservationId(reservationID) } else { - req.MetalGatewayCreateInput.SetPrivateIpv4SubnetSize(netSize) + req.MetalGatewayCreateInput.SetPrivateIpv4SubnetSize(int32(netSize)) } n, _, err := c.Service. @@ -95,7 +95,7 @@ func (c *Client) Create() *cobra.Command { createMetalGatewayCmd.Flags().StringVarP(&projectID, "project-id", "p", "", "The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.") createMetalGatewayCmd.Flags().StringVarP(&reservationID, "ip-reservation-id", "r", "", "UUID of the Public or VRF IP Reservation to assign.") createMetalGatewayCmd.Flags().StringVarP(&vnID, "virtual-network", "v", "", "UUID of the Virtual Network to assign.") - createMetalGatewayCmd.Flags().Int32VarP(&netSize, "private-subnet-size", "s", 0, "Size of the private subnet to request (8 for /29)") + createMetalGatewayCmd.Flags().IntVarP(&netSize, "private-subnet-size", "s", 0, "Integer size of the private subnet to request (ex: 8 for Integer s29)") _ = createMetalGatewayCmd.MarkFlagRequired("project-id") _ = createMetalGatewayCmd.MarkFlagRequired("virtual-network")