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

SIGSEGV on generating resources with a spec without x-kuadrant extensions #65

Merged
merged 1 commit into from
Apr 29, 2024
Merged
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
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 {
jasonmadigan marked this conversation as resolved.
Show resolved Hide resolved
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
Loading