fix for service name creation (#79)

This commit is contained in:
Michael Quigley
2022-10-20 14:16:18 -04:00
parent 83892b80f1
commit 6148fe316d
3 changed files with 10 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import (
"crypto/x509"
"encoding/hex"
errors2 "github.com/go-openapi/errors"
"github.com/jaevor/go-nanoid"
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
"github.com/openziti/edge/rest_management_api_client"
"github.com/openziti/edge/rest_util"
@@ -48,7 +49,11 @@ func createToken() (string, error) {
}
func createServiceName() (string, error) {
return dnsSafeShortId()
gen, err := nanoid.CustomASCII("abcdefghijklmnopqrstuvwxyz0123456789", 12)
if err != nil {
return "", err
}
return gen(), nil
}
func dnsSafeShortId() (string, error) {