Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge get/list env command #206

Merged

Conversation

shivam-Purohit
Copy link
Contributor

Merges both get chaos-environment and list chaos-envrionments commands into a single command as get chaos-environments.

@shivam-Purohit
Copy link
Contributor Author

@SarthakJain26 its hard to just add a flag and show the whole details. Like not hard but unnecessary cause it will make the command slower if we query all the fields for list environments also. We should consider adding it to descibe or something. WDYT?

@shivam-Purohit
Copy link
Contributor Author

i havent touched other part of the code which can be optimised with this new get environment endpoint, we would do that in some other pr. I will create an issue regarding that.

@shivam-Purohit
Copy link
Contributor Author

/litmusctl get chaos-environments --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a" --environment-id="shivamenv"

CHAOS ENVIRONMENT DETAILS

CHAOS ENVIRONMENT ID	 shivamenv

CHAOS ENVIRONMENT NAME	 shivamenv

CHAOS ENVIRONMENT Type	 NON_PROD

CREATED AT		 55908-04-03 16:42:51 +0530 IST

CREATED BY		 admin

UPDATED AT		 55908-04-03 16:42:51 +0530 IST

UPDATED BY		 admin

CHAOS INFRA IDs	 d99c7d14-56ef-4836-8537-423f28ceac4e

TAGS	
./litmusctl get chaos-environments --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a"

CHAOS ENVIRONMENT ID	CHAOS ENVIRONMENT NAME		CREATED AT			CREATED BY

shivamnewenv		shivamnewenv			55962-10-01 15:05:45 +0530 IST	admin

newenvironmenttest	newenvironmenttest		55912-12-01 10:55:23 +0530 IST	admin

shivamenv		shivamenv			55908-04-03 16:42:51 +0530 IST	admin

Press Enter to show more environments (or type 'q' to quit): q

}
}

environmentList, err := environment.ListChaosEnvironments(projectID, credentials)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we have a check here to see if environmentID is given or not before sending the query

@@ -35,6 +35,9 @@ var GetCmd = &cobra.Command{
#get list of Chaos Experiment runs
litmusctl get chaos-experiment-runs --project-id=""

#get list of Chaos Environments
litmusctl get chaos-experiments --project-id=""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add example for environment-id also

@shivam-Purohit
Copy link
Contributor Author

shivam-Purohit commented Mar 15, 2024

@Nageshbansal does the master branch have updated-dependencies? Not rebasing in case, dont want to add extra commit

@Nageshbansal
Copy link
Collaborator

Not yet, as Pr#209 is still opened.

Copy link
Collaborator

@Nageshbansal Nageshbansal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, geat work 🚀

@SarthakJain26 SarthakJain26 merged commit 47ba363 into litmuschaos:master Apr 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants