Skip to content

Commit

Permalink
bootstrap: clean layered runtime (#2051)
Browse files Browse the repository at this point in the history
* translator: add mock implement of RTDS

Signed-off-by: zirain <[email protected]>

* rename to runtimev3

Signed-off-by: zirain <[email protected]>

* clean layered runtime

Signed-off-by: zirain <[email protected]>

* fix

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
  • Loading branch information
zirain authored Oct 24, 2023
1 parent a858547 commit bdb0191
Show file tree
Hide file tree
Showing 25 changed files with 1 addition and 223 deletions.
6 changes: 1 addition & 5 deletions api/v1alpha1/validation/envoyproxy_validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ func validateBootstrap(boostrapConfig *egv1a1.ProxyBootstrap) error {
cmp.Diff(userBootstrap.DynamicResources, defaultBootstrap.DynamicResources, protocmp.Transform()) != "" {
return fmt.Errorf("dynamic_resources cannot be modified")
}
// Ensure layered runtime resources config is same
if userBootstrap.LayeredRuntime == nil ||
cmp.Diff(userBootstrap.LayeredRuntime, defaultBootstrap.LayeredRuntime, protocmp.Transform()) != "" {
return fmt.Errorf("layered_runtime cannot be modified")
}

// Ensure that the xds_cluster config is same
var userXdsCluster, defaultXdsCluster *clusterv3.Cluster
for _, cluster := range userBootstrap.StaticResources.Clusters {
Expand Down
8 changes: 0 additions & 8 deletions api/v1alpha1/validation/testdata/valid-user-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ dynamicResources:
cdsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 10s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@
"resourceApiVersion": "V3"
}
},
"layeredRuntime": {
"layers": [
{
"name": "runtime-0",
"rtdsLayer": {
"name": "runtime-0",
"rtdsConfig": {
"ads": {},
"resourceApiVersion": "V3"
}
}
}
]
},
"staticResources": {
"clusters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,6 @@ envoyProxy:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
logging: {}
status: {}
gatewayClass:
Expand Down Expand Up @@ -504,14 +496,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@
"resourceApiVersion": "V3"
}
},
"layeredRuntime": {
"layers": [
{
"name": "runtime-0",
"rtdsLayer": {
"name": "runtime-0",
"rtdsConfig": {
"ads": {},
"resourceApiVersion": "V3"
}
}
}
]
},
"staticResources": {
"clusters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@
"resourceApiVersion": "V3"
}
},
"layeredRuntime": {
"layers": [
{
"name": "runtime-0",
"rtdsLayer": {
"name": "runtime-0",
"rtdsConfig": {
"ads": {},
"resourceApiVersion": "V3"
}
}
}
]
},
"staticResources": {
"clusters": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ xds:
ldsConfig:
ads: {}
resourceApiVersion: V3
layeredRuntime:
layers:
- name: runtime-0
rtdsLayer:
name: runtime-0
rtdsConfig:
ads: {}
resourceApiVersion: V3
staticResources:
clusters:
- connectTimeout: 0.250s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,6 @@ spec:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
- --log-level warn
- --cpuset-threads
command:
Expand Down
8 changes: 0 additions & 8 deletions internal/xds/bootstrap/bootstrap.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,3 @@ static_resources:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
8 changes: 0 additions & 8 deletions internal/xds/bootstrap/testdata/custom-stats-matcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,3 @@ static_resources:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
8 changes: 0 additions & 8 deletions internal/xds/bootstrap/testdata/disable-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,3 @@ static_resources:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
8 changes: 0 additions & 8 deletions internal/xds/bootstrap/testdata/enable-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,3 @@ static_resources:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0
8 changes: 0 additions & 8 deletions internal/xds/bootstrap/testdata/otel-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,3 @@ static_resources:
path_config_source:
path: "/sds/xds-trusted-ca.json"
resource_api_version: V3
layered_runtime:
layers:
- name: runtime-0
rtds_layer:
rtds_config:
ads: {}
resource_api_version: V3
name: runtime-0

0 comments on commit bdb0191

Please sign in to comment.