Skip to content

Commit 5003574

Browse files
author
Greg Osuri
authored
provider: use uuid instead of deployment id for hostnames (#325)
The maximum allowed length for a domain name label is **63** bytes. The current implementation uses deployment ids which are **64** bytes long. For eg: `web.ece4d213af89da02c0f4b5e589dcb9dd9313d4fc228ba9ad316cc8fb79ac163a.147-75-71-243.aksh.io` This patch uses UUIDs instead that are 36 bytes.
1 parent bab7df7 commit 5003574

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

glide.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ import:
6666
version: ^3.3.0
6767
- package: github.com/blang/semver
6868
version: ^3.5.1
69+
- package: github.com/satori/go.uuid
70+
version: ~1.2.0

provider/cluster/kube/builder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
akashv1 "github.com/ovrclk/akash/pkg/apis/akash.network/v1"
1111
"github.com/ovrclk/akash/types"
12+
"github.com/satori/go.uuid"
1213
appsv1 "k8s.io/api/apps/v1"
1314
corev1 "k8s.io/api/core/v1"
1415
extv1 "k8s.io/api/extensions/v1beta1"
@@ -214,7 +215,8 @@ type ingressBuilder struct {
214215
}
215216

216217
func newIngressBuilder(host string, lid types.LeaseID, group *types.ManifestGroup, service *types.ManifestService, expose *types.ManifestServiceExpose) *ingressBuilder {
217-
expose.Hosts = append(expose.Hosts, fmt.Sprintf("%v.%v.%v", service.Name, lid.DeploymentID(), host))
218+
uid := uuid.NewV4()
219+
expose.Hosts = append(expose.Hosts, fmt.Sprintf("%v.%s.%v", service.Name, uid, host))
218220
return &ingressBuilder{
219221
deploymentBuilder: deploymentBuilder{builder: builder{lid, group}, service: service},
220222
expose: expose,

0 commit comments

Comments
 (0)