Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljsaenz committed Nov 27, 2024
1 parent bf1bff7 commit be5a327
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ func (c *Config) SetOutputPath(path string) {
c.outputPath = absPath
}

// GetRMSUrl returns RMS API URL
func (c *Config) GetRMSUrl() string {
// RMSUrl returns RMS API URL
func (c *Config) RMSUrl() string {
return c.rMSUrl
}

// GetApiToken returns RMS API token
func (c *Config) GetApiToken() string {
// ApiToken returns RMS API token
func (c *Config) ApiToken() string {
return c.aPIToken
}

// GetOutputPath returns output file path
func (c *Config) GetOutputPath() string {
// OutputPath returns output file path
func (c *Config) OutputPath() string {
return c.outputPath
}

Expand Down
6 changes: 4 additions & 2 deletions internal/kubeconfig/kubeconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (
yaml "gopkg.in/yaml.v3"
)

const clusterListPath string = "/v3/clusters/"

// GetClusters retrieves a list of all clusters from RMS
func GetClusters(baseURL, apiToken string) []types.RMSCluster {
client := &http.Client{}
req, err := http.NewRequest("GET", baseURL+"/v3/clusters", nil)
req, err := http.NewRequest("GET", baseURL+clusterListPath, nil)
if err != nil {
log.Fatalf("Error creating cluster request: %v", err)
}
Expand Down Expand Up @@ -52,7 +54,7 @@ func GenerateCombinedKubeconfig(baseURL, apiToken, outputPath string, clusterIDs

for _, clusterID := range clusterIDs {

url := fmt.Sprintf("%s/v3/clusters/%s?action=generateKubeconfig", baseURL, clusterID)
url := fmt.Sprintf("%s%s%s?action=generateKubeconfig", baseURL, clusterListPath, clusterID)
req, err := http.NewRequest("POST", url, nil)
if err != nil {
log.Fatalf("Error creating generate kubeconfig request: %v", err)
Expand Down

0 comments on commit be5a327

Please sign in to comment.