mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 05:36:50 +08:00
If tty is set to true, mirror the main container volume mounts to
sidecars. - This way, sidecars have access
This commit is contained in:
@@ -461,7 +461,7 @@ func (c *Client) injectAccessForSidecars(namespace string, wf *wfv1.Workflow) ([
|
|||||||
taskSysSendExitStats := "sys-send-exit-stats"
|
taskSysSendExitStats := "sys-send-exit-stats"
|
||||||
for tIdx, t := range wf.Spec.Templates {
|
for tIdx, t := range wf.Spec.Templates {
|
||||||
//Inject services, virtual routes
|
//Inject services, virtual routes
|
||||||
for _, s := range t.Sidecars {
|
for si, s := range t.Sidecars {
|
||||||
//If TTY is true, sidecar needs to be accessible by HTTP
|
//If TTY is true, sidecar needs to be accessible by HTTP
|
||||||
//Otherwise, we skip the sidecar
|
//Otherwise, we skip the sidecar
|
||||||
if s.TTY != true {
|
if s.TTY != true {
|
||||||
@@ -472,6 +472,7 @@ func (c *Client) injectAccessForSidecars(namespace string, wf *wfv1.Workflow) ([
|
|||||||
return nil, util.NewUserError(codes.InvalidArgument, msg)
|
return nil, util.NewUserError(codes.InvalidArgument, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.Sidecars[si].MirrorVolumeMounts = ptr.Bool(true)
|
||||||
serviceNameUID := "s" + uuid.New().String() + "--" + namespace
|
serviceNameUID := "s" + uuid.New().String() + "--" + namespace
|
||||||
serviceNameUIDDNSCompliant, err := uid2.GenerateUID(serviceNameUID, 63)
|
serviceNameUIDDNSCompliant, err := uid2.GenerateUID(serviceNameUID, 63)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user