diff --git a/Gopkg.lock b/Gopkg.lock index 7157b2a806..ed19a4ec5b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1397,6 +1397,7 @@ "k8s.io/client-go/tools/clientcmd", "k8s.io/client-go/tools/record", "k8s.io/client-go/util/flowcontrol", + "k8s.io/client-go/util/jsonpath", "k8s.io/client-go/util/workqueue", "k8s.io/code-generator/cmd/client-gen", "k8s.io/klog", diff --git a/docs/features/traffic-management/istio.md b/docs/features/traffic-management/istio.md index 578c23827e..8aeca0740b 100644 --- a/docs/features/traffic-management/istio.md +++ b/docs/features/traffic-management/istio.md @@ -85,4 +85,4 @@ Both of these issues adds more complexity to the users and Argo Rollouts develop ### Implement Istio support through the SMI -[SMI](https://smi-spec.io/) is the Service Mesh Interface, which serves as a standard interface for all common features of a service mesh. This feature is GitOps friendly, but native Istio has extra functionality that SMI does not currently provide. Granted, Argo Rollouts should integrate with the SMI independent of the native Istio integration. \ No newline at end of file +[SMI](https://smi-spec.io/) is the Service Mesh Interface, which serves as a standard interface for all common features of a service mesh. This feature is GitOps friendly, but native Istio has extra functionality that SMI does not currently provide. Granted, Argo Rollouts should integrate with the SMI independent of the native Istio integration. diff --git a/manifests/crds/analysis-run-crd.yaml b/manifests/crds/analysis-run-crd.yaml index 6535fc8040..6097638676 100644 --- a/manifests/crds/analysis-run-crd.yaml +++ b/manifests/crds/analysis-run-crd.yaml @@ -1,6 +1,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysisruns.argoproj.io spec: additionalPrinterColumns: @@ -500,8 +502,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -513,8 +516,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -548,8 +552,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -561,8 +566,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -600,8 +606,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -622,8 +629,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -652,6 +660,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -684,8 +696,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -706,8 +719,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -799,8 +813,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -821,8 +836,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1025,8 +1041,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1038,8 +1055,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1073,8 +1091,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1086,8 +1105,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1125,8 +1145,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1147,8 +1168,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1209,8 +1231,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1231,8 +1254,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1324,8 +1348,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1346,8 +1371,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1554,8 +1580,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1567,8 +1594,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1602,8 +1630,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1615,8 +1644,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1654,8 +1684,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1676,8 +1707,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1706,6 +1738,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -1738,8 +1774,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1760,8 +1797,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1853,8 +1891,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1875,8 +1914,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2081,6 +2121,10 @@ spec: - whenUnsatisfiable type: object type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map volumes: items: properties: @@ -2605,6 +2649,30 @@ spec: query: type: string type: object + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url + type: object type: object successCondition: type: string diff --git a/manifests/crds/analysis-template-crd.yaml b/manifests/crds/analysis-template-crd.yaml index 2897659a85..901f18d0ef 100644 --- a/manifests/crds/analysis-template-crd.yaml +++ b/manifests/crds/analysis-template-crd.yaml @@ -1,6 +1,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysistemplates.argoproj.io spec: group: argoproj.io @@ -494,8 +496,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -507,8 +510,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -542,8 +546,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -555,8 +560,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -594,8 +600,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -616,8 +623,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -646,6 +654,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -678,8 +690,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -700,8 +713,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -793,8 +807,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -815,8 +830,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1019,8 +1035,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1032,8 +1049,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1067,8 +1085,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1080,8 +1099,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1119,8 +1139,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1141,8 +1162,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1203,8 +1225,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1225,8 +1248,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1318,8 +1342,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1340,8 +1365,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1548,8 +1574,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1561,8 +1588,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1596,8 +1624,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1609,8 +1638,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1648,8 +1678,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1670,8 +1701,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1700,6 +1732,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -1732,8 +1768,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1754,8 +1791,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1847,8 +1885,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1869,8 +1908,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2075,6 +2115,10 @@ spec: - whenUnsatisfiable type: object type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map volumes: items: properties: @@ -2599,6 +2643,30 @@ spec: query: type: string type: object + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url + type: object type: object successCondition: type: string diff --git a/manifests/crds/experiment-crd.yaml b/manifests/crds/experiment-crd.yaml index f3bfa7e74a..822215986c 100644 --- a/manifests/crds/experiment-crd.yaml +++ b/manifests/crds/experiment-crd.yaml @@ -1,6 +1,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: experiments.argoproj.io spec: additionalPrinterColumns: @@ -489,8 +491,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -502,8 +505,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -537,8 +541,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -550,8 +555,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -589,8 +595,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -611,8 +618,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -641,6 +649,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -673,8 +685,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -695,8 +708,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -788,8 +802,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -810,8 +825,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1014,8 +1030,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1027,8 +1044,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1062,8 +1080,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1075,8 +1094,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1114,8 +1134,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1136,8 +1157,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1198,8 +1220,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1220,8 +1243,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1313,8 +1337,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1335,8 +1360,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1543,8 +1569,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1556,8 +1583,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1591,8 +1619,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1604,8 +1633,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1643,8 +1673,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1665,8 +1696,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1695,6 +1727,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -1727,8 +1763,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1749,8 +1786,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1842,8 +1880,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1864,8 +1903,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2070,6 +2110,10 @@ spec: - whenUnsatisfiable type: object type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map volumes: items: properties: diff --git a/manifests/crds/rollout-crd.yaml b/manifests/crds/rollout-crd.yaml index bf009083d8..7f38334fd8 100644 --- a/manifests/crds/rollout-crd.yaml +++ b/manifests/crds/rollout-crd.yaml @@ -1,6 +1,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: rollouts.argoproj.io spec: additionalPrinterColumns: @@ -138,12 +140,14 @@ spec: type: string maxSurge: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true maxUnavailable: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true stableService: type: string steps: @@ -685,8 +689,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -698,8 +703,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -733,8 +739,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -746,8 +753,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -785,8 +793,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -807,8 +816,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -837,6 +847,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -869,8 +883,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -891,8 +906,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -984,8 +1000,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1006,8 +1023,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1210,8 +1228,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1223,8 +1242,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1258,8 +1278,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1271,8 +1292,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1310,8 +1332,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1332,8 +1355,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1394,8 +1418,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1416,8 +1441,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1509,8 +1535,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1531,8 +1558,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1739,8 +1767,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1752,8 +1781,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1787,8 +1817,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1800,8 +1831,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1839,8 +1871,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1861,8 +1894,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1891,6 +1925,10 @@ spec: - containerPort type: object type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map readinessProbe: properties: exec: @@ -1923,8 +1961,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1945,8 +1984,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2038,8 +2078,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -2060,8 +2101,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2266,6 +2308,10 @@ spec: - whenUnsatisfiable type: object type: array + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map volumes: items: properties: diff --git a/manifests/install.yaml b/manifests/install.yaml index 760ece96d4..d27b738269 100644 --- a/manifests/install.yaml +++ b/manifests/install.yaml @@ -2,6 +2,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysisruns.argoproj.io spec: additionalPrinterColumns: @@ -501,8 +503,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -514,8 +517,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -549,8 +553,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -562,8 +567,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -601,8 +607,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -623,8 +630,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -685,8 +693,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -707,8 +716,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -800,8 +810,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -822,8 +833,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1026,8 +1038,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1039,8 +1052,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1074,8 +1088,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1087,8 +1102,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1126,8 +1142,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1148,8 +1165,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1210,8 +1228,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1232,8 +1251,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1325,8 +1345,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1347,8 +1368,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1555,8 +1577,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1568,8 +1591,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1603,8 +1627,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1616,8 +1641,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1655,8 +1681,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1677,8 +1704,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1739,8 +1767,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1761,8 +1790,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1854,8 +1884,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1876,8 +1907,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2599,12 +2631,38 @@ spec: query: type: string type: object +<<<<<<< HEAD + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url +======= wavefront: properties: address: type: string query: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 type: object type: object successCondition: @@ -2698,6 +2756,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysistemplates.argoproj.io spec: group: argoproj.io @@ -3191,8 +3251,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3204,8 +3265,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3239,8 +3301,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3252,8 +3315,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3291,8 +3355,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3313,8 +3378,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3375,8 +3441,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3397,8 +3464,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3490,8 +3558,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3512,8 +3581,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3716,8 +3786,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3729,8 +3800,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3764,8 +3836,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3777,8 +3850,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3816,8 +3890,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3838,8 +3913,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3900,8 +3976,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3922,8 +3999,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4015,8 +4093,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4037,8 +4116,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4245,8 +4325,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4258,8 +4339,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4293,8 +4375,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4306,8 +4389,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4345,8 +4429,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4367,8 +4452,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4429,8 +4515,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4451,8 +4538,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4544,8 +4632,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4566,8 +4655,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5289,12 +5379,38 @@ spec: query: type: string type: object +<<<<<<< HEAD + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url +======= wavefront: properties: address: type: string query: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 type: object type: object successCondition: @@ -5319,6 +5435,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: experiments.argoproj.io spec: additionalPrinterColumns: @@ -5807,8 +5925,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5820,8 +5939,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5855,8 +5975,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5868,8 +5989,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5907,8 +6029,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5929,8 +6052,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5991,8 +6115,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6013,8 +6138,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6106,8 +6232,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6128,8 +6255,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6332,8 +6460,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6345,8 +6474,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6380,8 +6510,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6393,8 +6524,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6432,8 +6564,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6454,8 +6587,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6516,8 +6650,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6538,8 +6673,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6631,8 +6767,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6653,8 +6790,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6861,8 +6999,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6874,8 +7013,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6909,8 +7049,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6922,8 +7063,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6961,8 +7103,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6983,8 +7126,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7045,8 +7189,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -7067,8 +7212,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7160,8 +7306,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -7182,8 +7329,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7919,6 +8067,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: rollouts.argoproj.io spec: additionalPrinterColumns: @@ -8056,14 +8206,19 @@ spec: type: string maxSurge: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true maxUnavailable: anyOf: - - type: string - type: integer +<<<<<<< HEAD + - type: string + x-kubernetes-int-or-string: true +======= stableService: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 steps: items: properties: @@ -8603,8 +8758,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8616,8 +8772,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8651,8 +8808,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8664,8 +8822,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8703,8 +8862,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8725,8 +8885,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8787,8 +8948,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8809,8 +8971,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8902,8 +9065,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8924,8 +9088,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9128,8 +9293,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9141,8 +9307,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9176,8 +9343,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9189,8 +9357,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9228,8 +9397,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9250,8 +9420,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9312,8 +9483,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9334,8 +9506,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9427,8 +9600,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9449,8 +9623,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9657,8 +9832,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9670,8 +9846,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9705,8 +9882,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9718,8 +9896,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9757,8 +9936,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9779,8 +9959,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9841,8 +10022,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9863,8 +10045,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9956,8 +10139,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9978,8 +10162,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object diff --git a/manifests/namespace-install.yaml b/manifests/namespace-install.yaml index cfc891838c..5d76794613 100644 --- a/manifests/namespace-install.yaml +++ b/manifests/namespace-install.yaml @@ -2,6 +2,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysisruns.argoproj.io spec: additionalPrinterColumns: @@ -501,8 +503,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -514,8 +517,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -549,8 +553,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -562,8 +567,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -601,8 +607,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -623,8 +630,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -685,8 +693,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -707,8 +716,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -800,8 +810,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -822,8 +833,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1026,8 +1038,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1039,8 +1052,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1074,8 +1088,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1087,8 +1102,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1126,8 +1142,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1148,8 +1165,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1210,8 +1228,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1232,8 +1251,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1325,8 +1345,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1347,8 +1368,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1555,8 +1577,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1568,8 +1591,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1603,8 +1627,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1616,8 +1641,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1655,8 +1681,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1677,8 +1704,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1739,8 +1767,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1761,8 +1790,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -1854,8 +1884,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -1876,8 +1907,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -2599,12 +2631,38 @@ spec: query: type: string type: object +<<<<<<< HEAD + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url +======= wavefront: properties: address: type: string query: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 type: object type: object successCondition: @@ -2698,6 +2756,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: analysistemplates.argoproj.io spec: group: argoproj.io @@ -3191,8 +3251,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3204,8 +3265,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3239,8 +3301,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3252,8 +3315,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3291,8 +3355,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3313,8 +3378,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3375,8 +3441,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3397,8 +3464,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3490,8 +3558,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3512,8 +3581,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3716,8 +3786,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3729,8 +3800,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3764,8 +3836,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3777,8 +3850,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3816,8 +3890,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3838,8 +3913,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -3900,8 +3976,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -3922,8 +3999,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4015,8 +4093,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4037,8 +4116,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4245,8 +4325,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4258,8 +4339,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4293,8 +4375,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4306,8 +4389,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4345,8 +4429,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4367,8 +4452,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4429,8 +4515,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4451,8 +4538,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -4544,8 +4632,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -4566,8 +4655,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5289,12 +5379,38 @@ spec: query: type: string type: object +<<<<<<< HEAD + web: + properties: + headers: + items: + properties: + key: + type: string + value: + type: string + required: + - key + - value + type: object + type: array + jsonPath: + type: string + timeoutSeconds: + type: integer + url: + type: string + required: + - jsonPath + - url +======= wavefront: properties: address: type: string query: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 type: object type: object successCondition: @@ -5319,6 +5435,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: experiments.argoproj.io spec: additionalPrinterColumns: @@ -5807,8 +5925,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5820,8 +5939,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5855,8 +5975,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5868,8 +5989,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5907,8 +6029,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -5929,8 +6052,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -5991,8 +6115,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6013,8 +6138,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6106,8 +6232,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6128,8 +6255,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6332,8 +6460,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6345,8 +6474,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6380,8 +6510,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6393,8 +6524,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6432,8 +6564,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6454,8 +6587,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6516,8 +6650,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6538,8 +6673,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6631,8 +6767,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6653,8 +6790,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6861,8 +6999,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6874,8 +7013,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6909,8 +7049,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6922,8 +7063,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -6961,8 +7103,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -6983,8 +7126,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7045,8 +7189,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -7067,8 +7212,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7160,8 +7306,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -7182,8 +7329,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -7919,6 +8067,8 @@ spec: apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: + annotations: + controller-gen.kubebuilder.io/version: (unknown) name: rollouts.argoproj.io spec: additionalPrinterColumns: @@ -8056,14 +8206,19 @@ spec: type: string maxSurge: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true maxUnavailable: anyOf: - - type: string - type: integer +<<<<<<< HEAD + - type: string + x-kubernetes-int-or-string: true +======= stableService: type: string +>>>>>>> c79494b99e33e54ab9734f885c196d1d81e8f1f6 steps: items: properties: @@ -8603,8 +8758,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8616,8 +8772,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8651,8 +8808,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8664,8 +8822,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8703,8 +8862,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8725,8 +8885,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8787,8 +8948,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8809,8 +8971,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -8902,8 +9065,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -8924,8 +9088,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9128,8 +9293,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9141,8 +9307,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9176,8 +9343,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9189,8 +9357,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9228,8 +9397,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9250,8 +9420,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9312,8 +9483,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9334,8 +9506,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9427,8 +9600,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9449,8 +9623,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9657,8 +9832,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9670,8 +9846,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9705,8 +9882,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9718,8 +9896,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9757,8 +9936,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9779,8 +9959,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9841,8 +10022,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9863,8 +10045,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object @@ -9956,8 +10139,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true scheme: type: string required: @@ -9978,8 +10162,9 @@ spec: type: string port: anyOf: - - type: string - type: integer + - type: string + x-kubernetes-int-or-string: true required: - port type: object diff --git a/metricproviders/metricproviders.go b/metricproviders/metricproviders.go index a774f14091..5a52664540 100644 --- a/metricproviders/metricproviders.go +++ b/metricproviders/metricproviders.go @@ -6,6 +6,7 @@ import ( "github.com/argoproj/argo-rollouts/metricproviders/wavefront" "github.com/argoproj/argo-rollouts/metricproviders/kayenta" + "github.com/argoproj/argo-rollouts/metricproviders/webmetric" log "github.com/sirupsen/logrus" "k8s.io/client-go/kubernetes" @@ -52,6 +53,13 @@ func (f *ProviderFactory) NewProvider(logCtx log.Entry, metric v1alpha1.Metric) } else if metric.Provider.Kayenta != nil { c := kayenta.NewHttpClient() return kayenta.NewKayentaProvider(logCtx, c), nil + } else if metric.Provider.Web != nil { + c := webmetric.NewWebMetricHttpClient(metric) + p, err := webmetric.NewWebMetricJsonParser(metric) + if err != nil { + return nil, err + } + return webmetric.NewWebMetricProvider(logCtx, c, p), nil } else if metric.Provider.Wavefront != nil { client, err := wavefront.NewWavefrontAPI(metric, f.KubeClient) if err != nil { diff --git a/metricproviders/webmetric/webmetric.go b/metricproviders/webmetric/webmetric.go new file mode 100644 index 0000000000..f3cc63635b --- /dev/null +++ b/metricproviders/webmetric/webmetric.go @@ -0,0 +1,197 @@ +package webmetric + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "time" + + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" + "github.com/argoproj/argo-rollouts/utils/evaluate" + metricutil "github.com/argoproj/argo-rollouts/utils/metric" + log "github.com/sirupsen/logrus" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/util/jsonpath" +) + +const ( + //ProviderType indicates the provider is prometheus + ProviderType = "WebMetric" +) + +// Provider contains all the required components to run a WebMetric query +// Implements the Provider Interface +type Provider struct { + logCtx log.Entry + client *http.Client + jsonParser *jsonpath.JSONPath +} + +// Type incidates provider is a WebMetric provider +func (p *Provider) Type() string { + return ProviderType +} + +func (p *Provider) Run(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric) v1alpha1.Measurement { + startTime := metav1.Now() + + // Measurement to pass back + measurement := v1alpha1.Measurement{ + StartedAt: &startTime, + } + + // Create request + request := &http.Request{ + Method: "GET", // TODO maybe make this configurable....also implies we will need body templates + } + + url, err := url.Parse(metric.Provider.Web.URL) + if err != nil { + return metricutil.MarkMeasurementError(measurement, err) + } + request.URL = url + + request.Header = make(http.Header) + for _, header := range metric.Provider.Web.Headers { + request.Header.Set(header.Key, header.Value) + } + + // Send Request + response, err := p.client.Do(request) + if err != nil { + return metricutil.MarkMeasurementError(measurement, err) + } else if response.StatusCode < 200 || response.StatusCode >= 300 { + return metricutil.MarkMeasurementError(measurement, fmt.Errorf("received non 2xx response code: %v", response.StatusCode)) + } + + value, status, err := p.parseResponse(metric, response) + if err != nil { + return metricutil.MarkMeasurementError(measurement, err) + } + + measurement.Value = value + measurement.Phase = status + finishedTime := metav1.Now() + measurement.FinishedAt = &finishedTime + + return measurement +} + +func (p *Provider) parseResponse(metric v1alpha1.Metric, response *http.Response) (string, v1alpha1.AnalysisPhase, error) { + var data interface{} + + bodyBytes, err := ioutil.ReadAll(response.Body) + if err != nil { + return "", v1alpha1.AnalysisPhaseError, fmt.Errorf("Received no bytes in response: %v", err) + } + + err = json.Unmarshal(bodyBytes, &data) + if err != nil { + return "", v1alpha1.AnalysisPhaseError, fmt.Errorf("Could not parse JSON body: %v", err) + } + + buf := new(bytes.Buffer) + err = p.jsonParser.Execute(buf, data) + if err != nil { + return "", v1alpha1.AnalysisPhaseError, fmt.Errorf("Could not find JSONPath in body: %s", err) + } + out := buf.String() + + status := p.evaluateResponse(metric, out) + return out, status, nil +} + +func (p *Provider) evaluateResponse(metric v1alpha1.Metric, result interface{}) v1alpha1.AnalysisPhase { + successCondition := false + failCondition := false + var err error + + if metric.SuccessCondition != "" { + successCondition, err = evaluate.EvalCondition(result, metric.SuccessCondition) + if err != nil { + p.logCtx.Warning(err.Error()) + return v1alpha1.AnalysisPhaseError + } + } + if metric.FailureCondition != "" { + failCondition, err = evaluate.EvalCondition(result, metric.FailureCondition) + if err != nil { + return v1alpha1.AnalysisPhaseError + } + } + + switch { + case metric.SuccessCondition == "" && metric.FailureCondition == "": + //Always return success unless there is an error + return v1alpha1.AnalysisPhaseSuccessful + case metric.SuccessCondition != "" && metric.FailureCondition == "": + // Without a failure condition, a measurement is considered a failure if the measurement's success condition is not true + failCondition = !successCondition + case metric.SuccessCondition == "" && metric.FailureCondition != "": + // Without a success condition, a measurement is considered a successful if the measurement's failure condition is not true + successCondition = !failCondition + } + + if failCondition { + return v1alpha1.AnalysisPhaseFailed + } + + if !failCondition && !successCondition { + return v1alpha1.AnalysisPhaseInconclusive + } + + // If we reach this code path, failCondition is false and successCondition is true + return v1alpha1.AnalysisPhaseSuccessful +} + +// Resume should not be used the WebMetric provider since all the work should occur in the Run method +func (p *Provider) Resume(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement { + p.logCtx.Warn("WebMetric provider should not execute the Resume method") + return measurement +} + +// Terminate should not be used the WebMetric provider since all the work should occur in the Run method +func (p *Provider) Terminate(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, measurement v1alpha1.Measurement) v1alpha1.Measurement { + p.logCtx.Warn("WebMetric provider should not execute the Terminate method") + return measurement +} + +// GarbageCollect is a no-op for the WebMetric provider +func (p *Provider) GarbageCollect(run *v1alpha1.AnalysisRun, metric v1alpha1.Metric, limit int) error { + return nil +} + +func NewWebMetricHttpClient(metric v1alpha1.Metric) *http.Client { + var timeout time.Duration + + // Using a default timeout of 10 seconds + if metric.Provider.Web.TimeoutSeconds <= 0 { + timeout = time.Duration(10) * time.Second + } else { + timeout = time.Duration(metric.Provider.Web.TimeoutSeconds) * time.Second + } + + c := &http.Client{ + Timeout: timeout, + } + return c +} + +func NewWebMetricJsonParser(metric v1alpha1.Metric) (*jsonpath.JSONPath, error) { + jsonParser := jsonpath.New("metrics") + + err := jsonParser.Parse(metric.Provider.Web.JSONPath) + + return jsonParser, err +} + +func NewWebMetricProvider(logCtx log.Entry, client *http.Client, jsonParser *jsonpath.JSONPath) *Provider { + return &Provider{ + logCtx: logCtx, + client: client, + jsonParser: jsonParser, + } +} diff --git a/metricproviders/webmetric/webmetric_test.go b/metricproviders/webmetric/webmetric_test.go new file mode 100644 index 0000000000..d4a2a77019 --- /dev/null +++ b/metricproviders/webmetric/webmetric_test.go @@ -0,0 +1,279 @@ +package webmetric + +import ( + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" +) + +func TestRunSuite(t *testing.T) { + // Test Cases + var tests = []struct { + webServerStatus int + webServerResponse string + metric v1alpha1.Metric + expectedValue string + expectedPhase v1alpha1.AnalysisPhase + expectedErrorMessage string + }{ + // When_numberReturnedInJson_And_MatchesConditions_Then_Succeed + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": 1}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "asInt(result) > 0", + FailureCondition: "asInt(result) <= 0", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + Headers: []v1alpha1.WebMetricHeader{{Key: "key", Value: "value"}}, + }, + }, + }, + expectedValue: "1", + expectedPhase: v1alpha1.AnalysisPhaseSuccessful, + }, + // When_numberReturnedInJson_And_DoesNotMatcheConditions_Then_Failure + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": 0}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "asInt(result) > 0", + FailureCondition: "asInt(result) <= 0", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "0", + expectedPhase: v1alpha1.AnalysisPhaseFailed, + }, + // When_floatReturnedInJson_And_MatchesConditions_Then_Success + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": 1.1}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "asFloat(result) > 0", + FailureCondition: "asFloat(result) <= 0", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "1.1", + expectedPhase: v1alpha1.AnalysisPhaseSuccessful, + }, + // When_floatReturnedInJson_And_DoesNotMatchConditions_Then_Failure + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": -1.1}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "asFloat(result) > 0", + FailureCondition: "asFloat(result) <= 0", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "-1.1", + expectedPhase: v1alpha1.AnalysisPhaseFailed, + }, + // When_stringReturnedInJson_And_MatchesConditions_Then_Succeed + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": "true"}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "false", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseSuccessful, + }, + // When_stringReturnedInJson_And_DoesNotMatchConditions_Then_Fail + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": "true"}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseFailed, + }, + // When_non200_Then_Error + { + webServerStatus: 300, + webServerResponse: `{"key": [{"key2": {"value": "true"}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + // URL: server.URL, + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseError, + }, + // When_BadURL_Then_Fail + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": "true"}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + URL: "bad://url.com", + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseError, + expectedErrorMessage: "unsupported protocol scheme", + }, + // When_200Response_And_EmptyBody_Then_Error + { + webServerStatus: 200, + webServerResponse: ``, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseError, + expectedErrorMessage: "Could not parse JSON body", + }, + // When_200Response_And_InvalidBody_Then_Error + { + webServerStatus: 200, + webServerResponse: `test: notJson`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + JSONPath: "{$.key[0].key2.value}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseError, + expectedErrorMessage: "Could not parse JSON body", + }, + // When_200Response_And_JsonPathHasNoMatch_Then_Error + { + webServerStatus: 200, + webServerResponse: `{"key": [{"key2": {"value": "true"}}]}`, + metric: v1alpha1.Metric{ + Name: "foo", + SuccessCondition: "true", + FailureCondition: "true", + Provider: v1alpha1.MetricProvider{ + Web: &v1alpha1.WebMetric{ + JSONPath: "{$.key[0].key2.novalue}", + }, + }, + }, + expectedValue: "true", + expectedPhase: v1alpha1.AnalysisPhaseError, + expectedErrorMessage: "Could not find JSONPath in body", + }, + } + + // Run + + for _, test := range tests { + // Server setup with response + server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + if test.webServerStatus < 200 || test.webServerStatus >= 300 { + http.Error(rw, http.StatusText(test.webServerStatus), test.webServerStatus) + } else { + rw.Header().Set("Content-Type", "application/json") + if test.webServerResponse != "" { + io.WriteString(rw, test.webServerResponse) + } + } + })) + defer server.Close() + + // Need to set this dynamically if not present... + if test.metric.Provider.Web.URL == "" { + test.metric.Provider.Web.URL = server.URL + } + + logCtx := log.WithField("test", "test") + + jsonparser, err := NewWebMetricJsonParser(test.metric) + assert.NoError(t, err) + provider := NewWebMetricProvider(*logCtx, server.Client(), jsonparser) + + // Get our result + measurement := provider.Run(newAnalysisRun(), test.metric) + + // Common Asserts + assert.NotNil(t, measurement) + assert.Equal(t, string(test.expectedPhase), string(measurement.Phase)) + + // Phase specific cases + switch test.expectedPhase { + case v1alpha1.AnalysisPhaseSuccessful: + assert.NotNil(t, measurement.StartedAt) + assert.Equal(t, test.expectedValue, measurement.Value) + assert.NotNil(t, measurement.FinishedAt) + case v1alpha1.AnalysisPhaseFailed: + assert.NotNil(t, measurement.StartedAt) + assert.Equal(t, test.expectedValue, measurement.Value) + assert.NotNil(t, measurement.FinishedAt) + case v1alpha1.AnalysisPhaseError: + assert.Contains(t, measurement.Message, test.expectedErrorMessage) + } + + } +} + +func newAnalysisRun() *v1alpha1.AnalysisRun { + return &v1alpha1.AnalysisRun{} +} diff --git a/pkg/apis/rollouts/v1alpha1/analysis_types.go b/pkg/apis/rollouts/v1alpha1/analysis_types.go index e76782ba56..57452922a6 100644 --- a/pkg/apis/rollouts/v1alpha1/analysis_types.go +++ b/pkg/apis/rollouts/v1alpha1/analysis_types.go @@ -97,6 +97,7 @@ type MetricProvider struct { // Prometheus specifies the prometheus metric to query Prometheus *PrometheusMetric `json:"prometheus,omitempty"` Kayenta *KayentaMetric `json:"kayenta,omitempty"` + Web *WebMetric `json:"web,omitempty"` // Wavefront specifies the wavefront metric to query Wavefront *WavefrontMetric `json:"wavefront,omitempty"` // Job specifies the job metric run @@ -277,3 +278,15 @@ type ScopeDetail struct { Start string `json:"start"` End string `json:"end"` } + +type WebMetric struct { + URL string `json:"url"` + Headers []WebMetricHeader `json:"headers,omitempty"` + TimeoutSeconds int `json:"timeoutSeconds,omitempty"` + JSONPath string `json:"jsonPath"` +} + +type WebMetricHeader struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/pkg/apis/rollouts/v1alpha1/openapi_generated.go b/pkg/apis/rollouts/v1alpha1/openapi_generated.go index 041fb41bbf..479012b8f0 100644 --- a/pkg/apis/rollouts/v1alpha1/openapi_generated.go +++ b/pkg/apis/rollouts/v1alpha1/openapi_generated.go @@ -80,6 +80,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.TemplateSpec": schema_pkg_apis_rollouts_v1alpha1_TemplateSpec(ref), "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.TemplateStatus": schema_pkg_apis_rollouts_v1alpha1_TemplateStatus(ref), "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WavefrontMetric": schema_pkg_apis_rollouts_v1alpha1_WavefrontMetric(ref), + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetric": schema_pkg_apis_rollouts_v1alpha1_WebMetric(ref), + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetricHeader": schema_pkg_apis_rollouts_v1alpha1_WebMetricHeader(ref), } } @@ -1462,6 +1464,11 @@ func schema_pkg_apis_rollouts_v1alpha1_MetricProvider(ref common.ReferenceCallba Ref: ref("github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.KayentaMetric"), }, }, + "web": { + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetric"), + }, + }, "wavefront": { SchemaProps: spec.SchemaProps{ Description: "Wavefront specifies the wavefront metric to query", @@ -1478,7 +1485,7 @@ func schema_pkg_apis_rollouts_v1alpha1_MetricProvider(ref common.ReferenceCallba }, }, Dependencies: []string{ - "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.JobMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.KayentaMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.PrometheusMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WavefrontMetric"}, + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.JobMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.KayentaMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.PrometheusMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WavefrontMetric", "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetric"}, } } @@ -2452,3 +2459,72 @@ func schema_pkg_apis_rollouts_v1alpha1_WavefrontMetric(ref common.ReferenceCallb Dependencies: []string{}, } } + +func schema_pkg_apis_rollouts_v1alpha1_WebMetric(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "headers": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetricHeader"), + }, + }, + }, + }, + }, + "timeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int32", + }, + }, + "jsonPath": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"url", "jsonPath"}, + }, + }, + Dependencies: []string{ + "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1.WebMetricHeader"}, + } +} + +func schema_pkg_apis_rollouts_v1alpha1_WebMetricHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"key", "value"}, + }, + }, + Dependencies: []string{}, + } +} diff --git a/pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go index 19be507576..98b255a739 100644 --- a/pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/rollouts/v1alpha1/zz_generated.deepcopy.go @@ -823,6 +823,11 @@ func (in *MetricProvider) DeepCopyInto(out *MetricProvider) { *out = new(KayentaMetric) (*in).DeepCopyInto(*out) } + if in.Web != nil { + in, out := &in.Web, &out.Web + *out = new(WebMetric) + (*in).DeepCopyInto(*out) + } if in.Wavefront != nil { in, out := &in.Wavefront, &out.Wavefront *out = new(WavefrontMetric) @@ -1345,3 +1350,40 @@ func (in *WavefrontMetric) DeepCopy() *WavefrontMetric { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebMetric) DeepCopyInto(out *WebMetric) { + *out = *in + if in.Headers != nil { + in, out := &in.Headers, &out.Headers + *out = make([]WebMetricHeader, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebMetric. +func (in *WebMetric) DeepCopy() *WebMetric { + if in == nil { + return nil + } + out := new(WebMetric) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WebMetricHeader) DeepCopyInto(out *WebMetricHeader) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebMetricHeader. +func (in *WebMetricHeader) DeepCopy() *WebMetricHeader { + if in == nil { + return nil + } + out := new(WebMetricHeader) + in.DeepCopyInto(out) + return out +} diff --git a/utils/analysis/factory.go b/utils/analysis/factory.go index d591173bed..e9c3e09a15 100644 --- a/utils/analysis/factory.go +++ b/utils/analysis/factory.go @@ -113,6 +113,9 @@ func ValidateMetric(metric v1alpha1.Metric) error { if metric.Provider.Job != nil { numProviders++ } + if metric.Provider.Web != nil { + numProviders++ + } if metric.Provider.Wavefront != nil { numProviders++ } diff --git a/utils/evaluate/evaluate.go b/utils/evaluate/evaluate.go index f2a5d752f2..0c3f4d5de8 100644 --- a/utils/evaluate/evaluate.go +++ b/utils/evaluate/evaluate.go @@ -1,15 +1,30 @@ package evaluate import ( + "fmt" + "strconv" + "github.com/antonmedv/expr" ) // EvalCondition evaluates the condition with the resultValue as an input func EvalCondition(resultValue interface{}, condition string) (bool, error) { + var err error + env := map[string]interface{}{ - "result": resultValue, + "result": resultValue, + "asInt": asInt, + "asFloat": asFloat, } + // Setup a clean recovery in case the eval code panics. + // TODO: this actually might not be nessary since it seems evaluation lib handles panics from functions internally + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("evaluation logic panicked: %v", r) + } + }() + program, err := expr.Compile(condition, expr.Env(env), expr.AsBool()) if err != nil { return false, err @@ -22,3 +37,19 @@ func EvalCondition(resultValue interface{}, condition string) (bool, error) { return output.(bool), err } + +func asInt(in string) int64 { + inAsInt, err := strconv.ParseInt(in, 10, 64) + if err == nil { + return inAsInt + } + panic(err) +} + +func asFloat(in string) float64 { + inAsFloat, err := strconv.ParseFloat(in, 64) + if err == nil { + return inAsFloat + } + panic(err) +} diff --git a/utils/evaluate/evaluate_test.go b/utils/evaluate/evaluate_test.go index 796a1718e2..9daa2c32c4 100644 --- a/utils/evaluate/evaluate_test.go +++ b/utils/evaluate/evaluate_test.go @@ -56,3 +56,67 @@ func TestEvaluateInvalidStruct(t *testing.T) { assert.Errorf(t, err, "") assert.False(t, b) } + +func TestEvaluateAsIntPanic(t *testing.T) { + b, err := EvalCondition("1.1", "asInt(result) == 1.1") + assert.Errorf(t, err, "got expected error: %v", err) + assert.False(t, b) +} + +func TestEvaluateAsInt(t *testing.T) { + b, err := EvalCondition("1", "asInt(result) == 1") + assert.NoError(t, err) + assert.True(t, b) +} + +func TestEvaluateAsFloatPanic(t *testing.T) { + b, err := EvalCondition("NotANum", "asFloat(result) == 1.1") + assert.Errorf(t, err, "got expected error: %v", err) + assert.False(t, b) +} + +func TestEvaluateAsFloat(t *testing.T) { + b, err := EvalCondition("1.1", "asFloat(result) == 1.1") + assert.NoError(t, err) + assert.True(t, b) +} + +func TestAsInt(t *testing.T) { + tests := []struct { + input string + output int64 + shouldPanic bool + }{ + {"1", 1, false}, + {"notint", 1, true}, + {"1.1", 1, true}, + } + + for _, test := range tests { + if test.shouldPanic { + assert.Panics(t, func() { asInt(test.input) }) + } else { + assert.Equal(t, test.output, asInt(test.input)) + } + } +} + +func TestAsFloat(t *testing.T) { + tests := []struct { + input string + output float64 + shouldPanic bool + }{ + {"1", 1, false}, + {"notfloat", 1, true}, + {"1.1", 1.1, false}, + } + + for _, test := range tests { + if test.shouldPanic { + assert.Panics(t, func() { asFloat(test.input) }) + } else { + assert.Equal(t, test.output, asFloat(test.input)) + } + } +}