@@ -124,7 +124,7 @@ func (c *ClusterSync) monitorCertificateRefresh() {
124124}
125125
126126func (c * ClusterSync ) issueRefreshRequest (url , port , basePath string , nodesPath string , csr , key string ) error {
127- url = fmt .Sprintf ("%s:%s%s /%s/%s " , url , port , basePath , nodesPath , c .cfg .Cluster .ID .Load ())
127+ url = fmt .Sprintf ("%s:%s/%s" , url , port , strings . TrimLeft ( path . Join ( basePath , nodesPath , c .cfg .Cluster .ID .Load ()), "/" ))
128128 apiAddress := c .cfg .APIOptions .APIAddress
129129 if apiAddress == "" {
130130 apiAddress = c .cfg .RuntimeData .Host
@@ -262,7 +262,7 @@ func (c *ClusterSync) monitorBootstrapKey() {
262262}
263263
264264func (c * ClusterSync ) issueJoinRequest (url , port , basePath string , registerPath string , csr , key string ) error {
265- url = fmt .Sprintf ("%s:%s%s /%s" , url , port , basePath , registerPath )
265+ url = fmt .Sprintf ("%s:%s/%s" , url , port , strings . TrimLeft ( path . Join ( basePath , registerPath ), "/" ) )
266266 apiCfg := c .cfg .APIOptions
267267 userStore := GetUsersStore ()
268268
@@ -480,7 +480,7 @@ func (c *ClusterSync) fetchCert() {
480480 apiBasePath := c .cfg .Cluster .APIBasePath .Load ()
481481 apiNodesPath := c .cfg .Cluster .APINodesPath .Load ()
482482 id := c .cfg .Cluster .ID .Load ()
483- url = fmt .Sprintf ("%s:%s/%s/%s/%s " , url , port , apiBasePath , apiNodesPath , id )
483+ url = fmt .Sprintf ("%s:%s/%s" , url , port , strings . TrimLeft ( path . Join ( apiBasePath , apiNodesPath , id ), "/" ) )
484484 req , err := http .NewRequest ("GET" , url , nil )
485485 if err != nil {
486486 c .activateFetchCert (err )
0 commit comments