Skip to content

Commit

Permalink
Expose getClusterRegInfo (#4881)
Browse files Browse the repository at this point in the history
so that it can be used by other projects (e.g. console) instead of
duplicating the logic.
  • Loading branch information
anjalshireesh committed Mar 20, 2024
1 parent 795ed1e commit 9043bbf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/license-register.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions cmd/subnet-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/support-perf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 9043bbf

Please sign in to comment.