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["sidecar.istio.io/inject"] = "false"
|
||||
//todo not sure if we need istio yet
|
||||
if template.Metadata.Labels != nil {
|
||||
if sidecar, ok := template.Metadata.Labels["sidecar"]; ok {
|
||||
if sidecar == "sys-visualization-sidecar" {
|
||||
//For workflows with accessible sidecars, we need istio
|
||||
//Istio does not prevent the main container from stopping
|
||||
for _, s := range template.Sidecars {
|
||||
if s.TTY == 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