Skip to content

Commit

Permalink
Pass Service name instead of replicaset name to CreateService func in…
Browse files Browse the repository at this point in the history
… Experiment

Signed-off-by: Daniel Del Rio <[email protected]>
  • Loading branch information
daniddelrio committed Mar 9, 2023
1 parent b4e2c0b commit 1ad0f8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion experiments/experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ func (ec *experimentContext) createTemplateService(template *v1alpha1.TemplateSp
}
}
if (svc == nil || svc.Name != rs.Name) && len(ports) > 0 {
newService, err := ec.CreateService(rs.Name, *template, rs.Labels, ports)
serviceName := rs.Name
if template.Service.Name != "" {
serviceName = template.Service.Name
}
newService, err := ec.CreateService(serviceName, *template, rs.Labels, ports)
if err != nil {
templateStatus.Status = v1alpha1.TemplateStatusError
templateStatus.Message = fmt.Sprintf("Failed to create Service for template '%s': %v", template.Name, err)
Expand Down

0 comments on commit 1ad0f8a

Please sign in to comment.