Skip to content

Commit 895dc9f

Browse files
Vr00mmRémi ZIOLKOWSKI
authored and
Rémi ZIOLKOWSKI
committed
Merge branch 'master' into master
Signed-off-by: Rémi ZIOLKOWSKI <[email protected]>
2 parents 8eb7154 + 49fc5b0 commit 895dc9f

File tree

11 files changed

+60
-53
lines changed

11 files changed

+60
-53
lines changed

.github/workflows/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
3939
- name: Get tag
4040
shell: bash
41-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
41+
run: echo "branch=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
4242
id: tag
4343

4444
- name: Building litmusctl
@@ -55,4 +55,4 @@ jobs:
5555

5656
- name: Copy binaries to the litmusctl s3 bucket
5757
run: |
58-
aws s3 sync platforms-${{ steps.tag.outputs.branch }} s3://${{ secrets.AWS_S3_BUCKET }}
58+
aws s3 sync platforms-${{ steps.tag.outputs.branch }} s3://${{ secrets.AWS_S3_BUCKET }}

README.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ For more information including a complete list of litmusctl operations, see the
1111
* For v0.12.0 or latest:
1212
* Non-Interactive mode: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage.md">Click here</a>
1313
* Interactive mode: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_interactive.md">Click here</a>
14+
* For 0.23.0: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_0.23.0.md">Click here</a>
1415
* For v0.2.0 or earlier && compatible with Litmus-2.0.0-Beta8 or earlier: <a href="https://github.com/litmuschaos/litmusctl/blob/master/Usage_v0.2.0.md">Click here</a>
1516

1617
## Requirements
@@ -108,7 +109,12 @@ To check compatibility of litmusctl with Chaos Center
108109
<tr>
109110
<td>0.23.0</td>
110111
<td>3.0.0-beta9</td>
111-
<td>3.0.0-beta11</td>
112+
<td>3.0.0-beta12</td>
113+
</tr>
114+
<tr>
115+
<td>0.24.0</td>
116+
<td>3.0.0-beta9</td>
117+
<td>3.0.0-beta12</td>
112118
</tr>
113119
</table>
114120

@@ -118,109 +124,109 @@ To install the latest version of litmusctl follow the below steps:
118124

