mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 13:46:51 +08:00
Checking for istio injection by checking if the sidecar has "tty"
set to true.
This commit is contained in:
@@ -279,12 +279,13 @@ func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts
|
|||||||
template.Metadata.Annotations = make(map[string]string)
|
template.Metadata.Annotations = make(map[string]string)
|
||||||
}
|
}
|
||||||
template.Metadata.Annotations["sidecar.istio.io/inject"] = "false"
|
template.Metadata.Annotations["sidecar.istio.io/inject"] = "false"
|
||||||
//todo not sure if we need istio yet
|
//For workflows with accessible sidecars, we need istio
|
||||||
if template.Metadata.Labels != nil {
|
//Istio does not prevent the main container from stopping
|
||||||
if sidecar, ok := template.Metadata.Labels["sidecar"]; ok {
|
for _, s := range template.Sidecars {
|
||||||
if sidecar == "sys-visualization-sidecar" {
|
if s.TTY == true {
|
||||||
template.Metadata.Annotations["sidecar.istio.io/inject"] = "true"
|
template.Metadata.Annotations["sidecar.istio.io/inject"] = "true"
|
||||||
}
|
//Only need one instance to require istio injection
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user