-
Notifications
You must be signed in to change notification settings - Fork 174
Check sidecar not right #602
Copy link
Copy link
Open
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Currently we check whether a pod has sidecar injected based on below function in bypass controller
func checkSidecar(client kubernetes.Interface, pod *corev1.Pod) (bool, error) {
namespace, err := client.CoreV1().Namespaces().Get(context.TODO(), pod.Namespace, metav1.GetOptions{})
if err != nil {
return false, err
}
if value, ok := namespace.Labels["istio-injection"]; ok && value == "enabled" {
return true, nil
}
if _, ok := pod.Annotations[SidecarAnnotation]; ok {
return true, nil
}
return false, nil
}
Maybe it is also not right in cni, i havn't look into yet.
Because a namespace with istio-injection: enabled label doesnot mean a pod within it has a sidecar.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working