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

Envoy 1.26 bump (includes inja bump) #8440

Merged
merged 39 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0f4eaea
bump envoy-gloo, mod some docs
jbohanon Jul 5, 2023
182b8ac
codegen
jbohanon Jul 5, 2023
4f41e4d
doc nits
jbohanon Jul 5, 2023
c50ff2b
fix changelog
jbohanon Jul 5, 2023
689f23f
Merge refs/heads/main into envoy-gloo-bump-for-inja
soloio-bulldozer[bot] Jul 5, 2023
3a4dc1e
Merge refs/heads/main into envoy-gloo-bump-for-inja
soloio-bulldozer[bot] Jul 5, 2023
db428f4
Adding changelog file to new location
Jul 5, 2023
c5be797
Deleting changelog file from old location
Jul 5, 2023
941ca82
fix test
jbohanon Jul 5, 2023
5802baa
Merge branch 'envoy-gloo-bump-for-inja' of github.com:solo-io/gloo in…
jbohanon Jul 5, 2023
9e32685
use unreleased envoy-gloo with health checkers as extensions
jbohanon Jul 5, 2023
232c017
extra steps for unreleased envoy-gloo
jbohanon Jul 5, 2023
cc9a0ad
Merge refs/heads/main into envoy-gloo-bump-for-inja
soloio-bulldozer[bot] Jul 5, 2023
5205079
bump envoy-gloo, revert unreleased dep changes
jbohanon Jul 6, 2023
538ae4c
Update changelog/v1.15.0-beta18/envoy-gloo-bump-inja.yaml
jbohanon Jul 6, 2023
8e2a6d1
Adding changelog file to new location
Jul 12, 2023
8d62205
Deleting changelog file from old location
Jul 12, 2023
f5d481a
add new proxy_protocol field for 1.26
jbohanon Jul 13, 2023
c4296d8
Merge remote-tracking branch 'origin/main' into envoy-gloo-bump-for-inja
jbohanon Jul 13, 2023
d8cf558
proto changes to proxy_protocol
jbohanon Jul 13, 2023
6186189
codegen
jbohanon Jul 13, 2023
d4d3a85
bump go-control-plane
jbohanon Jul 13, 2023
437383b
Adding changelog file to new location
Jul 13, 2023
41e13f5
Deleting changelog file from old location
Jul 13, 2023
e40ce2e
hcm fields
jbohanon Jul 13, 2023
75e2e8a
Merge branch 'envoy-gloo-bump-for-inja' of ssh://github.com/solo-io/g…
jbohanon Jul 13, 2023
a8d54d9
Merge remote-tracking branch 'origin/main' into envoy-gloo-bump-for-inja
jbohanon Jul 13, 2023
f3dd930
Adding changelog file to new location
Jul 13, 2023
ca72cb7
Deleting changelog file from old location
Jul 13, 2023
9fcd999
remove proxy_protocol protos
jbohanon Jul 14, 2023
3afac64
codegen
jbohanon Jul 14, 2023
3835223
Merge branch 'envoy-gloo-bump-for-inja' of ssh://github.com/solo-io/g…
jbohanon Jul 14, 2023
a4f1bdc
Merge remote-tracking branch 'origin/main' into envoy-gloo-bump-for-inja
jbohanon Jul 14, 2023
c0353bb
update changelog
jbohanon Jul 14, 2023
13da354
check .proto files
jbohanon Jul 14, 2023
a76b87f
Merge refs/heads/main into envoy-gloo-bump-for-inja
soloio-bulldozer[bot] Jul 14, 2023
7f0b6f6
remove do not submit
jbohanon Jul 14, 2023
9dd18b6
Merge branch 'envoy-gloo-bump-for-inja' of ssh://github.com/solo-io/g…
jbohanon Jul 14, 2023
8c09ed7
add issue link
jbohanon Jul 14, 2023
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ z := $(shell mkdir -p $(OUTPUT_DIR))
VERSION ?= 1.0.1-dev

