Skip to content

Commit fe822b9

Browse files
some more changes
Signed-off-by: Kartikay <[email protected]>
1 parent 70a5883 commit fe822b9

File tree

6 files changed

+5
-15
lines changed

6 files changed

+5
-15
lines changed

pkg/apis/environment/environment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func CreateEnvironment(pid string, request models.CreateEnvironmentRequest, cred
1919
gqlReq.Variables.ProjectId = pid
2020
gqlReq.Variables.Request = request
2121

22-
query, err := json.Marshal(gqlReq)
22+
query, _ := json.Marshal(gqlReq)
2323
resp, err := apis.SendRequest(apis.SendRequestParams{Endpoint: cred.ServerEndpoint + utils.GQLAPIPath, Token: cred.Token}, query, string(types.Post))
2424
if err != nil {
2525
return CreateEnvironmentResponse{}, errors.New("Error in Creating Chaos Infrastructure: " + err.Error())

pkg/apis/infrastructure/infra.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func ConnectInfra(infra types.Infra, cred types.Credentials) (InfraConnectionDat
9696
gqlReq.Variables.RegisterInfraRequest.Tolerations = toleration
9797
}
9898

99-
query, err := json.Marshal(gqlReq)
99+
query, _ := json.Marshal(gqlReq)
100100
resp, err := apis.SendRequest(apis.SendRequestParams{Endpoint: cred.ServerEndpoint + utils.GQLAPIPath, Token: cred.Token}, query, string(types.Post))
101101
if err != nil {
102102
return InfraConnectionData{}, errors.New("Error in registering Chaos Infrastructure: " + err.Error())

pkg/cmd/connect/infra.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ var infraCmd = &cobra.Command{
105105
os.Exit(1)
106106
}
107107

108-
newInfra.EnvironmentID, err = cmd.Flags().GetString("environmentID")
108+
newInfra.EnvironmentID, _ = cmd.Flags().GetString("environmentID")
109109
if newInfra.EnvironmentID == "" {
110110
utils.Red.Print("Error: --environment flag is empty")
111111
os.Exit(1)

pkg/cmd/get/infra.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var InfraCmd = &cobra.Command{
6161
}
6262
}
6363

64-
output, err := cmd.Flags().GetString("output")
64+
output, _ := cmd.Flags().GetString("output")
6565

6666
switch output {
6767
case "json":

pkg/infra_ops/ops.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ INFRA_NAME:
117117
}
118118

119119
// Check if Chaos Infra with the given name already exists
120-
isInfraExist, err, infra := ValidateInfraNameExists(newInfra.InfraName, pid, c)
120+
isInfraExist, _, infra := ValidateInfraNameExists(newInfra.InfraName, pid, c)
121121

122122
if isInfraExist {
123123
PrintExistingInfra(infra)

pkg/utils/experiment.go

-10
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,6 @@ func ParseExperimentManifest(file string, chaosWorkFlowRequest *model.SaveChaosE
133133
return nil
134134
}
135135

136-
// Helper function to check the presence of a string in a slice
137-
func sliceContains(s []string, e string) bool {
138-
for _, a := range s {
139-
if a == e {
140-
return true
141-
}
142-
}
143-
return false
144-
}
145-
146136
// Helper function to generate a random 8 char string - used for workflow name postfix
147137
func generateRandomString() string {
148138
source := rand.NewSource(time.Now().UnixNano())

0 commit comments

Comments
 (0)