Refactor id file interaction

* Use IP instead of endpoint in clusterIDsFile
* Move and rename validateEnpoint to addPortIfMissing
* Refactor clusterIDsFile handling in verify cmd
This commit is contained in:
katexochen 2022-07-29 08:24:13 +02:00 committed by Paul Meyer
parent c2faa20d6e
commit 7bbcc564bb
8 changed files with 95 additions and 106 deletions

View file

@ -217,7 +217,7 @@ func writeOutput(resp *initproto.InitResponse, ip string, wr io.Writer, fileHand
idFile := clusterIDsFile{
ClusterID: clusterID,
OwnerID: ownerID,
Endpoint: net.JoinHostPort(ip, strconv.Itoa(constants.VerifyServiceNodePortGRPC)),
IP: ip,
}
if err := fileHandler.WriteJSON(constants.ClusterIDsFileName, idFile, file.OptNone); err != nil {
return fmt.Errorf("writing Constellation id file: %w", err)