Skip to content

Commit

Permalink
Support VPC Subnets & Update to Go 1.17 (#18)
Browse files Browse the repository at this point in the history
* support vpc subnets

* update to go 1.17
  • Loading branch information
simonfuhrer authored Aug 27, 2021
1 parent f701941 commit b875aff
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
13 changes: 11 additions & 2 deletions cmd/displayers/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ func (o Subnets) TableData(w io.Writer) error {
for i, subnet := range o.Entities {
subnetIP := ""
dhcpPool := ""
vlanId := ""
if subnet.Spec.Resources.VlanID != nil {
vlanId = strconv.FormatInt(*subnet.Spec.Resources.VlanID, 10)

}
clusterName := ""
if subnet.Spec.ClusterReference != nil {
clusterName = subnet.Spec.ClusterReference.Name
}
gw := ""
if subnet.Spec.Resources.IPConfig != nil {
subnetIP = fmt.Sprintf("%s/%d", subnet.Spec.Resources.IPConfig.SubnetIP, subnet.Spec.Resources.IPConfig.PrefixLength)
Expand All @@ -83,8 +92,8 @@ func (o Subnets) TableData(w io.Writer) error {
data[i] = []string{
subnet.Metadata.UUID,
subnet.Spec.Name,
subnet.Spec.ClusterReference.Name,
strconv.FormatInt(*subnet.Spec.Resources.VlanID, 10),
clusterName,
vlanId,
subnetIP,
gw,
dhcpPool,
Expand Down
19 changes: 18 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/simonfuhrer/nutactl

go 1.16
go 1.17

require (
github.com/briandowns/spinner v1.16.0
Expand All @@ -27,3 +27,20 @@ require (
gopkg.in/yaml.v2 v2.4.0
k8s.io/client-go v11.0.0+incompatible
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
)

0 comments on commit b875aff

Please sign in to comment.