Skip to content

Commit

Permalink
Merge pull request #65 from Kuadrant/64-sigsegv-fix
Browse files Browse the repository at this point in the history
SIGSEGV on generating resources with a spec without x-kuadrant extensions
  • Loading branch information
jasonmadigan authored Apr 29, 2024
2 parents 102017b + f683cab commit a211485
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/gatewayapi/http_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func HTTPRouteObjectMetaFromOAS(doc *openapi3.T) metav1.ObjectMeta {
panic(err)
}

if kuadrantInfoExtension == nil {
return metav1.ObjectMeta{}
}

if kuadrantInfoExtension.Route == nil {
panic("info kuadrant extension route not found")
}
Expand All @@ -45,10 +49,15 @@ func HTTPRouteGatewayParentRefsFromOAS(doc *openapi3.T) []gatewayapiv1beta1.Pare
}

kuadrantInfoExtension, err := utils.NewKuadrantOASInfoExtension(doc.Info)

if err != nil {
panic(err)
}

if kuadrantInfoExtension == nil {
return nil
}

if kuadrantInfoExtension.Route == nil {
panic("info kuadrant extension route not found")
}
Expand All @@ -66,6 +75,10 @@ func HTTPRouteHostnamesFromOAS(doc *openapi3.T) []gatewayapiv1beta1.Hostname {
panic(err)
}

if kuadrantInfoExtension == nil {
return nil
}

if kuadrantInfoExtension.Route == nil {
panic("info kuadrant extension route not found")
}
Expand Down

0 comments on commit a211485

Please sign in to comment.