Skip to content

Commit

Permalink
Validate new mixer CRDs (istio#12918)
Browse files Browse the repository at this point in the history
* Validate new mixer CRDs

* Add templates and adapters

* Test cases for new mixer CRDs
  • Loading branch information
esnible authored and istio-testing committed Apr 1, 2019
1 parent e312677 commit 400c608
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ webhooks:
- quotas
- reportnothings
- tracespans
- adapters
- handlers
- instances
- templates
- zipkins
failurePolicy: Fail
sideEffects: None
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: "config.istio.io/v1alpha2"
kind: adapter
metadata:
name: keyval
namespace: istio-system
spec:
description: 0
session_based: false
templates:
- keyval
config: CsgCCh5taXhlci90ZXN0L2tleXZhbC9jb25maWcucHJvdG8SBmtleXZhbCJzCgZQYXJhbXMSLwoFdGFibGUYASADKAsyGS5rZXl2YWwuUGFyYW1zLlRhYmxlRW50cnlSBXRhYmxlGjgKClRhYmxlRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AUqgAQoGEgQAAAgBCggKAQwSAwAAEgoICgECEgMCCA4KIAoCBAASBAUACAEaFCBBZGFwdGVyIHBhcmFtZXRlcnMKCgoKAwQAARIDBQgOChsKBAQAAgASAwcCIBoOIExvb2t1cCB0YWJsZQoKDQoFBAACAAQSBAcCBRAKDAoFBAACAAYSAwcCFQoMCgUEAAIAARIDBxYbCgwKBQQAAgADEgMHHh9iBnByb3RvMw==
---
12 changes: 12 additions & 0 deletions tests/e2e/tests/galley/testdata/config-v1alpha2-adapter-valid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: "config.istio.io/v1alpha2"
kind: adapter
metadata:
name: keyval
namespace: istio-system
spec:
description:
session_based: false
templates:
- keyval
config: CsgCCh5taXhlci90ZXN0L2tleXZhbC9jb25maWcucHJvdG8SBmtleXZhbCJzCgZQYXJhbXMSLwoFdGFibGUYASADKAsyGS5rZXl2YWwuUGFyYW1zLlRhYmxlRW50cnlSBXRhYmxlGjgKClRhYmxlRW50cnkSEAoDa2V5GAEgASgJUgNrZXkSFAoFdmFsdWUYAiABKAlSBXZhbHVlOgI4AUqgAQoGEgQAAAgBCggKAQwSAwAAEgoICgECEgMCCA4KIAoCBAASBAUACAEaFCBBZGFwdGVyIHBhcmFtZXRlcnMKCgoKAwQAARIDBQgOChsKBAQAAgASAwcCIBoOIExvb2t1cCB0YWJsZQoKDQoFBAACAAQSBAcCBRAKDAoFBAACAAYSAwcCFQoMCgUEAAIAARIDBxYbCgwKBQQAAgADEgMHHh9iBnByb3RvMw==
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: "config.istio.io/v1alpha2"
kind: handler
metadata:
name: prometheusdouble
namespace: istio-system
spec:
compiledAdapter: 0
params:
metrics:
- name: double_request_count # Prometheus metric name
instance_name: doublerequestcount.metric.istio-system # Mixer instance name (fully-qualified)
kind: COUNTER
label_names:
- reporter
- source
- destination
- message
17 changes: 17 additions & 0 deletions tests/e2e/tests/galley/testdata/config-v1alpha2-handler-valid.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: "config.istio.io/v1alpha2"
kind: handler
metadata:
name: prometheusdouble
namespace: istio-system
spec:
compiledAdapter: prometheus
params:
metrics:
- name: double_request_count # Prometheus metric name
instance_name: doublerequestcount.metric.istio-system # Mixer instance name (fully-qualified)
kind: COUNTER
label_names:
- reporter
- source
- destination
- message
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "config.istio.io/v1alpha2"
kind: instance
metadata:
name: source-info
namespace: istio-system
spec:
template: listentry
zarams:
value: source.name | "unknown"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "config.istio.io/v1alpha2"
kind: instance
metadata:
name: source-info
namespace: istio-system
spec:
template: listentry
params:
value: source.name | "unknown"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: "config.istio.io/v1alpha2"
kind: template
metadata:
name: keyval
namespace: istio-system
spec:
prescriptor: 0

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: "config.istio.io/v1alpha2"
kind: zipkin
metadata:
name: zipkin
namespace: istio-system
spec:
url: localhost/zipkin
sampleProbability: banana
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: "config.istio.io/v1alpha2"
kind: zipkin
metadata:
name: zipkin
namespace: istio-system
spec:
url: localhost/zipkin
sampleProbability: 20

0 comments on commit 400c608

Please sign in to comment.