@zheng1
- 问题:私有helm charts仓库,通过ks-console部署,提示 最长 14 个字符,只能包含小写字母、数字及分隔符(“-”),且必须以小写字母开头, 字母或数字结尾
- 期望:没有此限制
- 通过ks代码,主要限制环节在hyperpitrix,见下面,当时主要是以为helm本身就限制,但目前我使用
version.BuildInfo{Version:"v3.4.1", GitCommit:"c4e74854886b2efe3321e185578e6db9be0a6e29", GitTreeState:"clean", GoVersion:"go1.14.11"}
部署时,helm release name 已经没有这个限制,是否可以后续将这个限制去掉,否则应用集群名称太不直观了
func (proxy *Proxy) CheckClusterNameIsUnique(clusterName, namespace string) error {
if clusterName == "" {
return fmt.Errorf("cluster name must be provided")
}
if !ClusterNameRegExp.MatchString(clusterName) {
return fmt.Errorf(`cluster name must match with regexp "%s"`, ClusterNameReg)
}
// Related to https://github.com/helm/helm/pull/1080
if len(clusterName) > 14 {
return fmt.Errorf("the length of config [Name] must be less than 15")
}
err := funcutil.WaitForSpecificOrError(func() (bool, error) {
//todo
cfg, err := proxy.GetHelmConfig(namespace)
_, err = proxy.ReleaseStatus(cfg, clusterName)
if err != nil {
if isConnectionError(err) {
return false, nil
}
return true, nil
}
return true, gerr.New(proxy.ctx, gerr.PermissionDenied, gerr.ErrorHelmReleaseExists, clusterName)
}, constants.DefaultServiceTimeout, constants.WaitTaskInterval)
return err
}