mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-16 18:51:23 +00:00
29 lines
761 B
Plaintext
29 lines
761 B
Plaintext
|
local base = import 'ci/istio/base.libsonnet';
|
||
|
|
||
|
{
|
||
|
FILTER_TYPE_CUSTOM: 'custom',
|
||
|
FILTER_TYPE_REDIRECT: 'redirect',
|
||
|
MATCH_TYPE_BYCDEPLOY: 'bycdeploy',
|
||
|
MATCH_TYPE_ALL: 'all',
|
||
|
|
||
|
envoy_filter(info)::
|
||
|
local filterType = info.type;
|
||
|
local matchType = if filterType != $.FILTER_TYPE_CUSTOM then info.matchType;
|
||
|
|
||
|
local envoyFilterInfo = {
|
||
|
kind: base.KIND_ENVOYFILTER,
|
||
|
metadata: {
|
||
|
name: info.name,
|
||
|
namespace: 'istio-system',
|
||
|
},
|
||
|
spec: if filterType == $.FILTER_TYPE_CUSTOM then info.filter else {
|
||
|
workloadSelector: if matchType == $.MATCH_TYPE_ALL then {}
|
||
|
else if matchType == $.MATCH_TYPE_BYCDEPLOY then {
|
||
|
}
|
||
|
else non_existing_value,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
base(pubSubTopicInfo),
|
||
|
}
|