Skip to content

Commit

Permalink
add bgp auth key field (#1664)
Browse files Browse the repository at this point in the history
* add bgp auth key field

* update godo version
  • Loading branch information
apinonformoso authored Feb 24, 2025
1 parent 43eedfa commit 47c42a6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ const (
ArgPartnerInterconnectAttachmentBGPPeerASN = "bgp-peer-asn"
// ArgPartnerInterconnectAttachmentBGPPeerIPAddress is the BGP IP address of the peer device
ArgPartnerInterconnectAttachmentBGPPeerRouterIP = "bgp-peer-router-ip"
// ArgPartnerInterconnectAttachmentBGPAuthKey is the BGP MD5 authentication key
ArgPartnerInterconnectAttachmentBGPAuthKey = "bgp-auth-key"

// ArgReadWrite indicates a generated token should be read/write.
ArgReadWrite = "read-write"
Expand Down
6 changes: 6 additions & 0 deletions commands/partner_interconnect_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ With the Partner Interconnect Attachments commands, you can get, list, create, u
AddStringFlag(cmdPartnerIACreate, doctl.ArgPartnerInterconnectAttachmentBGPLocalRouterIP, "", "", "BGP Local Router IP")
AddIntFlag(cmdPartnerIACreate, doctl.ArgPartnerInterconnectAttachmentBGPPeerASN, "", 0, "BGP Peer ASN")
AddStringFlag(cmdPartnerIACreate, doctl.ArgPartnerInterconnectAttachmentBGPPeerRouterIP, "", "", "BGP Peer Router IP")
AddStringFlag(cmdPartnerIACreate, doctl.ArgPartnerInterconnectAttachmentBGPAuthKey, "", "", "BGP Auth Key")
cmdPartnerIACreate.Example = `The following example creates a Partner Interconnect Attachment: doctl network interconnect-attachment create --name "example-pia" --connection-bandwidth-in-mbps 50 --naas-provider "MEGAPORT" --region "nyc" --vpc-ids "c5537207-ebf0-47cb-bc10-6fac717cd672"`

interconnectAttachmentDetails := `
Expand Down Expand Up @@ -222,6 +223,11 @@ func RunPartnerInterconnectAttachmentCreate(c *CmdConfig) error {
}
bgpConfig.PeerRouterIP = bgpPeerRouterIP

bgpAuthKey, err := c.Doit.GetString(c.NS, doctl.ArgPartnerInterconnectAttachmentBGPAuthKey)
if err != nil {
bgpConfig.AuthKey = bgpAuthKey
}

pias := c.PartnerInterconnectAttachments()
pia, err := pias.Create(r)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22
require (
github.com/blang/semver v3.5.1+incompatible
github.com/creack/pty v1.1.21
github.com/digitalocean/godo v1.138.0
github.com/digitalocean/godo v1.138.1-0.20250224132306-e0a40053f51c
github.com/docker/cli v24.0.5+incompatible
github.com/docker/docker v25.0.6+incompatible
github.com/docker/docker-credential-helpers v0.7.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/digitalocean/godo v1.138.0 h1:0l0UEaVyNKvEmrn4r5NkZCpDysimJjVhLj30Gl6HgiQ=
github.com/digitalocean/godo v1.138.0/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc=
github.com/digitalocean/godo v1.138.1-0.20250224132306-e0a40053f51c h1:+XGmBXQdA8GQc+r4mU9Qo8AxubH5MjnTuK+E6DAPIy8=
github.com/digitalocean/godo v1.138.1-0.20250224132306-e0a40053f51c/go.mod h1:PU8JB6I1XYkQIdHFop8lLAY9ojp6M0XcU0TWaQSxbrc=
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rMi4aXAvodc=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ github.com/creack/pty
# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
## explicit
github.com/davecgh/go-spew/spew
# github.com/digitalocean/godo v1.138.0
# github.com/digitalocean/godo v1.138.1-0.20250224132306-e0a40053f51c
## explicit; go 1.22
github.com/digitalocean/godo
github.com/digitalocean/godo/metrics
Expand Down

0 comments on commit 47c42a6

Please sign in to comment.