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

rm gateway-api translation error message from direct response #3878

Merged
merged 4 commits into from
Jul 18, 2024
Merged
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
3 changes: 0 additions & 3 deletions internal/gatewayapi/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ func (t *Translator) processUnresolvedHTTPFilter(errMsg string, filterContext *H
errMsg,
)
filterContext.DirectResponse = &ir.DirectResponse{
Body: &errMsg,
StatusCode: 500,
}
}
Expand All @@ -842,7 +841,6 @@ func (t *Translator) processUnsupportedHTTPFilter(filterType string, filterConte
errMsg,
)
filterContext.DirectResponse = &ir.DirectResponse{
Body: &errMsg,
StatusCode: 500,
}
}
Expand All @@ -859,7 +857,6 @@ func (t *Translator) processInvalidHTTPFilter(filterType string, filterContext *
errMsg,
)
filterContext.DirectResponse = &ir.DirectResponse{
Body: &errMsg,
StatusCode: 500,
}
}
3 changes: 0 additions & 3 deletions internal/ir/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,6 @@ func (h AddHeader) Validate() error {
// DirectResponse holds the details for returning a body and status code for a route.
// +k8s:deepcopy-gen=true
type DirectResponse struct {
// Body configures the body of the direct response. Currently only a string response
// is supported, but in the future a config.core.v3.DataSource may replace it.
Body *string `json:"body,omitempty" yaml:"body,omitempty"`
// StatusCode will be used for the direct response's status code.
StatusCode uint32 `json:"statusCode" yaml:"statusCode"`
}
Expand Down
2 changes: 0 additions & 2 deletions internal/ir/xds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ var (
Exact: ptr.To("filter-error"),
},
DirectResponse: &DirectResponse{
Body: ptr.To("invalid filter type"),
StatusCode: uint32(500),
},
}
Expand Down Expand Up @@ -297,7 +296,6 @@ var (
Exact: ptr.To("redirect"),
},
DirectResponse: &DirectResponse{
Body: ptr.To("invalid filter type"),
StatusCode: uint32(799),
},
}
Expand Down
7 changes: 1 addition & 6 deletions internal/ir/zz_generated.deepcopy.go

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

9 changes: 0 additions & 9 deletions internal/xds/translator/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,6 @@ func buildXdsURLRewriteAction(destName string, urlRewrite *ir.URLRewrite, pathMa

func buildXdsDirectResponseAction(res *ir.DirectResponse) *routev3.DirectResponseAction {
routeAction := &routev3.DirectResponseAction{Status: res.StatusCode}

if res.Body != nil {
routeAction.Body = &corev3.DataSource{
Specifier: &corev3.DataSource_InlineString{
InlineString: *res.Body,
},
}
}

return routeAction
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
name: first-listener/*
routes:
- directResponse:
body:
inlineString: 'Unknown custom filter type: UnsupportedType'
status: 500
match:
prefix: /
Expand Down