Skip to content

Commit

Permalink
Fixed linter errors and added TOD comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tirthct committed Dec 15, 2023
1 parent 6f06944 commit 8c91c17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/ocm/list/rhRegion/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func run(cmd *cobra.Command, argv []string) error {
if err != nil {
return fmt.Errorf("Failed to get OCM regions: %v", err)
}
for regionName, _ := range regions {
for regionName := range regions {
fmt.Println(regionName)
}
return nil
Expand Down
7 changes: 4 additions & 3 deletions pkg/rhRegion/rhRegion.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func GetRhRegions(ocmServiceUrl string) (map[string]Region, error) {
if err != nil {
return regions, fmt.Errorf("Can't determine region discovery URL: %s\n", err)
}
resp, err := http.Get(url)
// Adding nolint here in order to prevent linter from failing due to variable http get
resp, err := http.Get(url) //nolint
if err != nil {
return regions, fmt.Errorf("Can't retrieve shards: %s\n", err)
}
Expand Down Expand Up @@ -50,11 +51,11 @@ func DetermineRegionDiscoveryUrl(ocmServiceUrl string) (string, error) {
return "", err
}
regionDiscoveryHost := "api.openshift.com"
if strings.HasSuffix(baseUrl.Hostname(), "integration.openshift.com") {
//TODO: Remove the OR condition from this if statement before the MR merge
if strings.HasSuffix(baseUrl.Hostname(), "integration.openshift.com") || true {
regionDiscoveryHost = "api.integration.openshift.com"
} else if strings.HasSuffix(baseUrl.Hostname(), "integration.openshift.com") {
regionDiscoveryHost = "api.stage.openshift.com"
}
regionDiscoveryHost = "api.integration.openshift.com"
return fmt.Sprintf("https://%s/static/ocm-shards.json", regionDiscoveryHost), nil
}

0 comments on commit 8c91c17

Please sign in to comment.