# istio_injection-with-mismatched-sidecar.yaml
# Namespace 'enabled-namespace' has istio injection enabled, so will be enforced.
apiVersion: v1
kind: Namespace
metadata:
  labels:
    istio-injection: enabled
  name: enabled-namespace
---
# Details-v1-pod-old is out of date and should get a warning.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-old
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0
    name: istio-proxy
---
# Namespace 'enabled-namespace' has istio injection enabled, so will be enforced.
apiVersion: v1
kind: Namespace
metadata:
  labels:
    istio-injection: enabled
  name: enabled-namespace-native
---
# Details-v1-pod-old-native is out of date and should get a warning.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-old-native
  namespace: enabled-namespace-native
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  initContainers:
  - image: registry.istio.io/release/proxyv2:1.3.0
    name: istio-proxy
---
# Details-v1-pod-new is up to date, and should be ignored.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-new
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.1
    name: istio-proxy
---
# Details-v1-pod-new-native is up to date, and should be ignored.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-new-native
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  initContainers:
  - image: registry.istio.io/release/proxyv2:1.3.1
    name: istio-proxy
---
# should not match the injector version.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-old-pre
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0-prerelease
    name: istio-proxy
---
# should not match the injector version.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-old-pre-2
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0-prerelease
    name: istio-proxy
---
# should not match the injector version.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v1-pod-old-pre-3
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0-prerelease
    name: istio-proxy
---
# details-v1-pod-overwritten-sidecar has a custom sidecar version injected and
# therefore should not match the injector version.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  annotations:
    sidecar.istio.io/proxyImage: registry.istio.io/release/proxyv2:1.3.0-prerelease
  name: details-v1-pod-overwritten-sidecar
  namespace: enabled-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v2:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0-prerelease
    name: istio-proxy
---
# Namespace 'default' does not have an explicit label, so no version checking should happen.
apiVersion: v1
kind: Namespace
metadata:
  name: default
---
# Details-v2-pod-old is out of date, but since istio-injection is not enabled on the namespace, 
# no warning occurs.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: details-v2-pod-old
  namespace: default
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v2:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0
    name: istio-proxy
---
# Namespace 'revision-namespace' has istio injection enabled and label istio.io/rev=canary, so will be enforced.
apiVersion: v1
kind: Namespace
metadata:
  labels:
    istio.io/rev: canary
  name: revision-namespace
---
# Revision-details-v1-pod-old is out of date and should get a warning.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: revision-details-v1-pod-old
  namespace: revision-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0
    name: istio-proxy
---
# Revision-details-v1-pod-new is up to date, and should be ignored.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  name: revision-details-v1-pod-new
  namespace: revision-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v1:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.1
    name: istio-proxy
---
# revision-details-v1-pod-overwritten-sidecar has a custom sidecar version injected and
# therefore should not match the injector version.
apiVersion: v1
kind: Pod
metadata:
  labels:
    app: details
  annotations:
    sidecar.istio.io/proxyImage: registry.istio.io/release/proxyv2:1.3.0-prerelease
  name: revision-details-v1-pod-overwritten-sidecar
  namespace: revision-namespace
spec:
  containers:
  - image: registry.istio.io/release/examples-bookinfo-details-v2:1.15.0
    name: details
  - image: registry.istio.io/release/proxyv2:1.3.0-prerelease
    name: istio-proxy
---