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:
@@ -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
@@ -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
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user