119125
<table>
120126
<th>Platforms</th>
127+
<th>0.24.0</th>
121128
<th>0.23.0</th>
122129
<th>0.22.0</th>
123130
<th>0.21.0</th>
124131
<th>0.20.0</th>
125132
<th>0.19.0</th>
126133
<th>0.18.0</th>
127134
<th>0.17.0</th>
128-
<th>0.16.0</th>
129135
<th>master(Unreleased)</th>
130136
<tr>
131137
<td>litmusctl-darwin-amd64 (MacOS)</td>
138+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.24.0.tar.gz">Click here</a></td>
132139
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.23.0.tar.gz">Click here</a></td>
133140
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.22.0.tar.gz">Click here</a></td>
134141
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.21.0.tar.gz">Click here</a></td>
135142
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.20.0.tar.gz">Click here</a></td>
136143
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.19.0.tar.gz">Click here</a></td>
137144
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.18.0.tar.gz">Click here</a></td>
138145
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.17.0.tar.gz">Click here</a></td>
139-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.16.0.tar.gz">Click here</a></td>
140146
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-master.tar.gz">Click here</a></td>
141147
</tr>
142148
<tr>
143149
<td>litmusctl-linux-386</td>
150+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.24.0.tar.gz">Click here</a></td>
144151
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.23.0.tar.gz">Click here</a></td>
145152
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.22.0.tar.gz">Click here</a></td>
146153
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.21.0.tar.gz">Click here</a></td>
147154
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.20.0.tar.gz">Click here</a></td>
148155
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.19.0.tar.gz">Click here</a></td>
149156
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.18.0.tar.gz">Click here</a></td>
150157
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.17.0.tar.gz">Click here</a></td>
151-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.16.0.tar.gz">Click here</a></td>
152158
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-master.tar.gz">Click here</a></td>
153159
</tr>
154160
<tr>
155161
<td>litmusctl-linux-amd64</td>
162+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.24.0.tar.gz">Click here</a></td>
156163
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.23.0.tar.gz">Click here</a></td>
157164
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.22.0.tar.gz">Click here</a></td>
158165
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.21.0.tar.gz">Click here</a></td>
159166
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.20.0.tar.gz">Click here</a></td>
160167
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.19.0.tar.gz">Click here</a></td>
161168
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.18.0.tar.gz">Click here</a></td>
162169
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.17.0.tar.gz">Click here</a></td>
163-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.16.0.tar.gz">Click here</a></td>
164170
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-master.tar.gz">Click here</a></td>
165171
</tr>
166172
<tr>
167173
<td>litmusctl-linux-arm</td>
174+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.24.0.tar.gz">Click here</a></td>
168175
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.23.0.tar.gz">Click here</a></td>
169176
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.22.0.tar.gz">Click here</a></td>
170177
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.21.0.tar.gz">Click here</a></td>
171178
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.20.0.tar.gz">Click here</a></td>
172179
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.19.0.tar.gz">Click here</a></td>
173180
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.18.0.tar.gz">Click here</a></td>
174181
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.17.0.tar.gz">Click here</a></td>
175-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.16.0.tar.gz">Click here</a></td>
176182
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-master.tar.gz">Click here</a></td>
177183
</tr>
178184
<tr>
179185
<td>litmusctl-linux-arm64</td>
186+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.24.0.tar.gz">Click here</a></td>
180187
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.23.0.tar.gz">Click here</a></td>
181188
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.22.0.tar.gz">Click here</a></td>
182189
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.21.0.tar.gz">Click here</a></td>
183190
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.20.0.tar.gz">Click here</a></td>
184191
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.19.0.tar.gz">Click here</a></td>
185192
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.18.0.tar.gz">Click here</a></td>
186193
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.17.0.tar.gz">Click here</a></td>
187-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.16.0.tar.gz">Click here</a></td>
188194
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-master.tar.gz">Click here</a></td>
189195
</tr>
190196
<tr>
191197
<td>litmusctl-windows-386</td>
198+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.24.0.tar.gz">Click here</a></td>
192199
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.23.0.tar.gz">Click here</a></td>
193200
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.22.0.tar.gz">Click here</a></td>
194201
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.21.0.tar.gz">Click here</a></td>
195202
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.20.0.tar.gz">Click here</a></td>
196203
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.19.0.tar.gz">Click here</a></td>
197204
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.18.0.tar.gz">Click here</a></td>
198205
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.17.0.tar.gz">Click here</a></td>
199-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.16.0.tar.gz">Click here</a></td>
200206
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-master.tar.gz">Click here</a></td>
201207
</tr>
202208
<tr>
203209
<td>litmusctl-windows-amd64</td>
210+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.24.0.tar.gz">Click here</a></td>
204211
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.23.0.tar.gz">Click here</a></td>
205212
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.22.0.tar.gz">Click here</a></td>
206213
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.21.0.tar.gz">Click here</a></td>
207214
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.20.0.tar.gz">Click here</a></td>
208215
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.19.0.tar.gz">Click here</a></td>
209216
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.18.0.tar.gz">Click here</a></td>
210217
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.17.0.tar.gz">Click here</a></td>
211-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.16.0.tar.gz">Click here</a></td>
212218
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-master.tar.gz">Click here</a></td>
213219
</tr>
214220
<tr>
215221
<td>litmusctl-windows-arm</td>
222+
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.24.0.tar.gz">Click here</a></td>
216223
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.23.0.tar.gz">Click here</a></td>
217224
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.22.0.tar.gz">Click here</a></td>
218225
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.21.0.tar.gz">Click here</a></td>
219226
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.20.0.tar.gz">Click here</a></td>
220227
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.19.0.tar.gz">Click here</a></td>
221228
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.18.0.tar.gz">Click here</a></td>
222229
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.17.0.tar.gz">Click here</a></td>
223-
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.16.0.tar.gz">Click here</a></td>
224230
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-master.tar.gz">Click here</a></td>
225231
</tr>
226232
</table>

pkg/apis/upgrade.go

+20-20
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,29 @@ type manifestData struct {
2626
}
2727

2828
type data struct {
29-
GetManifest string `json:"getManifest"`
29+
GetManifest string `json:"getInfraManifest"`
3030
}
3131

