INNER CODE UNIT · Go
func
inlets/inlets-operator · config.go:37
func (c TunnelConfig) GetLicenseKey() (string, error) {
val := ""
if len(c.License) > 0 {
val = c.License
} else {
data, err := ioutil.ReadFile(c.LicenseFile)
if err != nil {
return "", fmt.Errorf("error with GetLicenseKey: %s", err.Error())
}
val = string(data)
}
if len(val) == 0 {
return "", fmt.Errorf("--license or --license-key is required for inlets PRO")
}
if dots := strings.Count(val, "."); dots >= 2 {
return strings.TrimSpace(val), nil