[SSL证书]增加提前自动更新证书功能

This commit is contained in:
刘祥超
2020-11-27 09:57:21 +08:00
parent f3cffdcf6d
commit 83be53eac0
13 changed files with 351 additions and 16 deletions

View File

@@ -101,7 +101,7 @@ func (this *NodeClusterDAO) FindAllEnableClusters() (result []*NodeCluster, err
}
// 创建集群
func (this *NodeClusterDAO) CreateCluster(name string, grantId int64, installDir string, dnsDomainId int64, dnsName string) (clusterId int64, err error) {
func (this *NodeClusterDAO) CreateCluster(adminId int64, name string, grantId int64, installDir string, dnsDomainId int64, dnsName string) (clusterId int64, err error) {
uniqueId, err := this.genUniqueId()
if err != nil {
return 0, err
@@ -114,6 +114,7 @@ func (this *NodeClusterDAO) CreateCluster(name string, grantId int64, installDir
}
op := NewNodeClusterOperator()
op.AdminId = adminId
op.Name = name
op.GrantId = grantId
op.InstallDir = installDir
@@ -522,6 +523,14 @@ func (this *NodeClusterDAO) CheckClusterDNS(cluster *NodeCluster) (issues []*pb.
return
}
// 查找集群所属管理员
func (this *NodeClusterDAO) FindClusterAdminId(clusterId int64) (int64, error) {
return this.Query().
Pk(clusterId).
Result("adminId").
FindInt64Col(0)
}
// 生成唯一ID
func (this *NodeClusterDAO) genUniqueId() (string, error) {
for {