Compare commits

..

26 Commits

Author SHA1 Message Date
Sarthak Jain 9f36304f0d
added changes for 1.16 release (#274)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2025-05-21 14:08:23 +05:30
Sarthak Jain 3ce353dcfc
added changes for 1.15.x release (#272)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2025-04-17 14:55:42 +05:30
Baalekshan 9c4c3351ac
docs: added usage for ` update password ` command (#258)
* docs: added usage for update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* revert changes

* Revert "revert changes"

This reverts commit 8aeb2d1fd0.

---------

Signed-off-by: Baalekshan <baalekshan@gmail.com>
2025-04-17 12:37:38 +05:30
Baalekshan 094d1ec037
feat: add initial login check (#263)
Signed-off-by: Baalekshan <baalekshan@gmail.com>
2025-04-17 12:37:20 +05:30
Ayush Sharma b1dba98cfb
fix: update password (#271)
Signed-off-by: Ayush Sharma <kshitij3160@gmail.com>
2025-04-10 17:55:02 +05:30
Sarthak Jain f06f4f9d52
added changes for 1.14.x release (#269)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2025-01-21 16:22:00 +05:30
Ayush Sharma 734ea7dcb3
fix: error on fetching projects (#268)
Signed-off-by: Ayush Sharma <kshitij3160@gmail.com>
2025-01-21 16:09:19 +05:30
Sarthak Jain 902cab3da2
added changes for 1.13.x release (#266)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-12-16 15:42:16 +05:30
Sarthak Jain 1780d64f2f
added changes for 1.12.x release (#265)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-11-18 18:05:11 +05:30
Sarthak Jain 32f32320d6
addde changes for 1.11.0 release (#261)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-10-15 22:28:10 +05:30
Sarthak Jain ff915a9b2e
added changes for 1.10.0 release (#256)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-09-18 00:28:16 +05:30
Baalekshan 0980230d37
feat: added `update password` command (#255)
* feat: added update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* feat: added update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* feat: added update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* feat: added update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

* feat: added update password command

Signed-off-by: Baalekshan <baalekshan@gmail.com>

---------

Signed-off-by: Baalekshan <baalekshan@gmail.com>
2024-09-17 22:53:45 +05:30
Sarthak Jain 4f498493a6
fixed refere header issue, used client-go for chaos infra connection instead of kubectl apply (#254)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-09-16 23:36:35 +05:30
Shivam Purohit 5b4f3cd6c8
Fix for new schema changes (#253)
* get-project:fix for new schema

Signed-off-by: shivam <shivampurohit900@gmail.com>

* remove comments and unnecessary code

Signed-off-by: shivam <shivampurohit900@gmail.com>

* gofmt fix

Signed-off-by: shivam <shivampurohit900@gmail.com>

---------

Signed-off-by: shivam <shivampurohit900@gmail.com>
2024-09-10 22:54:25 +05:30
Shivam Purohit 327ffaa710
Automate homebrew version updation with new release (#248)
* add action for bump-formula homebrew

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

* Update trigger for stable release

* Update release.yml

* Update release.yml

* Update release.yml

---------

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>
2024-08-14 17:56:42 +05:30
Sarthak Jain 86377b15a1
added changes for 1.9.0 release (#251)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-08-14 17:51:28 +05:30
Sarthak Jain ca5e75b3df
added changes for 1.8.0 release (#246)
* added changes for 1.8.0 release

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>

* added changes for 1.8.0 release

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>

---------

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-07-15 17:19:01 +05:30
Sarthak Jain a422a8a7a5
added chaos experiment ID in save experiment command (#245)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-07-15 17:01:03 +05:30
Sarthak Jain fd531ae0e0
1.7.0 release changes (#242)
* added changes for 1.7.0 release

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>

* added changes for 1.7.0 release

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>

---------

Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-06-17 12:02:03 +05:30
dependabot[bot] 06bfd1a21c
--- (#232)
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 13:26:55 +05:30
dependabot[bot] f8426a7006
--- (#233)
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:42:05 +05:30
dependabot[bot] c34fbbc134
Bump github.com/spf13/cobra from 1.7.0 to 1.8
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 12:41:31 +05:30
Raj Das 34a2702e07
Adding dependabot.yml to litmusctl (#230) 2024-05-21 21:37:42 +05:30
Sarthak Jain d5b1d839cd
added changes for 1.6.0 release (#228)
Signed-off-by: Sarthak Jain <sarthak.jain@harness.io>
2024-05-16 12:27:21 +05:30
Shivam Purohit a6b5157f7e
non-interactive output for get experiment (#219)
Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>
2024-05-15 18:15:12 +05:30
Shivam Purohit 5d8e1be588
Probes describe command (#215)
* describe probe command

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

* add output flag for exp describe

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

* describe probe: add option to change output type

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

* fix:fmt

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

* remove comments

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>

---------

Signed-off-by: Shivam Purohit <shivampurohit900@gmail.com>
2024-05-15 18:14:35 +05:30
28 changed files with 643 additions and 246 deletions

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

23
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: release-pipeline
on:
create:
tags:
- '**'
jobs:
homebrew:
name: Bump Homebrew formula
runs-on: ubuntu-latest
steps:
- name: Extract version
id: extract-version
run: |
echo "tag-name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: litmusctl
tag-name: ${{ steps.extract-version.outputs.tag-name }}
download-url: https://github.com/litmuschaos/litmusctl/archive/refs/tags/${{ steps.extract-version.outputs.tag-name }}.tar.gz
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

214
README.md
View File

@ -30,6 +30,61 @@ To check compatibility of litmusctl with Chaos Center
<th>litmusctl version</th> <th>litmusctl version</th>
<th>Lowest Chaos Center supported version</th> <th>Lowest Chaos Center supported version</th>
<th>Highest Chaos Center supported version</th> <th>Highest Chaos Center supported version</th>
<tr>
<td>1.16.0</td>
<td>3.0.0</td>
<td>3.19.0</td>
</tr>
<tr>
<td>1.15.0</td>
<td>3.0.0</td>
<td>3.18.0</td>
</tr>
<tr>
<td>1.14.0</td>
<td>3.0.0</td>
<td>3.15.0</td>
</tr>
<tr>
<td>1.13.0</td>
<td>3.0.0</td>
<td>3.14.0</td>
</tr>
<tr>
<td>1.12.0</td>
<td>3.0.0</td>
<td>3.13.0</td>
</tr>
<tr>
<td>1.11.0</td>
<td>3.0.0</td>
<td>3.12.0</td>
</tr>
<tr>
<td>1.10.0</td>
<td>3.0.0</td>
<td>3.11.0</td>
</tr>
<tr>
<td>1.9.0</td>
<td>3.0.0</td>
<td>3.10.0</td>
</tr>
<tr>
<td>1.8.0</td>
<td>3.0.0</td>
<td>3.9.1</td>
</tr>
<tr>
<td>1.7.0</td>
<td>3.0.0</td>
<td>3.8.0</td>
</tr>
<tr>
<td>1.6.0</td>
<td>3.0.0</td>
<td>3.7.0</td>
</tr>
<tr> <tr>
<td>1.5.0</td> <td>1.5.0</td>
<td>3.0.0</td> <td>3.0.0</td>
@ -60,21 +115,6 @@ To check compatibility of litmusctl with Chaos Center
<td>3.0.0</td> <td>3.0.0</td>
<td>3.1.0</td> <td>3.1.0</td>
</tr> </tr>
<tr>
<td>0.24.0</td>
<td>3.0.0-beta9</td>
<td>3.0.0-beta12</td>
</tr>
<tr>
<td>0.23.0</td>
<td>3.0.0-beta9</td>
<td>3.0.0-beta12</td>
</tr>
<tr>
<td>0.22.0</td>
<td>2.9.0</td>
<td>3.0.0-beta8</td>
</tr>
</table> </table>
## Installation ## Installation
@ -83,109 +123,109 @@ To install the latest version of litmusctl follow the below steps:
<table> <table>
<th>Platforms</th> <th>Platforms</th>
<th>1.5.0</th> <th>1.16.0</th>
<th>1.4.0</th> <th>1.15.0</th>
<th>1.3.0</th> <th>1.14.0</th>
<th>1.2.0</th> <th>1.13.0</th>
<th>1.1.0</th> <th>1.12.0</th>
<th>1.0.0</th> <th>1.11.0</th>
<th>0.24.0</th> <th>1.10.0</th>
<th>0.23.0</th> <th>1.9.0</th>
<th>master(Unreleased)</th> <th>master(Unreleased)</th>
<tr> <tr>
<td>litmusctl-darwin-amd64 (MacOS)</td> <td>litmusctl-darwin-amd64 (MacOS)</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-darwin-amd64-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-linux-386</td> <td>litmusctl-linux-386</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-386-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-linux-amd64</td> <td>litmusctl-linux-amd64</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-amd64-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-linux-arm</td> <td>litmusctl-linux-arm</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-linux-arm64</td> <td>litmusctl-linux-arm64</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-linux-arm64-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-windows-386</td> <td>litmusctl-windows-386</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-386-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-windows-amd64</td> <td>litmusctl-windows-amd64</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-amd64-master.tar.gz">Click here</a></td>
</tr> </tr>
<tr> <tr>
<td>litmusctl-windows-arm</td> <td>litmusctl-windows-arm</td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.5.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.16.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.4.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.15.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.3.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.14.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.2.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.13.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.1.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.12.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.0.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.11.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.24.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.10.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-0.23.0.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-1.9.0.tar.gz">Click here</a></td>
<td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-master.tar.gz">Click here</a></td> <td><a href="https://litmusctl-production-bucket.s3.amazonaws.com/litmusctl-windows-arm-master.tar.gz">Click here</a></td>
</tr> </tr>
</table> </table>

View File

@ -174,14 +174,11 @@ Installation Mode: cluster
🤷 Do you want to continue with the above details? [Y/N]: Y 🤷 Do you want to continue with the above details? [Y/N]: Y
👍 Continuing Chaos Infrastructure connection!! 👍 Continuing Chaos Infrastructure connection!!
Applying YAML:
https://preview.litmuschaos.io/api/file/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbHVzdGVyX2lkIjoiMDUyZmFlN2UtZGM0MS00YmU4LWJiYTgtMmM4ZTYyNDFkN2I0In0.i31QQDG92X5nD6P_-7TfeAAarZqLvUTFfnAghJYXPiM.yaml
💡 Connecting Chaos Infrastructure to ChaosCenter. 💡 Connecting Chaos Infrastructure to ChaosCenter.
🏃 Chaos Infrastructure is running!! 🏃 Chaos Infrastructure is running!!
🚀 Chaos Infrastructure Connection Successful!! 🎉 🚀 Chaos Infrastructure Connection Successful!! 🎉
👉 Litmus Chaos Infrastructure can be accessed here: https://preview.litmuschaos.io/targets
``` ```
#### Verify the new Chaos Infrastructure Connection\*\* #### Verify the new Chaos Infrastructure Connection\*\*
@ -240,6 +237,18 @@ Enter the Chaos Experiment ID: test_exp
### Additional commands ### Additional commands
- To change the ChaosCenter account's password use the `update password` command:
```shell
litmusctl update password
✓ Username: admin
✓ Old Password: ********
✓ New Password: ********
✓ Confirm Password: ********
Password updated successfully!
```
- To view the current configuration of `.litmusconfig`, type: - To view the current configuration of `.litmusconfig`, type:
```shell ```shell

View File

@ -167,15 +167,12 @@ Service Account: litmus (new)
Installation Mode: cluster Installation Mode: cluster
🤷 Do you want to continue with the above details? [Y/N]: Y 🤷 Do you want to continue with the above details? [Y/N]: Y
👍 Continuing Chaos Delegate connection!! 👍 Continuing Chaos Infrastructure connection!!
Applying YAML:
https://preview.litmuschaos.io/api/file/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbHVzdGVyX2lkIjoiMDUyZmFlN2UtZGM0MS00YmU4LWJiYTgtMmM4ZTYyNDFkN2I0In0.i31QQDG92X5nD6P_-7TfeAAarZqLvUTFfnAghJYXPiM.yaml
💡 Connecting Chaos Delegate to ChaosCenter. 💡 Connecting Chaos Infrastructure to ChaosCenter.
🏃 Chaos Delegate is running!! 🏃 Chaos Delegate is running!!
🚀 Chaos Delegate Connection Successful!! 🎉 🚀 Chaos Infrastructure Connection Successful!! 🎉
👉 Litmus Chaos Delegates can be accessed here: https://preview.litmuschaos.io/targets
``` ```
#### Verify the new Chaos Delegate Connection\*\* #### Verify the new Chaos Delegate Connection\*\*
@ -203,6 +200,18 @@ litmusctl create chaos-scenario -f custom-chaos-scenario.yml --project-id="" --c
### Additional commands ### Additional commands
- To change the ChaosCenter account's password use the `update password` command:
```shell
litmusctl update password
✓ Username: admin
✓ Old Password: ********
✓ New Password: ********
✓ Confirm Password: ********
Password updated successfully!
```
- To view the current configuration of `.litmusconfig`, type: - To view the current configuration of `.litmusconfig`, type:
```shell ```shell

17
go.mod
View File

@ -2,10 +2,9 @@ module github.com/litmuschaos/litmusctl
go 1.21 go 1.21
require ( require (
github.com/argoproj/argo-workflows/v3 v3.5.5 github.com/argoproj/argo-workflows/v3 v3.5.5
github.com/fatih/color v1.14.1 github.com/fatih/color v1.17.0
github.com/golang-jwt/jwt v3.2.2+incompatible github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75
github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4 github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4
@ -13,8 +12,8 @@ require (
github.com/manifoldco/promptui v0.9.0 github.com/manifoldco/promptui v0.9.0
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
github.com/sirupsen/logrus v1.9.3 github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0 github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.17.0 github.com/spf13/viper v1.18.2
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.29.2 k8s.io/api v0.29.2
k8s.io/apimachinery v0.29.2 k8s.io/apimachinery v0.29.2
@ -26,7 +25,7 @@ require (
github.com/chzyer/readline v1.5.1 // indirect github.com/chzyer/readline v1.5.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect
@ -46,17 +45,17 @@ require (
github.com/magiconair/properties v1.8.7 // indirect github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.1 // indirect github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect go.uber.org/atomic v1.9.0 // indirect

41
go.sum
View File

@ -640,7 +640,7 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@ -665,15 +665,15 @@ github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J
github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w=
github.com/evanphx/json-patch v5.8.0+incompatible h1:1Av9pn2FyxPdvrWNQszj1g6D6YthSmvCfcN6SYclTJg= github.com/evanphx/json-patch v5.8.0+incompatible h1:1Av9pn2FyxPdvrWNQszj1g6D6YthSmvCfcN6SYclTJg=
github.com/evanphx/json-patch v5.8.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v5.8.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0=
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks=
@ -867,8 +867,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
@ -918,8 +918,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
@ -930,16 +930,16 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ=
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@ -993,7 +993,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@ -1091,7 +1090,6 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
@ -1231,7 +1229,6 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View File

@ -16,6 +16,7 @@ const (
infraID infraID
name name
token token
manifest
} }
} }
` `

View File

@ -151,3 +151,47 @@ func DeleteProbeRequest(pid string, probeid string, cred types.Credentials) (Del
} }
} }
func GetProbeYAMLRequest(pid string, request models.GetProbeYAMLRequest, cred types.Credentials) (GetProbeYAMLResponse, error) {
var gqlReq GetProbeYAMLGQLRequest
gqlReq.Query = GetProbeYAMLQuery
gqlReq.Variables.ProjectID = pid
gqlReq.Variables.Request = request
query, err := json.Marshal(gqlReq)
if err != nil {
return GetProbeYAMLResponse{}, errors.New("Error in getting probe details" + err.Error())
}
resp, err := apis.SendRequest(
apis.SendRequestParams{
Endpoint: cred.ServerEndpoint + utils.GQLAPIPath,
Token: cred.Token,
},
query,
string(types.Post),
)
if err != nil {
return GetProbeYAMLResponse{}, errors.New("Error in getting probe details" + err.Error())
}
bodyBytes, err := io.ReadAll(resp.Body)
defer resp.Body.Close()
if err != nil {
return GetProbeYAMLResponse{}, errors.New("Error in getting probe details" + err.Error())
}
if resp.StatusCode == http.StatusOK {
var getProbeYAMLResponse GetProbeYAMLResponse
err = json.Unmarshal(bodyBytes, &getProbeYAMLResponse)
if err != nil {
return GetProbeYAMLResponse{}, errors.New("Error in getting probes details" + err.Error())
}
if len(getProbeYAMLResponse.Errors) > 0 {
return GetProbeYAMLResponse{}, errors.New(getProbeYAMLResponse.Errors[0].Message)
}
return getProbeYAMLResponse, nil
} else {
return GetProbeYAMLResponse{}, errors.New("Unmatched status code:" + string(bodyBytes))
}
}

View File

@ -70,6 +70,11 @@ const (
} }
} }
` `
GetProbeYAMLQuery = `query getProbeYAML($projectID: ID!, $request: GetProbeYAMLRequest!) {
getProbeYAML(projectID: $projectID, request: $request)
}
`
DeleteProbeQuery = `mutation deleteProbe($probeName: ID!, $projectID: ID!) { DeleteProbeQuery = `mutation deleteProbe($probeName: ID!, $projectID: ID!) {
deleteProbe(probeName: $probeName, projectID: $projectID) deleteProbe(probeName: $probeName, projectID: $projectID)
} }

View File

@ -60,3 +60,23 @@ type DeleteProbeResponse struct {
type DeleteProbeResponseData struct { type DeleteProbeResponseData struct {
DeleteProbe bool `json:"deleteProbe"` DeleteProbe bool `json:"deleteProbe"`
} }
type GetProbeYAMLGQLRequest struct {
Query string `json:"query"`
Variables struct {
ProjectID string `json:"projectID"`
Request model.GetProbeYAMLRequest `json:"request"`
} `json:"variables"`
}
type GetProbeYAMLResponse struct {
Errors []struct {
Message string `json:"message"`
Path []string `json:"path"`
} `json:"errors"`
Data GetProbeYAMLResponseData `json:"data"`
}
type GetProbeYAMLResponseData struct {
GetProbeYAML string `json:"getProbeYAML"`
}

View File

@ -82,10 +82,14 @@ func CreateProjectRequest(projectName string, cred types.Credentials) (CreatePro
} }
type listProjectResponse struct { type listProjectResponse struct {
Data []struct { Message string `json:"message"`
ID string `json:"ProjectID"` Data struct {
Name string `json:"Name"` Projects []struct {
CreatedAt int64 `json:"CreatedAt"` ID string `json:"projectID"` // Adjusted field name
Name string `json:"name"`
CreatedAt int64 `json:"createdAt"`
} `json:"projects"`
TotalNumberOfProjects int `json:"totalNumberOfProjects"`
} `json:"data"` } `json:"data"`
Errors []struct { Errors []struct {
Message string `json:"message"` Message string `json:"message"`
@ -104,7 +108,6 @@ func ListProject(cred types.Credentials) (listProjectResponse, error) {
if err != nil { if err != nil {
return listProjectResponse{}, err return listProjectResponse{}, err
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode == http.StatusOK { if resp.StatusCode == http.StatusOK {
@ -112,6 +115,7 @@ func ListProject(cred types.Credentials) (listProjectResponse, error) {
err = json.Unmarshal(bodyBytes, &data) err = json.Unmarshal(bodyBytes, &data)
if err != nil { if err != nil {
return listProjectResponse{}, err return listProjectResponse{}, err
} }
if len(data.Errors) > 0 { if len(data.Errors) > 0 {

View File

@ -32,6 +32,7 @@ func SendRequest(params SendRequestParams, payload []byte, method string) (*http
} }
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", params.Token) req.Header.Set("Authorization", params.Token)
req.Header.Set("Referer", params.Endpoint)
resp, err := http.DefaultClient.Do(req) resp, err := http.DefaultClient.Do(req)
if err != nil { if err != nil {

View File

@ -6,6 +6,7 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/sirupsen/logrus"
"io" "io"
"net/http" "net/http"
"os" "os"
@ -125,11 +126,12 @@ func UpgradeInfra(c context.Context, cred types.Credentials, projectID string, i
} }
yamlOutput, err := k8s.UpgradeInfra([]byte(manifest.Data.GetManifest), kubeconfig) yamlOutput, err := k8s.ApplyManifest([]byte(manifest.Data.GetManifest), kubeconfig)
if err != nil { if err != nil {
return "", err return "", err
} }
logrus.Println("🚀 Successfully Upgraded Chaos Infrastructure")
utils.White.Print("\n", yamlOutput) utils.White.Print("\n", yamlOutput)
// Creating a backup for current subscriber-config in the SUBSCRIBER // Creating a backup for current subscriber-config in the SUBSCRIBER

View File

@ -16,7 +16,9 @@ limitations under the License.
package config package config
import ( import (
"encoding/json"
"fmt" "fmt"
"io"
"net/url" "net/url"
"os" "os"
"strings" "strings"
@ -173,6 +175,37 @@ var setAccountCmd = &cobra.Command{
utils.PrintError(err) utils.PrintError(err)
} }
utils.White_B.Printf("\naccount.username/%s configured", claims["username"].(string)) utils.White_B.Printf("\naccount.username/%s configured", claims["username"].(string))
credentials, err := utils.GetCredentials(cmd)
if err != nil {
utils.PrintError(err)
}
endpoint := credentials.Endpoint + utils.AuthAPIPath + "/get_user/" + claims["uid"].(string)
userResp, err := apis.SendRequest(
apis.SendRequestParams{
Endpoint: endpoint,
Token: "Bearer " + credentials.Token,
},
nil,
string(types.Get),
)
if err != nil {
utils.PrintError(err)
}
bodyBytes, err := io.ReadAll(userResp.Body)
if err != nil {
utils.PrintError(err)
}
var userResponse map[string]interface{}
err = json.Unmarshal(bodyBytes, &userResponse)
if err != nil {
utils.PrintError(err)
}
isInitialLogin := userResponse["isInitialLogin"].(bool)
if isInitialLogin {
utils.White_B.Println("\n❗ This is your first time login. Update your default password to perform further operations.")
utils.White.Println(fmt.Sprintf("Use '%s' to update your password.", utils.White_B.Sprint("litmusctl update password")))
}
} else { } else {
utils.Red.Println("\nError: some flags are missing. Run 'litmusctl config set-account --help' for usage. ") utils.Red.Println("\nError: some flags are missing. Run 'litmusctl config set-account --help' for usage. ")
} }

View File

@ -16,9 +16,10 @@ limitations under the License.
package connect package connect
import ( import (
"fmt"
"os" "os"
"github.com/sirupsen/logrus"
"github.com/litmuschaos/litmusctl/pkg/apis/environment" "github.com/litmuschaos/litmusctl/pkg/apis/environment"
"github.com/litmuschaos/litmusctl/pkg/apis/infrastructure" "github.com/litmuschaos/litmusctl/pkg/apis/infrastructure"
@ -235,34 +236,25 @@ var infraCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
path := fmt.Sprintf("%s%s/%s.yaml", credentials.Endpoint, utils.ChaosYamlPath, infra.Data.RegisterInfraDetails.Token)
utils.White_B.Print("Applying YAML:\n", path)
// Print error message in case Data field is null in response // Print error message in case Data field is null in response
if (infra.Data == infrastructure.RegisterInfra{}) { if (infra.Data == infrastructure.RegisterInfra{}) {
utils.White_B.Print("\n🚫 Chaos new infrastructure connection failed: " + infra.Errors[0].Message + "\n") utils.White_B.Print("\n🚫 Chaos new infrastructure connection failed: " + infra.Errors[0].Message + "\n")
os.Exit(1) os.Exit(1)
} }
//Apply infra connection yaml yamlOutput, err := k8s.ApplyManifest([]byte(infra.Data.RegisterInfraDetails.Manifest), kubeconfig)
yamlOutput, err := k8s.ApplyYaml(k8s.ApplyYamlParams{
Token: infra.Data.RegisterInfraDetails.Token,
Endpoint: credentials.Endpoint,
YamlPath: utils.ChaosYamlPath,
}, kubeconfig, false)
if err != nil { if err != nil {
utils.Red.Print("\n❌ Failed to apply connection yaml: \n" + err.Error() + "\n") utils.Red.Println("\n❌ failed to apply infra manifest, error: " + err.Error())
utils.White_B.Print("\n Error: \n" + err.Error())
os.Exit(1) os.Exit(1)
} }
logrus.Println("🚀 Successfully Connected Chaos Infrastructure")
utils.White_B.Print("\n", yamlOutput) utils.White.Print("\n", yamlOutput)
// Watch subscriber pod status // Watch subscriber pod status
k8s.WatchPod(k8s.WatchPodParams{Namespace: newInfra.Namespace, Label: utils.ChaosInfraLabel}, &kubeconfig) k8s.WatchPod(k8s.WatchPodParams{Namespace: newInfra.Namespace, Label: utils.ChaosInfraLabel}, &kubeconfig)
utils.White_B.Println("\n🚀 Chaos new infrastructure connection successful!! 🎉") utils.White_B.Println("\n🚀 Chaos new infrastructure connection successful!! 🎉")
utils.White_B.Println("👉 Litmus Chaos Infrastructure can be accessed here: " + fmt.Sprintf("%s/%s", credentials.Endpoint, utils.ChaosInfraPath))
}, },
} }

View File

@ -27,6 +27,9 @@ var DescribeCmd = &cobra.Command{
#describe a Chaos Experiment #describe a Chaos Experiment
litmusctl describe chaos-experiment d861b650-1549-4574-b2ba-ab754058dd04 --project-id="d861b650-1549-4574-b2ba-ab754058dd04" litmusctl describe chaos-experiment d861b650-1549-4574-b2ba-ab754058dd04 --project-id="d861b650-1549-4574-b2ba-ab754058dd04"
#describe a Probe
litmusctl describe probe --project-id="d861b650-1549-4574-b2ba-ab754058dd04" --probe-id="exampleProbe"
Note: The default location of the config file is $HOME/.litmusconfig, and can be overridden by a --config flag Note: The default location of the config file is $HOME/.litmusconfig, and can be overridden by a --config flag
`, `,
} }

View File

@ -102,22 +102,27 @@ var experimentCmd = &cobra.Command{
os.Exit(1) os.Exit(1)
} }
expOutput, err := cmd.Flags().GetString("output")
utils.PrintError(err)
// Add an output format prompt // Add an output format prompt
prompt := promptui.Select{ if expOutput == "" {
Label: "Select an output format", prompt := promptui.Select{
Items: []string{"YAML", "JSON"}, Label: "Select an output format",
} Items: []string{"yaml", "json"},
i, _, err := prompt.Run() }
if err != nil { _, value, err := prompt.Run()
utils.PrintError(err) expOutput = value
os.Exit(1) if err != nil {
utils.PrintError(err)
os.Exit(1)
}
} }
switch i { switch expOutput {
case 0: case "yaml":
// Output as YAML (default) // Output as YAML (default)
utils.PrintInYamlFormat(string(yamlManifest)) utils.PrintInYamlFormat(string(yamlManifest))
case 1: case "json":
// Output as JSON // Output as JSON
jsonData, err := yaml.YAMLToJSON(yamlManifest) jsonData, err := yaml.YAMLToJSON(yamlManifest)
if err != nil { if err != nil {
@ -144,4 +149,5 @@ func init() {
DescribeCmd.AddCommand(experimentCmd) DescribeCmd.AddCommand(experimentCmd)
experimentCmd.Flags().String("project-id", "", "Set the project-id to list Chaos Experiments from the particular project. To see the projects, apply litmusctl get projects") experimentCmd.Flags().String("project-id", "", "Set the project-id to list Chaos Experiments from the particular project. To see the projects, apply litmusctl get projects")
experimentCmd.Flags().String("output", "", "Set the output format for the experiment")
} }

126
pkg/cmd/describe/probe.go Normal file
View File

@ -0,0 +1,126 @@
// /*
// Copyright © 2021 The LitmusChaos Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// */
package describe
import (
"bytes"
"encoding/json"
"fmt"
"os"
"github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model"
apis "github.com/litmuschaos/litmusctl/pkg/apis/probe"
"github.com/litmuschaos/litmusctl/pkg/utils"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"
)
var probeCmd = &cobra.Command{
Use: "probe",
Short: "Describe a Probe within the project",
Long: `Describe a Probe within the project`,
Run: func(cmd *cobra.Command, args []string) {
credentials, err := utils.GetCredentials(cmd)
utils.PrintError(err)
var getProbeYAMLRequest model.GetProbeYAMLRequest
pid, err := cmd.Flags().GetString("project-id")
utils.PrintError(err)
if pid == "" {
prompt := promptui.Prompt{
Label: "Enter the Project ID",
}
result, err := prompt.Run()
if err != nil {
utils.PrintError(err)
os.Exit(1)
}
pid = result
}
var probeID string
probeID, err = cmd.Flags().GetString("probe-id")
utils.PrintError(err)
// Handle blank input for Probe ID
if probeID == "" {
utils.White_B.Print("\nEnter the Probe ID: ")
fmt.Scanln(&probeID)
if probeID == "" {
utils.Red.Println("⛔ Probe ID can't be empty!!")
os.Exit(1)
}
}
getProbeYAMLRequest.ProbeName = probeID
probeMode, err := cmd.Flags().GetString("mode")
utils.PrintError(err)
if probeMode == "" {
prompt := promptui.Select{
Label: "Please select the probe mode ?",
Items: []string{"SOT", "EOT", "Edge", "Continuous", "OnChaos"},
}
_, option, err := prompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return
}
probeMode = option
fmt.Printf("You chose %q\n", option)
}
getProbeYAMLRequest.Mode = model.Mode(probeMode)
getProbeYAML, err := apis.GetProbeYAMLRequest(pid, getProbeYAMLRequest, credentials)
if err != nil {
utils.Red.Println(err)
os.Exit(1)
}
getProbeYAMLData := getProbeYAML.Data.GetProbeYAML
probeOutput, err := cmd.Flags().GetString("output")
utils.PrintError(err)
switch probeOutput {
case "json":
jsonData, _ := yaml.YAMLToJSON([]byte(getProbeYAMLData))
var prettyJSON bytes.Buffer
err = json.Indent(&prettyJSON, jsonData, "", " ")
if err != nil {
utils.Red.Println("❌ Error formatting JSON: " + err.Error())
os.Exit(1)
}
fmt.Println(prettyJSON.String())
default:
utils.PrintInYamlFormat(getProbeYAMLData)
}
},
}
func init() {
DescribeCmd.AddCommand(probeCmd)
probeCmd.Flags().String("project-id", "", "Set the project-id to get Probe details from the particular project. To see the projects, apply litmusctl get projects")
probeCmd.Flags().String("probe-id", "", "Set the probe-id to get the Probe details in Yaml format")
probeCmd.Flags().String("mode", "", "Set the mode for the probes from SOT/EOT/Edge/Continuous/OnChaos ")
probeCmd.Flags().String("output", "", "Set the output format for the probe")
}

View File

@ -77,14 +77,16 @@ var experimentsCmd = &cobra.Command{
} }
} }
outputFormat := "" outputFormat, err := cmd.Flags().GetString("output")
outputPrompt := promptui.Select{
Label: "Select an output format",
Items: []string{"table", "json", "yaml"},
}
_, outputFormat, err = outputPrompt.Run()
utils.PrintError(err) utils.PrintError(err)
if outputFormat == "" {
outputPrompt := promptui.Select{
Label: "Select an output format",
Items: []string{"table", "json", "yaml"},
}
_, outputFormat, err = outputPrompt.Run()
utils.PrintError(err)
}
switch outputFormat { switch outputFormat {
case "json": case "json":
utils.PrintInJsonFormat(experiments.Data) utils.PrintInJsonFormat(experiments.Data)

View File

@ -45,12 +45,12 @@ var projectsCmd = &cobra.Command{
utils.PrintInJsonFormat(projects.Data) utils.PrintInJsonFormat(projects.Data)
case "yaml": case "yaml":
utils.PrintInYamlFormat(projects.Data) utils.PrintInYamlFormat(projects.Data.Projects)
case "": case "":
itemsPerPage := 5 itemsPerPage := 5
page := 1 page := 1
totalProjects := len(projects.Data) totalProjects := len(projects.Data.Projects)
for { for {
// calculating the start and end indices for the current page // calculating the start and end indices for the current page
@ -69,9 +69,9 @@ var projectsCmd = &cobra.Command{
// displaying the projects for the current page // displaying the projects for the current page
writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight)
utils.White_B.Fprintln(writer, "PROJECT ID\tPROJECT NAME\tCREATED AT") utils.White_B.Fprintln(writer, "PROJECT ID\tPROJECT NAME\tCREATED AT")
for _, project := range projects.Data[start:end] { for _, project := range projects.Data.Projects[start:end] {
intTime := project.CreatedAt intTime := project.CreatedAt
humanTime := time.Unix(intTime, 0) humanTime := time.Unix(intTime/1000, 0) // Convert milliseconds to second
utils.White.Fprintln(writer, project.ID+"\t"+project.Name+"\t"+humanTime.String()+"\t") utils.White.Fprintln(writer, project.ID+"\t"+project.Name+"\t"+humanTime.String()+"\t")
} }
writer.Flush() writer.Flush()

View File

@ -24,6 +24,7 @@ import (
"github.com/litmuschaos/litmusctl/pkg/cmd/run" "github.com/litmuschaos/litmusctl/pkg/cmd/run"
"github.com/litmuschaos/litmusctl/pkg/cmd/save" "github.com/litmuschaos/litmusctl/pkg/cmd/save"
"github.com/litmuschaos/litmusctl/pkg/cmd/update"
"github.com/litmuschaos/litmusctl/pkg/cmd/connect" "github.com/litmuschaos/litmusctl/pkg/cmd/connect"
"github.com/litmuschaos/litmusctl/pkg/cmd/delete" "github.com/litmuschaos/litmusctl/pkg/cmd/delete"
@ -74,6 +75,7 @@ func init() {
rootCmd.AddCommand(upgrade.UpgradeCmd) rootCmd.AddCommand(upgrade.UpgradeCmd)
rootCmd.AddCommand(save.SaveCmd) rootCmd.AddCommand(save.SaveCmd)
rootCmd.AddCommand(run.RunCmd) rootCmd.AddCommand(run.RunCmd)
rootCmd.AddCommand(update.UpdateCmd)
// Here you will define your flags and configuration settings. // Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here, // Cobra supports persistent flags, which, if defined here,

View File

@ -23,9 +23,6 @@ import (
models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model"
"github.com/litmuschaos/litmusctl/pkg/apis/experiment" "github.com/litmuschaos/litmusctl/pkg/apis/experiment"
//"time"
//"github.com/gorhill/cronexpr"
"github.com/litmuschaos/litmusctl/pkg/apis" "github.com/litmuschaos/litmusctl/pkg/apis"
"github.com/litmuschaos/litmusctl/pkg/utils" "github.com/litmuschaos/litmusctl/pkg/utils"
@ -123,21 +120,22 @@ var experimentCmd = &cobra.Command{
if (saveExperiment.Data == experiment.SavedExperimentDetails{}) { if (saveExperiment.Data == experiment.SavedExperimentDetails{}) {
if strings.Contains(err.Error(), "multiple write errors") { if strings.Contains(err.Error(), "multiple write errors") {
utils.Red.Println("\n❌ Chaos Experiment/" + chaosExperimentRequest.Name + " already exists") utils.Red.Println("\n❌ Chaos Experiment " + chaosExperimentRequest.Name + " already exists")
os.Exit(1) os.Exit(1)
} }
if strings.Contains(err.Error(), "no documents in result") { if strings.Contains(err.Error(), "no documents in result") {
utils.Red.Println("❌ The specified Project ID or Chaos Infrastructure ID doesn't exist.") utils.Red.Println("❌ The specified Project ID or Chaos Infrastructure ID doesn't exist.")
os.Exit(1) os.Exit(1)
} else { } else {
utils.White_B.Print("\n❌ Chaos Experiment/" + chaosExperimentRequest.Name + " failed to be created: " + err.Error()) utils.White_B.Print("\n❌ Chaos Experiment " + chaosExperimentRequest.Name + " failed to be created: " + err.Error())
os.Exit(1) os.Exit(1)
} }
} }
} }
//Successful creation //Successful creation
utils.White_B.Println("\n🚀 Chaos Experiment/" + chaosExperimentRequest.Name + " successfully saved 🎉") utils.White_B.Println("\n🚀 Chaos Experiment " + chaosExperimentRequest.Name + " successfully saved 🎉")
utils.White_B.Println("\nChaos Experiment ID: " + chaosExperimentRequest.ID)
}, },
} }

111
pkg/cmd/update/password.go Normal file
View File

@ -0,0 +1,111 @@
package update
import (
"encoding/json"
"errors"
"io"
"net/http"
"os"
"github.com/litmuschaos/litmusctl/pkg/apis"
"github.com/litmuschaos/litmusctl/pkg/types"
"github.com/litmuschaos/litmusctl/pkg/utils"
"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
)
var PasswordCmd = &cobra.Command{
Use: "password",
Short: `Updates an account's password.
Examples(s)
#update a user's password
litmusctl update password
`,
Run: func(cmd *cobra.Command, args []string) {
var (
updatePasswordRequest types.UpdatePasswordInput
)
credentials, err := utils.GetCredentials(cmd)
if err != nil {
utils.PrintError(err)
}
promptUsername := promptui.Prompt{
Label: "Username",
}
updatePasswordRequest.Username, err = promptUsername.Run()
if err != nil {
utils.PrintError(err)
}
promptOldPassword := promptui.Prompt{
Label: "Old Password",
Mask: '*',
}
updatePasswordRequest.OldPassword, err = promptOldPassword.Run()
if err != nil {
utils.PrintError(err)
}
NEW_PASSWORD:
promptNewPassword := promptui.Prompt{
Label: "New Password",
Mask: '*',
}
updatePasswordRequest.NewPassword, err = promptNewPassword.Run()
if err != nil {
utils.PrintError(err)
}
promptConfirmPassword := promptui.Prompt{
Label: "Confirm New Password",
Mask: '*',
}
confirmPassword, err := promptConfirmPassword.Run()
if err != nil {
utils.PrintError(err)
}
if updatePasswordRequest.NewPassword != confirmPassword {
utils.Red.Println("\nPasswords do not match. Please try again.")
goto NEW_PASSWORD
}
payloadBytes, _ := json.Marshal(updatePasswordRequest)
resp, err := apis.SendRequest(
apis.SendRequestParams{
Endpoint: credentials.Endpoint + utils.AuthAPIPath + "/update/password",
Token: "Bearer " + credentials.Token,
},
payloadBytes,
string(types.Post),
)
if err != nil {
utils.PrintError(err)
os.Exit(1)
}
defer resp.Body.Close()
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
utils.PrintError(err)
os.Exit(1)
}
if resp.StatusCode == http.StatusOK {
utils.White_B.Println("\nPassword updated successfully!")
} else {
err := errors.New("Unmatched status code: " + string(bodyBytes))
if err != nil {
utils.Red.Println("\nError updating password: ", err)
os.Exit(1)
}
}
},
}
func init() {
UpdateCmd.AddCommand(PasswordCmd)
}

15
pkg/cmd/update/update.go Normal file
View File

@ -0,0 +1,15 @@
package update
import (
"github.com/spf13/cobra"
)
var UpdateCmd = &cobra.Command{
Use: "update",
Short: `It updates ChaosCenter account's details.
Examples
#update password
litmusctl update password
`,
}

View File

@ -21,11 +21,8 @@ import (
"errors" "errors"
"flag" "flag"
"fmt" "fmt"
"io"
"log" "log"
"net/http"
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"k8s.io/client-go/discovery/cached/memory" "k8s.io/client-go/discovery/cached/memory"
@ -282,70 +279,8 @@ func ValidSA(namespace string, kubeconfig *string) (string, bool) {
return sa, false return sa, false
} }
// Token: Authorization token // ApplyManifest applies the provided manifest and kubeconfig with the help of client-go library.
// EndPoint: Endpoint in .litmusconfig func ApplyManifest(manifest []byte, kubeconfig string) (string, error) {
// YamlPath: Path of yaml file
type ApplyYamlParams struct {
Token string
Endpoint string
YamlPath string
}
func ApplyYaml(params ApplyYamlParams, kubeconfig string, isLocal bool) (output string, err error) {
path := params.YamlPath
if !isLocal {
path = fmt.Sprintf("%s%s/%s.yaml", params.Endpoint, params.YamlPath, params.Token)
req, err := http.NewRequest("GET", path, nil)
if err != nil {
return "", err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
resp_body, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
err = os.WriteFile("chaos-infra-manifest.yaml", resp_body, 0644)
if err != nil {
return "", err
}
path = "chaos-infra-manifest.yaml"
}
args := []string{"kubectl", "apply", "-f", path}
if kubeconfig != "" {
args = append(args, []string{"--kubeconfig", kubeconfig}...)
} else {
args = []string{"kubectl", "apply", "-f", path}
}
cmd := exec.Command(args[0], args[1:]...)
var stdout, stderr bytes.Buffer
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err = cmd.Run()
outStr, errStr := stdout.String(), stderr.String()
// err, can have exit status 1
if err != nil {
// if we get standard error then, return the same
if errStr != "" {
return "", fmt.Errorf(errStr)
}
// if not standard error found, return error
return "", err
}
// If no error found, return standard output
return outStr, nil
}
// UpgradeInfra upgrades the Chaos Infrastructure using the provided manifest and kubeconfig with the help of client-go library.
func UpgradeInfra(manifest []byte, kubeconfig string) (string, error) {
// Get Kubernetes and dynamic clients along with the configuration. // Get Kubernetes and dynamic clients along with the configuration.
_, kubeClient, dynamicClient, err := getClientAndConfig(kubeconfig) _, kubeClient, dynamicClient, err := getClientAndConfig(kubeconfig)
@ -365,10 +300,7 @@ func UpgradeInfra(manifest []byte, kubeconfig string) (string, error) {
return "", err return "", err
} }
logrus.Println("🚀 Successfully Upgraded Chaos Infra")
return "Success", nil return "Success", nil
} }
// retrieves the Kubernetes and dynamic clients along with the configuration. // retrieves the Kubernetes and dynamic clients along with the configuration.

View File

@ -41,3 +41,9 @@ type Credentials struct {
Endpoint string Endpoint string
ServerEndpoint string ServerEndpoint string
} }
type UpdatePasswordInput struct {
Username string `json:"username,omitempty"`
OldPassword string
NewPassword string
}

View File

@ -28,5 +28,16 @@ var (
"1.3.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0"}, "1.3.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0"},
"1.4.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0"}, "1.4.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0"},
"1.5.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0"}, "1.5.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0"},
"1.6.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0"},
"1.7.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0"},
"1.8.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1"},
"1.9.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0"},
"1.10.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0"},
"1.11.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0"},
"1.12.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0", "3.13.0"},
"1.13.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0", "3.13.0", "3.14.0"},
"1.14.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0", "3.13.0", "3.14.0", "3.15.0"},
"1.15.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0", "3.13.0", "3.14.0", "3.15.0", "3.16.0", "3.17.0", "3.18.0"},
"1.16.0": {"3.0.0", "3.1.0", "3.2.0", "3.3.0", "3.4.0", "3.5.0", "3.6.0", "3.6.1", "3.7.0", "3.8.0", "3.9.0", "3.9.1", "3.10.0", "3.11.0", "3.12.0", "3.13.0", "3.14.0", "3.15.0", "3.16.0", "3.17.0", "3.18.0", "3.19.0"},
} }
) )