gmeghnag / omc

OpenShift Must-Gather Client
Apache License 2.0
153 stars 63 forks source link

The omc use command shows the wrong environment #167

Closed capriott closed 3 months ago

capriott commented 5 months ago

Hi Gabriel,

The omc use command shows the wrong environment:

$ omc use -i QSNv3pMU
Must-Gather  : /path_to_mg1
Project      : default
ApiServerURL : https://api.cluster1.org:6443
Platform     : None

$ omc use -i QSNv3pMU
Must-Gather  : /path_to_mg2
Project      : default
ApiServerURL : https://api.cluster2.org:6443
Platform     : None

Thank you Andrea Capriotti

cchen666 commented 5 months ago

Hi @capriott

Recently I made some changes to the "use" subcommand and added some checks to the omc.json's id. I am not sure whether my PR involves some unexpected behavior. I think in your ~/.omc/omc.json there are two contexts with the exactly same id. If you could let me know how you make different contexts have the same id, that would be very helpful for me to fix this problem. I checked my ~/.omc/omc.json and I couldn't find the duplicate ids for different contexts...

$ cat ~/.omc/omc.json | jq '.contexts[] | .id'
"pWi8PDIn"
"xy6gs5I0"
"dewLQC31"
"RF7Z8Qsv"

Thanks a lot!

gmeghnag commented 3 months ago

fixed with #172