Workin' Argo struct
This commit is contained in:
@@ -29,15 +29,18 @@ func (b *ArgoBuilder) CreateService(id string, processing *resources.ProcessingR
|
||||
}
|
||||
|
||||
func (b *ArgoBuilder) completeServicePorts(service *models.Service, id string, processing *resources.ProcessingResource) {
|
||||
for _, execute := range processing.Container.Exposes {
|
||||
if execute.PAT != 0 {
|
||||
new_port_translation := models.ServicePort{
|
||||
Name: strings.ToLower(processing.Name) + id,
|
||||
Port: execute.Port,
|
||||
TargetPort: execute.PAT,
|
||||
Protocol: "TCP",
|
||||
instance := processing.GetSelectedInstance()
|
||||
if instance != nil && instance.(*resources.ProcessingInstance).Access != nil && instance.(*resources.ProcessingInstance).Access.Container != nil {
|
||||
for _, execute := range instance.(*resources.ProcessingInstance).Access.Container.Exposes {
|
||||
if execute.PAT != 0 {
|
||||
new_port_translation := models.ServicePort{
|
||||
Name: strings.ToLower(processing.Name) + id,
|
||||
Port: execute.Port,
|
||||
TargetPort: execute.PAT,
|
||||
Protocol: "TCP",
|
||||
}
|
||||
service.Spec.Ports = append(service.Spec.Ports, new_port_translation)
|
||||
}
|
||||
service.Spec.Ports = append(service.Spec.Ports, new_port_translation)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +49,6 @@ func (b *ArgoBuilder) addServiceToArgo() error {
|
||||
for _, service := range b.Services {
|
||||
service_manifest, err := yaml.Marshal(service)
|
||||
if err != nil {
|
||||
logger.Error().Msg("Could not marshal service manifest : " + err.Error())
|
||||
return err
|
||||
}
|
||||
service_template := models.Template{Name: "workflow-service-pod",
|
||||
|
||||
Reference in New Issue
Block a user