Skip to content
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
78 changes: 78 additions & 0 deletions kubernetes/customresourcedefinitions.gen.yaml

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

58 changes: 34 additions & 24 deletions tests/testdata/wasm-invalid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,18 @@ spec:
url: "http://test"
pluginName: ""
---
# TODO: validator is currently not catching this
#_err: 'spec.pluginName in body should be at least'
#apiVersion: extensions.istio.io/v1alpha1
#kind: WasmPlugin
#metadata:
# name: duplicate-ports
#spec:
# url: "http://test"
# ports:
# - number: 1
# - number: 1
#---
#_err: 'spec.pluginName in body should be at least'
#apiVersion: extensions.istio.io/v1alpha1
#kind: WasmPlugin
#metadata:
# name: duplicate-env
#spec:
# url: "http://test"
# vmConfig:
# env:
# - name: a
# - name: a
_err: 'Duplicate value'
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
name: duplicate-env
spec:
url: "http://test"
vmConfig:
env:
- name: a
- name: a
---
_err: 'spec.vmConfig.env[0].name in body should be at least'
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
Expand Down Expand Up @@ -133,4 +122,25 @@ metadata:
name: nested-nil
spec:
url:
---
---
_err: 'wildcard not allowed in label value match'
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
name: invalid-selector
spec:
url: "http://test"
selector:
matchLabels:
istio: "bar*"
---
_err: 'wildcard not allowed in label key match'
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
name: invalid-selector
spec:
url: "http://test"
selector:
matchLabels:
"istio*": "bar"
3 changes: 3 additions & 0 deletions type/v1beta1/selector.pb.go

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

3 changes: 3 additions & 0 deletions type/v1beta1/selector.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ message WorkloadSelector {
// One or more labels that indicate a specific set of pods/VMs
// on which a policy should be applied. The scope of label search is restricted to
// the configuration namespace in which the resource is present.
// +kubebuilder:validation:XValidation:message="wildcard not allowed in label key match",rule="self.all(key, !key.contains('*'))"
// +kubebuilder:validation:XValidation:message="wildcard not allowed in label value match",rule="self.map(key, self[key]).all(v, !v.contains('*'))"
// +kubebuilder:validation:MaxProperties=4096
map<string, string> match_labels = 1;
}

Expand Down