Skip to content

Commit

Permalink
Added some fixes for litmusctl (#50)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonsy13 <[email protected]>
  • Loading branch information
Jonsy13 committed Dec 14, 2021
1 parent 2f7019e commit 2cac8ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkg/apis/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ func GetAgentList(c types.Credentials, pid string) (AgentData, error) {
query := `{"query":"query{\n getCluster(project_id: \"` + pid + `\"){\n cluster_id cluster_name is_active \n }\n}"}`
resp, err := SendRequest(SendRequestParams{Endpoint: c.Endpoint + utils.GQLAPIPath, Token: c.Token}, []byte(query), string(types.Post))
if err != nil {
utils.Red.Println("Error in getting agent list: ", err)
return AgentData{}, err
}

bodyBytes, err := ioutil.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
utils.Red.Println("Error in getting agent list: ", err)
return AgentData{}, err
}

if resp.StatusCode == http.StatusOK {
var agent AgentData
err = json.Unmarshal(bodyBytes, &agent)
if err != nil {
utils.Red.Println("Error in getting agent list: ", err)
return AgentData{}, err
}

if len(agent.Errors) > 0 {
Expand Down
6 changes: 0 additions & 6 deletions pkg/k8s/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,6 @@ func ApplyYaml(params ApplyYamlPrams, kubeconfig string, isLocal bool) (output s
if kubeconfig != "" {
args = append(args, []string{"--kubeconfig", kubeconfig}...)
}
var args []string
if kubeconfig != "" {
args = []string{"kubectl", "apply", "-f", path, "--kubeconfig", kubeconfig}
} else {
args = []string{"kubectl", "apply", "-f", path}
}

stdout, err := exec.Command(args[0], args[1:]...).CombinedOutput()
if err != nil {
Expand Down

0 comments on commit 2cac8ea

Please sign in to comment.