Expose getClusterRegInfo (#4881)

so that it can be used by other projects (e.g. console) instead of
duplicating the logic.
This commit is contained in:
Shireesh Anjal
2024-03-20 14:07:29 -07:00
committed by GitHub
parent 795ed1eb49
commit 9043bbf545
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -232,7 +232,7 @@ func mainLicenseRegister(ctx *cli.Context) error {
}
}
regInfo := getClusterRegInfo(getAdminInfo(aliasedURL), clusterName)
regInfo := GetClusterRegInfo(getAdminInfo(aliasedURL), clusterName)
lrm := licRegisterMessage{Status: "success", Alias: alias}
if !globalAirgapped {
+3 -2
View File
@@ -431,7 +431,8 @@ func setSubnetLicense(alias, lic string) {
setSubnetConfig(alias, "license", lic)
}
func getClusterRegInfo(admInfo madmin.InfoMessage, clusterName string) ClusterRegistrationInfo {
// GetClusterRegInfo - returns the cluster registration info
func GetClusterRegInfo(admInfo madmin.InfoMessage, clusterName string) ClusterRegistrationInfo {
noOfPools := 1
noOfDrives := 0
for _, srvr := range admInfo.Servers {
@@ -596,7 +597,7 @@ func getSubnetAPIKeyUsingAuthHeaders(authHeaders map[string]string) (string, err
}
func getSubnetLicenseUsingAPIKey(alias, apiKey string) (string, error) {
regInfo := getClusterRegInfo(getAdminInfo(alias), alias)
regInfo := GetClusterRegInfo(getAdminInfo(alias), alias)
_, lic, e := registerClusterOnSubnet(regInfo, alias, apiKey)
return lic, e
}
+1 -1
View File
@@ -480,7 +480,7 @@ func execSupportPerf(ctx *cli.Context, aliasedURL, perfType string) {
resultFileNamePfx := fmt.Sprintf("%s-perf_%s", filepath.Clean(alias), UTCNow().Format("20060102150405"))
resultFileName := resultFileNamePfx + ".json"
regInfo := getClusterRegInfo(getAdminInfo(aliasedURL), alias)
regInfo := GetClusterRegInfo(getAdminInfo(aliasedURL), alias)
tmpFileName, e := zipPerfResult(convertPerfResults(results), resultFileName, regInfo)
fatalIf(probe.NewError(e), "Unable to generate zip file from performance results")