32-
type InfrasData struct {
33-
Data GetInfraDetails `json:"data"`
32+
type GetInfraResponse struct {
33+
Data GetInfraData `json:"data"`
3434
Errors []struct {
3535
Message string `json:"message"`
3636
Path []string `json:"path"`
3737
} `json:"errors"`
3838
}
3939

40-
type GetInfraDetails struct {
41-
GetInfraDetails InfrasDetails `json:"getAgentDetails"`
40+
type GetInfraData struct {
41+
GetInfraDetails InfraDetails `json:"getInfraDetails"`
4242
}
4343

44-
type InfrasDetails struct {
44+
type InfraDetails struct {
4545
InfraID string `json:"infraID"`
4646
InfraNamespace *string `json:"infraNamespace"`
4747
}
4848

4949
func UpgradeInfra(c context.Context, cred types.Credentials, projectID string, infraID string, kubeconfig string) (string, error) {
5050

51-
// Query to fetch agent details from server
51+
// Query to fetch Infra details from server
5252
query := `{"query":"query {\n getInfraDetails(infraID : \"` + infraID + `\", \n projectID : \"` + projectID + `\"){\n infraNamespace infraID \n}}"}`
5353
resp, err := SendRequest(SendRequestParams{Endpoint: cred.Endpoint + utils.GQLAPIPath, Token: cred.Token}, []byte(query), string(types.Post))
5454
if err != nil {
@@ -61,7 +61,7 @@ func UpgradeInfra(c context.Context, cred types.Credentials, projectID string, i
6161
}
6262

6363
defer resp.Body.Close()
64-
var infra InfrasData
64+
var infra GetInfraResponse
6565

6666
if resp.StatusCode == http.StatusOK {
6767
err = json.Unmarshal(bodyBytes, &infra)
@@ -102,27 +102,27 @@ func UpgradeInfra(c context.Context, cred types.Credentials, projectID string, i
102102
}
103103

104104
// To write the manifest data into a temporary file
105-
err = ioutil.WriteFile("chaos-delegate-manifest.yaml", []byte(manifest.Data.GetManifest), 0644)
105+
err = ioutil.WriteFile("chaos-infra-manifest.yaml", []byte(manifest.Data.GetManifest), 0644)
106106
if err != nil {
107107
return "", err
108108
}
109109

110-
// Fetching agent-config from the subscriber
111-
configData, err := k8s.GetConfigMap(c, "agent-config", *infra.Data.GetInfraDetails.InfraNamespace)
110+
// Fetching subscriber-config from the subscriber
111+
configData, err := k8s.GetConfigMap(c, "subscriber-config", *infra.Data.GetInfraDetails.InfraNamespace)
112112
if err != nil {
113113
return "", err
114114
}
115115
var configMapString string
116116

117117
metadata := new(bytes.Buffer)
118118
fmt.Fprintf(metadata, "\n%s: %s\n%s: %s\n%s: \n %s: %s\n %s: %s\n%s:\n", "apiVersion", "v1",
119-
"kind", "ConfigMap", "metadata", "name", "agent-config", "namespace", *infra.Data.GetInfraDetails.InfraNamespace, "data")
119+
"kind", "ConfigMap", "metadata", "name", "subscriber-config", "namespace", *infra.Data.GetInfraDetails.InfraNamespace, "data")
120120

121121
for k, v := range configData {
122122
b := new(bytes.Buffer)
123123
if k == "COMPONENTS" {
124124
fmt.Fprintf(b, " %s: |\n %s", k, v)
125-
} else if k == "START_TIME" || k == "IS_CLUSTER_CONFIRMED" {
125+
} else if k == "START_TIME" || k == "IS_INFRA_CONFIRMED" {
126126
fmt.Fprintf(b, " %s: \"%s\"\n", k, v)
127127
} else {
128128
fmt.Fprintf(b, " %s: %s\n", k, v)
@@ -134,30 +134,30 @@ func UpgradeInfra(c context.Context, cred types.Credentials, projectID string, i
134134
yamlOutput, err := k8s.ApplyYaml(k8s.ApplyYamlPrams{
135135
Token: cred.Token,
136136
Endpoint: cred.Endpoint,
137-
YamlPath: "chaos-delegate-manifest.yaml",
137+
YamlPath: "chaos-infra-manifest.yaml",
138138
}, kubeconfig, true)
139139

140140
if err != nil {
141141
return "", err
142142
}
143143
utils.White.Print("\n", yamlOutput)
144144

145-
err = os.Remove("chaos-delegate-manifest.yaml")
145+
err = os.Remove("chaos-infra-manifest.yaml")
146146
if err != nil {
147-
return "Error removing Chaos Delegate manifest: ", err
147+
return "Error removing Chaos Infrastructure manifest: ", err
148148
}
149149

150-
// Creating a backup for current agent-config in the SUBSCRIBER
150+
// Creating a backup for current subscriber-config in the SUBSCRIBER
151151
home, err := homedir.Dir()
152152
cobra.CheckErr(err)
153153

154154
configMapString = metadata.String() + configMapString
155-
err = ioutil.WriteFile(home+"/backupAgentConfig.yaml", []byte(configMapString), 0644)
155+
err = ioutil.WriteFile(home+"/backupSubscriberConfig.yaml", []byte(configMapString), 0644)
156156
if err != nil {
157-
return "Error creating backup for agent config: ", err
157+
return "Error creating backup for subscriber config: ", err
158158
}
159159

160-
utils.White_B.Print("\n ** A backup of agent-config configmap has been saved in your system's home directory as backupAgentConfig.yaml **\n")
160+
utils.White_B.Print("\n ** A backup of subscriber-config configmap has been saved in your system's home directory as backupSubscriberConfig.yaml **\n")
161161

162162
return "Manifest applied successfully", nil
163163
} else {

pkg/cmd/connect/infra.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"github.com/litmuschaos/litmusctl/pkg/completion"
2525

2626
"github.com/litmuschaos/litmusctl/pkg/apis"
27+
"github.com/litmuschaos/litmusctl/pkg/infra_ops"
2728
"github.com/litmuschaos/litmusctl/pkg/k8s"
28-
"github.com/litmuschaos/litmusctl/pkg/ops"
2929
"github.com/litmuschaos/litmusctl/pkg/types"
3030
"github.com/litmuschaos/litmusctl/pkg/utils"
3131

@@ -81,7 +81,7 @@ var infraCmd = &cobra.Command{
8181

8282
if !projectExists {
8383
utils.White_B.Print("Creating a random project...")
84-
newInfra.ProjectId = ops.CreateRandomProject(credentials)
84+
newInfra.ProjectId = infra_ops.CreateRandomProject(credentials)
8585
}
8686
}
8787

@@ -168,14 +168,14 @@ var infraCmd = &cobra.Command{
168168

169169
// Check if user has sufficient permissions based on mode
170170
utils.White_B.Print("\n🏃 Running prerequisites check....")
171-
ops.ValidateSAPermissions(newInfra.Namespace, newInfra.Mode, &kubeconfig)
171+
infra_ops.ValidateSAPermissions(newInfra.Namespace, newInfra.Mode, &kubeconfig)
172172

173173
// Check if infra already exists
174-
isInfraExist, err, infraList := ops.ValidateInfraNameExists(newInfra.InfraName, newInfra.ProjectId, credentials)
174+
isInfraExist, err, infraList := infra_ops.ValidateInfraNameExists(newInfra.InfraName, newInfra.ProjectId, credentials)
175175
utils.PrintError(err)
176176

177177
if isInfraExist {
178-
ops.PrintExistingInfra(infraList)
178+
infra_ops.PrintExistingInfra(infraList)
179179
os.Exit(1)
180180
}
181181
envIDs, err := environment.GetEnvironmentList(newInfra.ProjectId, credentials)
@@ -192,7 +192,7 @@ var infraCmd = &cobra.Command{
192192
}
193193
if !isEnvExist {
194194
utils.Red.Println("\nChaos Environment with the given ID doesn't exists.")
195-
ops.PrintExistingEnvironments(envIDs)
195+
infra_ops.PrintExistingEnvironments(envIDs)
196196
utils.White_B.Println("\n❗ Please enter a name from the List or Create a new environment using `litmusctl create chaos-environment`")
197197
os.Exit(1)
198198
}
@@ -203,25 +203,25 @@ var infraCmd = &cobra.Command{
203203

204204
if newInfra.ProjectId == "" {
205205
// Fetch project id
206-
newInfra.ProjectId = ops.GetProjectID(userDetails)
206+
newInfra.ProjectId = infra_ops.GetProjectID(userDetails)
207207
}
208208

209-
modeType := ops.GetModeType()
209+
modeType := infra_ops.GetModeType()
210210

211211
// Check if user has sufficient permissions based on mode
212212
utils.White_B.Print("\n🏃 Running prerequisites check....")
213-
ops.ValidateSAPermissions(newInfra.Namespace, modeType, &kubeconfig)
214-
newInfra, err = ops.GetInfraDetails(modeType, newInfra.ProjectId, credentials, &kubeconfig)
213+
infra_ops.ValidateSAPermissions(newInfra.Namespace, modeType, &kubeconfig)
214+
newInfra, err = infra_ops.GetInfraDetails(modeType, newInfra.ProjectId, credentials, &kubeconfig)
215215
utils.PrintError(err)
216216

217217
newInfra.ServiceAccount, newInfra.SAExists = k8s.ValidSA(newInfra.Namespace, &kubeconfig)
218218
newInfra.Mode = modeType
219219
}
220220

221-
ops.Summary(newInfra, &kubeconfig)
221+
infra_ops.Summary(newInfra, &kubeconfig)
222222

223223
if !nonInteractive {
224-
ops.ConfirmInstallation()
224+
infra_ops.ConfirmInstallation()
225225
}
226226

227227
infra, err := infrastructure.ConnectInfra(newInfra, credentials)

0 commit comments

Comments
 (0)