SOURCES := $(shell find . -name "*.go" | grep -v test.go)
ENVOY_GLOO_IMAGE ?= quay.io/solo-io/envoy-gloo:1.25.6-patch4
ENVOY_GLOO_IMAGE ?= quay.io/solo-io/envoy-gloo:1.26.2-patch3
LDFLAGS := "-X github.com/solo-io/gloo/pkg/version.Version=$(VERSION)"
GCFLAGS := all="-N -l"

Expand Down Expand Up @@ -820,4 +820,4 @@ update-licenses:

# use `make print-MAKEFILE_VAR` to print the value of MAKEFILE_VAR

print-% : ; @echo $($*)
print-% : ; @echo $($*)
9 changes: 9 additions & 0 deletions changelog/v1.15.0-beta18/envoy-gloo-bump-inja.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
changelog:
- type: DEPENDENCY_BUMP
dependencyOwner: solo-io
dependencyRepo: envoy-gloo
dependencyTag: v1.26.2-patch2
issueLink: https://github.com/solo-io/gloo/issues/8177
resolvesIssue: false
description: >-
Use latest envoy-gloo to access latest version of Inja.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@solo-io/solo-docs sorry about all of the noise in this file. The real changes are on L172, L174, L385, L388

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To review where transformations happen as Gloo Edge filters traffic, see [Traffi

## Defining a transformation
Transformations are defined by adding the `transformations` attribute to your Virtual Services. You can define this attribute on three different Virtual Service sub-resources:

- **VirtualHosts**
- **Routes**
- **WeightedDestinations**
Expand Down Expand Up @@ -100,20 +100,20 @@ routes:
{{< /highlight >}}

As stated above, the route's configuration will override its parent's, but now it also inherits the parent's transformations. So in this case,
routes matching `/parent` will also be transformed. If `inheritTransformation` was set to `false`, this would not be the case.
routes matching `/parent` will also be transformed. If `inheritTransformation` was set to `false`, this would not be the case.
Note that only the first matched transformation will run, so if both the child and the parent had the same matchers, the child's transformation
would run.

### Configuration format
Learn more about the properties that you can set in the `stagedTransformations` {{< protobuf display="object" name="transformation.options.gloo.solo.io.TransformationStages" >}} section of your YAML file.
Learn more about the properties that you can set in the `stagedTransformations` {{< protobuf display="object" name="transformation.options.gloo.solo.io.TransformationStages" >}} section of your YAML file.

The following YAML file shows a sample structure for how to configure request and response transformations in the `stagedTransformations` section:
The following YAML file shows a sample structure for how to configure request and response transformations in the `stagedTransformations` section:

```yaml
stagedTransformations:
early:
# early transformations
regular:
regular:
requestTransforms:
- matcher:
prefix : '/'
Expand All @@ -124,7 +124,7 @@ stagedTransformations:
inheritTransformations: bool
```

The `early` and `regular` attributes are used to specify when in the envoy filter chain the transformations run. For request transformations, early transformations are applied before regular transformations as shown in the following diagram. For response transformations, this order is reversed, and regular transformations are applied before early transformations. To learn more about the order in which envoy filters are applied, see [HTTP filter chain processing](https://www.envoyproxy.io/docs/envoy/latest/intro/life_of_a_request#http-filter-chain-processing) in the envoy documentation.
The `early` and `regular` attributes are used to specify when in the envoy filter chain the transformations run. For request transformations, early transformations are applied before regular transformations as shown in the following diagram. For response transformations, this order is reversed, and regular transformations are applied before early transformations. To learn more about the order in which envoy filters are applied, see [HTTP filter chain processing](https://www.envoyproxy.io/docs/envoy/latest/intro/life_of_a_request#http-filter-chain-processing) in the envoy documentation.

![Transformation Filter Stages]({{% versioned_link_path fromRoot="/img/transformation_stages.png" %}})

Expand All @@ -139,7 +139,7 @@ The `requestTransformation` and `responseTransformation` attributes have the {{<
- `headerBodyTransform`: This type of transformation makes all the headers available in the body and returns a JSON body that consists of two attributes: `headers`, containing the headers, and `body`, containing the original body.
- If `addRequestMetadata` is true, `queryString`, `queryStringParameters`, `multiValueQueryStringParameters`, `httpMethod`, `path`, and `multiValueHeaders` will additionally be present in the body.
- `transformationTemplate`: This type of transformation allows you to define transformation templates. This is the more powerful and flexible type of transformation. For more information, see [Transformation templates](#transformation-templates).
- `xsltTransformation`: This type of transformation allows you to use the XSLT transformation language to describe your transformation. For more information, see [XSLT Transformation](#xslt-transformation).
- `xsltTransformation`: This type of transformation allows you to use the XSLT transformation language to describe your transformation. For more information, see [XSLT Transformation](#xslt-transformation).

The `inheritTransformation` attribute allows child routes to inherit transformations from their parent RouteTables and/or VirtualHosts. For more information, see [Inheritance rules](#inheritance-rules).

Expand All @@ -153,7 +153,7 @@ transformationTemplate:
extractors: {}
headers: {}
# Only one of body, passthrough, and mergeExtractorsToBody can be specified
body: {}
body: {}
passthrough: {}
mergeExtractorsToBody: {}
dynamicMetadataValues: []
Expand All @@ -171,9 +171,9 @@ Let's go ahead and describe each one of these attributes in detail.
By default, `transformationTemplate` parses the request/response body as JSON, depending on whether you configure a `requestTransformation` or `responseTransformation`. If Gloo Edge fails to parse the request/response body as JSON, it returns a `400 Bad Request` error.

If you want to skip this behavior, you can:
* Set the [`parseBodyBehavior`](#parsebodybehavior) attribute to `DontParse`. Edge treats the body as plain text and does not parse it.
* Set the [`parseBodyBehavior`](#parsebodybehavior) attribute to `DontParse`. Edge buffers the body as plain text and does not parse it.
* Set the [`ignoreErrorOnParse`](#ignoreerroronparse) attribute to `true`. Edge parses the body as JSON, but does not return an error if the body is not valid JSON.
* Enable [`passthrough`](#passthrough). Edge does not parse the body.
* Enable [`passthrough`](#passthrough). Edge does not parse or buffer the body.
{{% /notice %}}
##### parseBodyBehavior
This attribute determines how the request/response body will be parsed and can have one of two values:
Expand All @@ -191,7 +191,7 @@ By default, Gloo Edge will attempt to parse the body as JSON, unless you have `D
Implicit in this setting is that the body will be buffered and available. If you're looking to skip any body buffering completely, see the section [on passthrough: {}](#passthrough)

##### extractors
Use this attribute to extract information from a request or response. It consists of a set of mappings from a string to an `extraction`:
Use this attribute to extract information from a request or response. It consists of a set of mappings from a string to an `extraction`:

- the `extraction` defines which information will be extracted
- the string key will provide the extractor with a name it can be referred by.
Expand Down Expand Up @@ -311,7 +311,7 @@ As an example, the following configuration snippet could be used to transform a
```yaml
transformationTemplate:
# [...]
body:
body:
text: '{% if header(":status") == "404" %}{ "error": "Not found!" }{% else %}{{ body() }}{% endif %}'
# [...]
```
Expand All @@ -328,7 +328,7 @@ transformationTemplate:
# [...]
```

If you're looking to parse the body, and either [ignore errors on parsing](#ignoreerroronparse), or just [disable JSON parsing](#parsebodybehavior), see those sections in this document, respectively.
If you're looking to parse the body, and either [ignore errors on parsing](#ignoreerroronparse), or just [disable JSON parsing](#parsebodybehavior), see those sections in this document, respectively.

##### mergeExtractorsToBody
Use this type of body transformation to merge all the `extractions` defined in the `transformationTemplate` to the body. The values of the extractions will be merged to a location in the body JSON determined by their names. You can use separators in the extractor names to nest elements inside the body.
Expand Down Expand Up @@ -362,7 +362,7 @@ This will cause the resulting body to include the following extra attributes (in
##### dynamicMetadataValues
This attribute can be used to define an [Envoy Dynamic Metadata](https://www.envoyproxy.io/docs/envoy/latest/configuration/advanced/well_known_dynamic_metadata) entry. This metadata can be used by other filters in the filter chain to implement custom behavior.

As an example, the following configuration creates a dynamic metadata entry in the `com.example` namespace with key `foo` and value equal to that of the `foo` header .
As an example, the following configuration creates a dynamic metadata entry in the `com.example` namespace with key `foo` and value equal to that of the `foo` header.

```yaml
dynamicMetadataValues:
Expand All @@ -384,10 +384,10 @@ Please note that, if set to `true`, you will need to use the `extraction` functi

#### Templating language
{{% notice note %}}
Templates can be used only if the request/response payload is a JSON string.
Unless `parseBodyBehavior` is set to `DontParse`, templates can be used only if the request/response payload is a JSON string.
{{% /notice %}}

Gloo Edge templates are powered by the [Inja](https://github.com/pantor/inja) template engine, which is inspired by the popular [Jinja](https://palletsprojects.com/p/jinja/) templating language in Python. When writing your templates, you can take advantage of all the core _Inja_ features, i.a. loops, conditional logic, and functions.
Gloo Edge templates are powered by v3.4 of the [Inja](https://github.com/pantor/inja/tree/v3.4.0) template engine, which is inspired by the popular [Jinja](https://palletsprojects.com/p/jinja/) templating language in Python. When writing your templates, you can take advantage of all the core _Inja_ features, i.a. loops, conditional logic, and functions.

In addition to the standard functions available in the core _Inja_ library, you can use additional custom functions that we have added:

Expand All @@ -414,15 +414,15 @@ xsltTransformation:
```

##### xslt
The XSLT transformation is specified in this field as a string. Like other transformations, an invalid XSLT transformation will not be accepted and envoy
The XSLT transformation is specified in this field as a string. Like other transformations, an invalid XSLT transformation will not be accepted and envoy
validation will reject the transformation configuration.

##### setContentType
XSLT transformations can be used to transform HTTP body between content type. For example, from [XML to JSON](https://www.w3.org/TR/xslt-30/#func-xml-to-json), or [JSON to XML](https://www.w3.org/TR/xslt-30/#func-json-to-xml).
In the case of these transformations, the `content-type` HTTP header is set to the value of `setContentType`. If left empty, the `content-type` header is unchanged.

##### nonXmlTransform
XSLT transformations typically accept only XML as input. If the input to the transformation is not XML, this should be set to true. For example, if
XSLT transformations typically accept only XML as input. If the input to the transformation is not XML, this should be set to true. For example, if
the XSLT transformation is transforming a JSON input to XML, this would be set to `true`. By default, this is false and the XSLT transformation will only accept XML input.

### Common use cases
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ message TransformationTemplate {
// The request/response body will be treated as plain text
DontParse = 1;
}
// Determines how the body will be parsed. Defaults to ParseAsJson
RequestBodyParse parse_body_behavior = 7;

// If set to true, Envoy will not throw an exception in case the body parsing
Expand Down Expand Up @@ -311,7 +312,7 @@ message Passthrough {}
message MergeExtractorsToBody {}

message HeaderBodyTransform {
// When transforming a request, setting this to true will additionally add "queryString",
// When transforming a request, setting this to true will additionally add "queryString",
// "queryStringParameters", "multiValueQueryStringParameters", "httpMethod", "path",
// and "multiValueHeaders" to the body
bool add_request_metadata = 1;
Expand Down

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

2 changes: 1 addition & 1 deletion test/kube2e/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ spec:
resourceClientset.VirtualServiceClient().BaseClient(),
)
Expect(err).To(MatchError(ContainSubstring("Failed to parse response template: Failed to parse " +
"header template ':status': [inja.exception.parser_error] expected statement close, got '%'")))
"header template ':status': [inja.exception.parser_error] (at 1:92) expected statement close, got '%'")))
})

Context("disable_transformation_validation is set", Ordered, func() {
Expand Down