Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change instance config to use the correct Reserved IP parameter #439

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func init() {
instanceCreateCmd.Flags().StringVarP(&firewall, "firewall", "l", "", "the instance's firewall you can use the Name or the ID")
instanceCreateCmd.Flags().StringVarP(&tags, "tags", "g", "", "the instance's tags")
instanceCreateCmd.Flags().StringVarP(&privateIPv4, "private_ipv4", "", "", "Private IPv4 address")
instanceCreateCmd.Flags().StringVarP(&reservedIPv4, "reservedip", "", "", "Reserved IPv4 address")
alessandroargentieri marked this conversation as resolved.
Show resolved Hide resolved
instanceCreateCmd.Flags().StringVarP(&tags, "region", "e", "", "the region code identifier to have your instance built in")
instanceCreateCmd.Flags().StringVar(&script, "script", "", "path to a script that will be uploaded to /usr/local/bin/civo-user-init-script on your instance, read/write/executable only by root and then will be executed at the end of the cloud initialization")
instanceCreateCmd.Flags().BoolVar(&skipShebangCheck, "skip-shebang-check", false, "skip the shebang line check when passing a user init script")
Expand Down
8 changes: 7 additions & 1 deletion cmd/instance/instance_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var wait bool
var hostnameCreate, size, diskimage, publicip, initialuser, sshkey, tags, network, privateIPv4, firewall string
var hostnameCreate, size, diskimage, publicip, initialuser, sshkey, tags, network, privateIPv4, reservedIPv4, firewall string
var script string
var skipShebangCheck bool

Expand Down Expand Up @@ -139,10 +139,16 @@ If you wish to use a custom format, the available fields are:
}
}

// Set public ipv4 if provided
alessandroargentieri marked this conversation as resolved.
Show resolved Hide resolved
if publicip != "" {
config.PublicIPRequired = publicip
}

// Set reserved ip if provided
if reservedIPv4 != "" {
config.ReservedIPv4 = reservedIPv4
}

// Set private_ipv4 if provided
if privateIPv4 != "" {
config.PrivateIPv4 = privateIPv4
Expand Down
Loading