Skip to content
Closed
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/dns v0.23.1
github.com/stackitcloud/stackit-sdk-go/services/edge v0.13.2
github.com/stackitcloud/stackit-sdk-go/services/git v0.14.1
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.14.5
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.15.0
github.com/stackitcloud/stackit-sdk-go/services/intake v0.12.0
github.com/stackitcloud/stackit-sdk-go/services/logs v0.10.2
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.13.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ github.com/stackitcloud/stackit-sdk-go/services/edge v0.13.2 h1:UDkXmgOAlP3y/u7F
github.com/stackitcloud/stackit-sdk-go/services/edge v0.13.2/go.mod h1:hlUcPvOgH/CzZqH7u4SwV81qiismCVAtvw5pTAf6si4=
github.com/stackitcloud/stackit-sdk-go/services/git v0.14.1 h1:7R5peSRer3Y83mfB6wcdCP0vhEjsq4myUdVhl24q6to=
github.com/stackitcloud/stackit-sdk-go/services/git v0.14.1/go.mod h1:kz2pl17t9MNQx0+fNXg10ZAVfjmvOtsHB7VlAzu/Io8=
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.14.5 h1:CVRo4/hCy6vLlh6LQjQikTDnh/0KF43nRhKsiicxyXc=
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.14.5/go.mod h1:oJmNZY04vvjrQI+y91ZZWOQiCAREcCldkh6cib+YtP0=
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.15.0 h1:DZEd4ORWEAu3/t92xLD7ah5gCshP+n5mOYxdOzdiZLc=
github.com/stackitcloud/stackit-sdk-go/services/iaas v1.15.0/go.mod h1:o6Mt/ZUB/3qvIwtu4B57m9IlyaUxAFS2Tu5XImiZxCE=
github.com/stackitcloud/stackit-sdk-go/services/intake v0.12.0 h1:1RDIGabA3U/kWrV0vkbkTof075liEHMdn39BsNwDI4k=
github.com/stackitcloud/stackit-sdk-go/services/intake v0.12.0/go.mod h1:+v3VG6bXopAB2/uRz5yDXNFUwMSw0qJVRPxb3SDsACM=
github.com/stackitcloud/stackit-sdk-go/services/kms v1.14.0 h1:6vZhGEIEqXUcs6pzpVNsHRAcskAVuKRq9lNMCMlYn+Q=
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/network-area/route/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ func outputResult(p *print.Printer, outputFormat, networkAreaLabel string, route
routeNexthop := route.Nexthop
if routeNexthop.NexthopIPv4 != nil {
nextHop = routeNexthop.NexthopIPv4.Value
nextHopType = routeNexthop.NexthopIPv4.Type
nextHopType = string(routeNexthop.NexthopIPv4.Type)
} else if routeNexthop.NexthopIPv6 != nil {
nextHop = routeNexthop.NexthopIPv6.Value
nextHopType = routeNexthop.NexthopIPv6.Type
nextHopType = string(routeNexthop.NexthopIPv6.Type)
} else if routeNexthop.NexthopBlackhole != nil {
nextHopType = routeNexthop.NexthopBlackhole.Type
nextHopType = string(routeNexthop.NexthopBlackhole.Type)
} else if routeNexthop.NexthopInternet != nil {
nextHopType = routeNexthop.NexthopInternet.Type
nextHopType = string(routeNexthop.NexthopInternet.Type)
}

table.AddRow(
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/network-area/routingtable/route/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ func buildDestination(model *inputModel) *iaas.RouteDestination {
case destTypeCIDRv4:
return &iaas.RouteDestination{
DestinationCIDRv4: &iaas.DestinationCIDRv4{
Type: model.DestinationType,
Type: iaas.DestinationCIDRv4Type(model.DestinationType),
Value: *model.DestinationValue,
},
}
case destTypeCIDRv6:
return &iaas.RouteDestination{
DestinationCIDRv6: &iaas.DestinationCIDRv6{
Type: model.DestinationType,
Type: iaas.DestinationCIDRv6Type(model.DestinationType),
Value: *model.DestinationValue,
},
}
Expand All @@ -232,27 +232,27 @@ func buildNextHop(model *inputModel) *iaas.RouteNexthop {
case nextHopTypeIPv4:
return &iaas.RouteNexthop{
NexthopIPv4: &iaas.NexthopIPv4{
Type: model.NextHopType,
Type: iaas.NexthopIPv4Type(model.NextHopType),
Value: *model.NextHopValue,
},
}
case nextHopTypeIPv6:
return &iaas.RouteNexthop{
NexthopIPv6: &iaas.NexthopIPv6{
Type: model.NextHopType,
Type: iaas.NexthopIPv6Type(model.NextHopType),
Value: *model.NextHopValue,
},
}
case nextHopTypeInternet:
return &iaas.RouteNexthop{
NexthopInternet: &iaas.NexthopInternet{
Type: model.NextHopType,
Type: iaas.NexthopInternetType(model.NextHopType),
},
}
case nextHopTypeBlackhole:
return &iaas.RouteNexthop{
NexthopBlackhole: &iaas.NexthopBlackhole{
Type: model.NextHopType,
Type: iaas.NexthopBlackholeType(model.NextHopType),
},
}
default:
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg/services/iaas/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ func GetRouteFromAPIResponse(destination, nexthop string, routes []iaas.Route) (
nextHopV6 := route.Nexthop.NexthopIPv6
nextHopV6Matches := nextHopV6 != nil && nextHopV6.Value == nexthop
nextHopInet := route.Nexthop.NexthopInternet
nextHopInetMatches := nextHopInet != nil && nextHopInet.Type == nexthop
nextHopInetMatches := nextHopInet != nil && nextHopInet.Type == iaas.NexthopInternetType(nexthop)
nextHopBlackhole := route.Nexthop.NexthopBlackhole
nextHopBlackholeMatches := nextHopBlackhole != nil && nextHopBlackhole.Type == nexthop
nextHopBlackholeMatches := nextHopBlackhole != nil && nextHopBlackhole.Type == iaas.NexthopBlackholeType(nexthop)
nextHopMatches := nextHopV4Matches || nextHopV6Matches || nextHopInetMatches || nextHopBlackholeMatches
if nextHopMatches {
return route, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ func ExtractRouteDetails(route *iaas.Route) RouteDetails {
var routeDetails RouteDetails

if route.Destination.DestinationCIDRv4 != nil {
routeDetails.DestType = route.Destination.DestinationCIDRv4.Type
routeDetails.DestType = string(route.Destination.DestinationCIDRv4.Type)
routeDetails.DestValue = route.Destination.DestinationCIDRv4.Value
} else if route.Destination.DestinationCIDRv6 != nil {
routeDetails.DestType = route.Destination.DestinationCIDRv6.Type
routeDetails.DestType = string(route.Destination.DestinationCIDRv6.Type)
routeDetails.DestValue = route.Destination.DestinationCIDRv6.Value
}

if route.Nexthop.NexthopIPv4 != nil {
routeDetails.HopType = route.Nexthop.NexthopIPv4.Type
routeDetails.HopType = string(route.Nexthop.NexthopIPv4.Type)
routeDetails.HopValue = route.Nexthop.NexthopIPv4.Value
} else if route.Nexthop.NexthopIPv6 != nil {
routeDetails.HopType = route.Nexthop.NexthopIPv6.Type
routeDetails.HopType = string(route.Nexthop.NexthopIPv6.Type)
routeDetails.HopValue = route.Nexthop.NexthopIPv6.Value
} else if route.Nexthop.NexthopInternet != nil {
routeDetails.HopType = route.Nexthop.NexthopInternet.Type
routeDetails.HopType = string(route.Nexthop.NexthopInternet.Type)
} else if route.Nexthop.NexthopBlackhole != nil {
routeDetails.HopType = route.Nexthop.NexthopBlackhole.Type
routeDetails.HopType = string(route.Nexthop.NexthopBlackhole.Type)
}

if len(route.Labels) > 0 {
Expand Down
Loading