Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 8bb7baa

Browse files
committed
Remove -job suffix from generated service names
The names of jobs and containers already form a set; that is, the name of a job or container must be unique across all jobs and containers. Drop the -job suffix from the names of ServiceInstances generated for jobs so that the DNS name matches the resource name. Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com>
1 parent 6e8c7e4 commit 8bb7baa

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkg/services/acorn.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"strconv"
88

99
"github.com/acorn-io/baaah/pkg/apply"
10-
"github.com/acorn-io/baaah/pkg/name"
1110
"github.com/acorn-io/baaah/pkg/typed"
1211
v1 "github.com/acorn-io/runtime/pkg/apis/internal.acorn.io/v1"
1312
"github.com/acorn-io/runtime/pkg/jobs"
@@ -125,7 +124,7 @@ func serviceNames(appInstance *v1.AppInstance) sets.Set[string] {
125124
result.Insert(k)
126125
}
127126
for k := range appInstance.Status.AppSpec.Jobs {
128-
result.Insert(jobServiceName(k))
127+
result.Insert(k)
129128
}
130129
for k := range appInstance.Status.AppSpec.Routers {
131130
result.Insert(k)
@@ -340,7 +339,7 @@ func forJobs(interpolator *secrets.Interpolator, appInstance *v1.AppInstance) (r
340339

341340
result = append(result, &v1.ServiceInstance{
342341
ObjectMeta: metav1.ObjectMeta{
343-
Name: jobServiceName(jobName),
342+
Name: jobName,
344343
Namespace: appInstance.Status.Namespace,
345344
Labels: labels.Managed(appInstance,
346345
labels.AcornPublicName, publicname.ForChild(appInstance, jobName),
@@ -541,7 +540,3 @@ func getUngranted(appInstance *v1.AppInstance, service *v1.ServiceInstance) []v1
541540

542541
return ungranted
543542
}
544-
545-
func jobServiceName(jobName string) string {
546-
return name.SafeConcatName(jobName, "job")
547-
}

0 commit comments

Comments
 (0)