From efa5627dea1fe4cc961929376616a1e8b725ce72 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 21 Mar 2024 19:09:41 +0530 Subject: [PATCH 01/18] fix Signed-off-by: Shivam Purohit --- go.mod | 15 ++- go.sum | 300 +++++++++------------------------------------------------ 2 files changed, 54 insertions(+), 261 deletions(-) diff --git a/go.mod b/go.mod index 330eb76..c06071e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/litmuschaos/litmusctl -go 1.20 +go 1.21 + +toolchain go1.22.1 require ( github.com/argoproj/argo-workflows/v3 v3.5.5 @@ -34,7 +36,6 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.7.0 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect @@ -51,13 +52,17 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pelletier/go-toml v1.9.4 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.10.0 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.9.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/net v0.22.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sys v0.18.0 // indirect diff --git a/go.sum b/go.sum index d7aec23..2f3a447 100644 --- a/go.sum +++ b/go.sum @@ -27,7 +27,6 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= @@ -270,7 +269,6 @@ cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCV cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= cloud.google.com/go/filestore v1.5.0/go.mod h1:FqBXDWBp4YLHqRnVGveOkHDf8svj9r5+mUDLupOWEDs= cloud.google.com/go/filestore v1.6.0/go.mod h1:di5unNuss/qfZTw2U9nhFqo8/ZDSc466dre85Kydllg= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= @@ -598,40 +596,19 @@ gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zum git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= -github.com/argoproj/argo-workflows/v3 v3.3.1 h1:cNhY6JRlMvwu0qhfCWtS/XmQ8nm2OjR7CBZ3K6zbcKI= -github.com/argoproj/argo-workflows/v3 v3.3.1/go.mod h1:/VCBeEAgrhuNlrmlrdqS75mx2x77FwbotAjTmqpoAE4= github.com/argoproj/argo-workflows/v3 v3.5.5 h1:3K3YiVBzVuNhHv0ssESDzkMeCpNqMtH7r3QUsLIBi3Q= github.com/argoproj/argo-workflows/v3 v3.5.5/go.mod h1:ysAnH0uQUEkGZMmoVqCRDsuOnLiWfGajhNPVDIxQPgs= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= @@ -640,7 +617,6 @@ github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -651,8 +627,6 @@ github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObk github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -664,23 +638,16 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/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-20211130200136-a8f946100490/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/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= -github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -691,24 +658,21 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +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/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= 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.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 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= @@ -719,37 +683,21 @@ github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmn github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= @@ -760,7 +708,6 @@ github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0L github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -787,7 +734,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= @@ -795,10 +741,7 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic v0.7.0 h1:d7EpuFp8vVdML+y0JJJYiKeOLjKTdH/GvVkLOBWqJpw= github.com/google/gnostic v0.7.0/go.mod h1:IAcUyMl6vtC95f60EZ8oXyqTsOersP6HbwjeG7EyDPM= github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= @@ -817,7 +760,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -847,8 +789,8 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJY github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -870,61 +812,27 @@ github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= @@ -933,14 +841,12 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -949,141 +855,93 @@ github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4 h1:GVU1 github.com/litmuschaos/chaos-operator v0.0.0-20230718113617-6819a4be12e4/go.mod h1:i6wMEZRQoHjUy4bhq6ePuA2FChX1b7WBR2lH09iM0tU= github.com/litmuschaos/litmus/chaoscenter/graphql/server v0.0.0-20240115142759-7a29dc1eb1d8 h1:Hu5I2NRugLXseU60mC25Da8lLbuXfUtmqQQuY+FELco= github.com/litmuschaos/litmus/chaoscenter/graphql/server v0.0.0-20240115142759-7a29dc1eb1d8/go.mod h1:bS4JreJjEAUeMbp1iFDqaP/3QN8YZXF7TmDXSRru/7s= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= -github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= 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.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= 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/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= 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-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +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/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 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.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= -github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= 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.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= 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/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= -github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= 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.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -1095,11 +953,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= @@ -1112,9 +970,6 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1125,20 +980,17 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/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-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -1157,6 +1009,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1200,8 +1054,6 @@ golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1209,11 +1061,9 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1237,7 +1087,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/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= @@ -1260,8 +1109,6 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1279,9 +1126,7 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= @@ -1312,33 +1157,22 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1358,13 +1192,11 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1377,11 +1209,9 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1406,8 +1236,6 @@ 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.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1416,8 +1244,6 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1435,15 +1261,11 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1464,7 +1286,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1512,7 +1333,8 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1521,7 +1343,6 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= @@ -1559,9 +1380,7 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= @@ -1595,7 +1414,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= @@ -1630,7 +1448,6 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1659,17 +1476,12 @@ google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c h1:TU4rFa5APdKTq0s6B7WTsH6Xmx0Knj86s6Biz56mErE= google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= @@ -1775,7 +1587,6 @@ google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnD google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= @@ -1805,38 +1616,28 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.3 h1:jRskFVxYaMGAMUbN0UZ7niA9gzL9B49DOqE78vg0k3w= -gopkg.in/ini.v1 v1.66.3/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= @@ -1851,23 +1652,14 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.27.3 h1:yR6oQXXnUEBWEWcvPWS0jQL575KoAboQPfJAuKNrw5Y= k8s.io/api v0.27.3/go.mod h1:C4BNvZnQOF7JA/0Xed2S+aUyJSfTGkGFxLXz9MnpIpg= -k8s.io/apiextensions-apiserver v0.21.2/go.mod h1:+Axoz5/l3AYpGLlhJDfcVQzCerVYq3K3CvDMvw6X1RA= k8s.io/apimachinery v0.27.3 h1:Ubye8oBufD04l9QnNtW05idcOe9Z3GQN8+7PqmuVcUM= k8s.io/apimachinery v0.27.3/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.27.3 h1:7dnEGHZEJld3lYwxvLl7WoehK6lAq7GvgjxpA3nv1E8= k8s.io/client-go v0.27.3/go.mod h1:2MBEKuTo6V1lbKy3z1euEGnhPfGZLKTS9tiJ2xodM48= -k8s.io/component-base v0.21.2/go.mod h1:9lvmIThzdlrJj5Hp8Z/TOgIkdfsNARQ1pT+3PByuiuc= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= -k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= -k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= -k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY= k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= @@ -1912,11 +1704,7 @@ sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPEC sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From 966e489c146c2aa2545cfc4a8d738d771d28f376 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Tue, 5 Mar 2024 19:55:32 +0530 Subject: [PATCH 02/18] add get/list probe command Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 63 +++++++++++++++++ pkg/apis/probe/query.go | 17 +++++ pkg/apis/probe/types.go | 25 +++++++ pkg/cmd/get/get.go | 3 + pkg/cmd/get/probe.go | 153 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 261 insertions(+) create mode 100644 pkg/apis/probe/probe.go create mode 100644 pkg/apis/probe/query.go create mode 100644 pkg/apis/probe/types.go create mode 100644 pkg/cmd/get/probe.go diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go new file mode 100644 index 0000000..a0c173b --- /dev/null +++ b/pkg/apis/probe/probe.go @@ -0,0 +1,63 @@ +package probe + +import ( + "encoding/json" + "errors" + "io" + "net/http" + + + models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + "github.com/litmuschaos/litmusctl/pkg/apis" + "github.com/litmuschaos/litmusctl/pkg/types" + "github.com/litmuschaos/litmusctl/pkg/utils" +) + +func ListProbeRequest(pid string, probetypes []* models.ProbeType, cred types.Credentials) (ListProbeResponse, error) { + var gqlReq ListProbeGQLRequest + gqlReq.Query = ListProbeQuery + gqlReq.Variables.ProjectID = pid + gqlReq.Variables.InfrastructureType = nil + gqlReq.Variables.Filter = models.ProbeFilterInput{ + Type: probetypes, + } + + query, err := json.Marshal(gqlReq) + if err != nil { + return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) + } + resp, err := apis.SendRequest( + apis.SendRequestParams{ + Endpoint: cred.ServerEndpoint + utils.GQLAPIPath, + Token: cred.Token, + }, + query, + string(types.Post), + ) + + if err != nil { + return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) + } + + bodyBytes, err := io.ReadAll(resp.Body) + defer resp.Body.Close() + if err != nil { + return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) + } + + if resp.StatusCode == http.StatusOK { + var listProbeResponse ListProbeResponse + err = json.Unmarshal(bodyBytes, &listProbeResponse) + if err != nil { + return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) + } + if len(listProbeResponse.Errors) > 0 { + return ListProbeResponse{}, errors.New(listProbeResponse.Errors[0].Message) + } + return listProbeResponse, nil + + } else { + return ListProbeResponse{}, errors.New("Unmatched status code:" + string(bodyBytes)) + } + +} \ No newline at end of file diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go new file mode 100644 index 0000000..b40212f --- /dev/null +++ b/pkg/apis/probe/query.go @@ -0,0 +1,17 @@ +package probe + +const ( + ListProbeQuery = `query ListProbes($projectID: ID!, $infrastructureType: InfrastructureType, $probeNames: [ID!], $filter: ProbeFilterInput) { + listProbes(projectID: $projectID, infrastructureType: $infrastructureType, probeNames: $probeNames, filter: $filter) { + name + description + type + createdAt + createdBy{ + username + } + } + } + ` +) + diff --git a/pkg/apis/probe/types.go b/pkg/apis/probe/types.go new file mode 100644 index 0000000..c60af90 --- /dev/null +++ b/pkg/apis/probe/types.go @@ -0,0 +1,25 @@ +package probe + +import model "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + +type ListProbeGQLRequest struct { + Query string `json:"query"` + Variables struct { + ProjectID string `json:"projectID"` + InfrastructureType *model.InfrastructureType `json:"infrastructureType"` + ProbeNames []string `json:"probeNames"` + Filter model.ProbeFilterInput `json:"probeFilterInput"` + } `json:"variables"` +} + +type ListProbeResponse struct { + Errors []struct { + Message string `json:"message"` + Path []string `json:"path"` + } `json:"errors"` + Data ListProbeResponseData `json:"data"` +} + +type ListProbeResponseData struct { + Probes []model.Probe `json:"listProbes"` +} diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index a271432..98f281a 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -35,6 +35,9 @@ var GetCmd = &cobra.Command{ #get list of Chaos Experiment runs litmusctl get chaos-experiment-runs --project-id="" + #get list of Probes in a Project + litmusctl list probes --project-id="" + Note: The default location of the config file is $HOME/.litmusconfig, and can be overridden by a --config flag `, } diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go new file mode 100644 index 0000000..adea93b --- /dev/null +++ b/pkg/cmd/get/probe.go @@ -0,0 +1,153 @@ +/* +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 get + +import ( + "fmt" + "os" + "strconv" + "text/tabwriter" + "time" + + apis "github.com/litmuschaos/litmusctl/pkg/apis/probe" + models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + "github.com/litmuschaos/litmusctl/pkg/utils" + "github.com/spf13/cobra" + "github.com/manifoldco/promptui" +) + +var probesCmd = &cobra.Command{ + Use: "probes", + Short: "Display list of probes", + Long: `Display list of probes`, + Run: func(cmd *cobra.Command, args []string) { + credentials, err := utils.GetCredentials(cmd) + utils.PrintError(err) + + var projectID string + projectID, err = cmd.Flags().GetString("project-id") + utils.PrintError(err) + + if projectID == "" { + utils.White_B.Print("\nEnter the Project ID: ") + fmt.Scanln(&projectID) + + if projectID == "" { + utils.Red.Println("⛔ Project ID can't be empty!!") + os.Exit(1) + } + } + + prompt := promptui.Select{ + Label: "Do you want to enable advance filter probes?", + Items: []string{"Yes", "No"}, + } + _, option, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + return + } + fmt.Printf("You chose %q\n", option) + var selectedItems []* models.ProbeType + if option == "Yes" { + items := [] models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + for { + prompt := promptui.Select{ + Label: "Select ProbeType", + Items: items, + Templates: &promptui.SelectTemplates{ + Active: `▸ {{ . | cyan }}`, + Inactive: ` {{ . | white }}`, + Selected: `{{ "✔" | green }} {{ . | bold }}`, + }, + } + + selectedIndex, result, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + os.Exit(1) + } + + if items[selectedIndex] == "done" { + break + } + + final := models.ProbeType(result) + selectedItems = append(selectedItems, &final) + items = append(items[:selectedIndex], items[selectedIndex+1:]...) + + } + + fmt.Printf("Selected Probe Types: %v\n", selectedItems) + } + + probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) + probes_data := probes_get.Data.Probes + + itemsPerPage := 5 + page := 1 + totalProbes := len(probes_data) + + writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) + utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") + + for { + writer.Flush() + // calculating the start and end indices for the current page + start := (page - 1) * itemsPerPage + if start >= totalProbes { + utils.Red.Println("No more probes to display") + writer.Flush() + break + } + end := start + itemsPerPage + if end > totalProbes { + end = totalProbes + } + for _, probe := range probes_data[start:end] { + intTime, err := strconv.ParseInt(probe.CreatedAt, 10, 64) + if err != nil { + fmt.Println("Error converting CreatedAt to int64:", err) + continue + } + humanTime := time.Unix(intTime, 0) + utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) + } + writer.Flush() + + // Check if it's the last item or if user wants to see more + paginationPrompt := promptui.Prompt{ + Label: "Press Enter to show more environments (or type 'q' to quit)", + AllowEdit: true, + Default: "", + } + + userInput, err := paginationPrompt.Run() + utils.PrintError(err) + + if userInput == "q" { + break + } + // Move to the next page + page++ + } +}, +} + +func init() { + GetCmd.AddCommand(probesCmd) + + probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") + probesCmd.Flags().String("non-intereactive-mode", "", "Set the non-intereactive-mode to true to false to pass probetype value as a flag") + probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") +} \ No newline at end of file From 7039f61bb51cbb461da0d1187562a69cb5017c88 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Tue, 5 Mar 2024 19:56:05 +0530 Subject: [PATCH 03/18] fix:fmt Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 5 ++--- pkg/apis/probe/query.go | 1 - pkg/apis/probe/types.go | 8 ++++---- pkg/cmd/get/probe.go | 28 +++++++++++++++------------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go index a0c173b..9daa14d 100644 --- a/pkg/apis/probe/probe.go +++ b/pkg/apis/probe/probe.go @@ -6,14 +6,13 @@ import ( "io" "net/http" - models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" "github.com/litmuschaos/litmusctl/pkg/apis" "github.com/litmuschaos/litmusctl/pkg/types" "github.com/litmuschaos/litmusctl/pkg/utils" ) -func ListProbeRequest(pid string, probetypes []* models.ProbeType, cred types.Credentials) (ListProbeResponse, error) { +func ListProbeRequest(pid string, probetypes []*models.ProbeType, cred types.Credentials) (ListProbeResponse, error) { var gqlReq ListProbeGQLRequest gqlReq.Query = ListProbeQuery gqlReq.Variables.ProjectID = pid @@ -60,4 +59,4 @@ func ListProbeRequest(pid string, probetypes []* models.ProbeType, cred types.Cr return ListProbeResponse{}, errors.New("Unmatched status code:" + string(bodyBytes)) } -} \ No newline at end of file +} diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index b40212f..9a8939f 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -14,4 +14,3 @@ const ( } ` ) - diff --git a/pkg/apis/probe/types.go b/pkg/apis/probe/types.go index c60af90..36edac9 100644 --- a/pkg/apis/probe/types.go +++ b/pkg/apis/probe/types.go @@ -5,10 +5,10 @@ import model "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/mod type ListProbeGQLRequest struct { Query string `json:"query"` Variables struct { - ProjectID string `json:"projectID"` - InfrastructureType *model.InfrastructureType `json:"infrastructureType"` - ProbeNames []string `json:"probeNames"` - Filter model.ProbeFilterInput `json:"probeFilterInput"` + ProjectID string `json:"projectID"` + InfrastructureType *model.InfrastructureType `json:"infrastructureType"` + ProbeNames []string `json:"probeNames"` + Filter model.ProbeFilterInput `json:"probeFilterInput"` } `json:"variables"` } diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index adea93b..c50d3fe 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -3,7 +3,9 @@ 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. @@ -19,11 +21,11 @@ import ( "text/tabwriter" "time" - apis "github.com/litmuschaos/litmusctl/pkg/apis/probe" models "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/spf13/cobra" "github.com/manifoldco/promptui" + "github.com/spf13/cobra" ) var probesCmd = &cobra.Command{ @@ -58,9 +60,9 @@ var probesCmd = &cobra.Command{ return } fmt.Printf("You chose %q\n", option) - var selectedItems []* models.ProbeType + var selectedItems []*models.ProbeType if option == "Yes" { - items := [] models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} for { prompt := promptui.Select{ Label: "Select ProbeType", @@ -77,30 +79,30 @@ var probesCmd = &cobra.Command{ fmt.Printf("Prompt failed %v\n", err) os.Exit(1) } - + if items[selectedIndex] == "done" { break } - + final := models.ProbeType(result) selectedItems = append(selectedItems, &final) items = append(items[:selectedIndex], items[selectedIndex+1:]...) } - + fmt.Printf("Selected Probe Types: %v\n", selectedItems) - } - + } + probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) probes_data := probes_get.Data.Probes itemsPerPage := 5 page := 1 totalProbes := len(probes_data) - + writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") - + for { writer.Flush() // calculating the start and end indices for the current page @@ -141,7 +143,7 @@ var probesCmd = &cobra.Command{ // Move to the next page page++ } -}, + }, } func init() { @@ -150,4 +152,4 @@ func init() { probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") probesCmd.Flags().String("non-intereactive-mode", "", "Set the non-intereactive-mode to true to false to pass probetype value as a flag") probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") -} \ No newline at end of file +} From 1b74e596495e0becc59f128897539d324ab70309 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 7 Mar 2024 19:16:19 +0530 Subject: [PATCH 04/18] get-probes:add non-interactivte flag support Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 1 - pkg/cmd/get/probe.go | 89 ++++++++++++++++++++++++----------------- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go index 9daa14d..908645a 100644 --- a/pkg/apis/probe/probe.go +++ b/pkg/apis/probe/probe.go @@ -20,7 +20,6 @@ func ListProbeRequest(pid string, probetypes []*models.ProbeType, cred types.Cre gqlReq.Variables.Filter = models.ProbeFilterInput{ Type: probetypes, } - query, err := json.Marshal(gqlReq) if err != nil { return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index c50d3fe..035f273 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -18,6 +18,7 @@ import ( "fmt" "os" "strconv" + "strings" "text/tabwriter" "time" @@ -50,47 +51,61 @@ var probesCmd = &cobra.Command{ } } - prompt := promptui.Select{ - Label: "Do you want to enable advance filter probes?", - Items: []string{"Yes", "No"}, - } - _, option, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - return - } - fmt.Printf("You chose %q\n", option) + interactiveMode, err := cmd.Flags().GetBool("non-interactive") + var selectedItems []*models.ProbeType - if option == "Yes" { - items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} - for { - prompt := promptui.Select{ - Label: "Select ProbeType", - Items: items, - Templates: &promptui.SelectTemplates{ - Active: `▸ {{ . | cyan }}`, - Inactive: ` {{ . | white }}`, - Selected: `{{ "✔" | green }} {{ . | bold }}`, - }, - } - selectedIndex, result, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - os.Exit(1) - } + if interactiveMode == true { + prompt := promptui.Select{ + Label: "Do you want to enable advance filter probes?", + Items: []string{"Yes", "No"}, + } + _, option, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + return + } + fmt.Printf("You chose %q\n", option) + + if option == "Yes" { + items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + for { + prompt := promptui.Select{ + Label: "Select ProbeType", + Items: items, + Templates: &promptui.SelectTemplates{ + Active: `▸ {{ . | cyan }}`, + Inactive: ` {{ . | white }}`, + Selected: `{{ "✔" | green }} {{ . | bold }}`, + }, + } + + selectedIndex, result, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + os.Exit(1) + } + + if items[selectedIndex] == "done" { + break + } + + final := models.ProbeType(result) + selectedItems = append(selectedItems, &final) + items = append(items[:selectedIndex], items[selectedIndex+1:]...) - if items[selectedIndex] == "done" { - break } - final := models.ProbeType(result) - selectedItems = append(selectedItems, &final) - items = append(items[:selectedIndex], items[selectedIndex+1:]...) - + fmt.Printf("Selected Probe Types: %v\n", selectedItems) + } + } else { + var probeTypes string + probeTypes, err = cmd.Flags().GetString("probe-types") + values := strings.Split(probeTypes, ",") + for _, value := range values { + probeType := models.ProbeType(value) + selectedItems = append(selectedItems, &probeType) } - - fmt.Printf("Selected Probe Types: %v\n", selectedItems) } probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) @@ -129,7 +144,7 @@ var probesCmd = &cobra.Command{ // Check if it's the last item or if user wants to see more paginationPrompt := promptui.Prompt{ - Label: "Press Enter to show more environments (or type 'q' to quit)", + Label: "Press Enter to show more probes (or type 'q' to quit)", AllowEdit: true, Default: "", } @@ -150,6 +165,6 @@ func init() { GetCmd.AddCommand(probesCmd) probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") - probesCmd.Flags().String("non-intereactive-mode", "", "Set the non-intereactive-mode to true to false to pass probetype value as a flag") + probesCmd.Flags().BoolP("non-interactive", "n", false, "Set it to true for non interactive mode | Note: Always set the boolean flag as --non-interactive=Boolean") probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") } From 534bf7c71fe4de36fe35bfdeaabc1b58bb36a272 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 7 Mar 2024 19:41:31 +0530 Subject: [PATCH 05/18] fix:non-iteractive mode Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 035f273..1bb15c6 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -51,11 +51,11 @@ var probesCmd = &cobra.Command{ } } - interactiveMode, err := cmd.Flags().GetBool("non-interactive") + NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") var selectedItems []*models.ProbeType - if interactiveMode == true { + if NoninteractiveMode == false { prompt := promptui.Select{ Label: "Do you want to enable advance filter probes?", Items: []string{"Yes", "No"}, From 8f589e6d2a1a260d04faf164a5ba4f5fe5849d73 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 8 Mar 2024 12:16:43 +0530 Subject: [PATCH 06/18] add probe-id flag for probe details Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 47 +++++++++ pkg/apis/probe/query.go | 18 ++++ pkg/apis/probe/types.go | 20 ++++ pkg/cmd/get/probe.go | 218 +++++++++++++++++++++++----------------- 4 files changed, 208 insertions(+), 95 deletions(-) diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go index 908645a..a5f65b4 100644 --- a/pkg/apis/probe/probe.go +++ b/pkg/apis/probe/probe.go @@ -12,6 +12,53 @@ import ( "github.com/litmuschaos/litmusctl/pkg/utils" ) +func GetProbeRequest(pid string, probeID string, cred types.Credentials) (GetProbeResponse, error) { + var gqlReq GetProbeGQLRequest + gqlReq.Query = GetProbeQuery + gqlReq.Variables.ProjectID = pid + gqlReq.Variables.ProbeName = probeID + + query, err := json.Marshal(gqlReq) + if err != nil { + return GetProbeResponse{}, errors.New("Error in getting requested probe" + err.Error()) + } + + resp, err := apis.SendRequest( + apis.SendRequestParams{ + Endpoint: cred.ServerEndpoint + utils.GQLAPIPath, + Token: cred.Token, + }, + query, + string(types.Post), + ) + + if err != nil { + return GetProbeResponse{}, errors.New("Error in getting requested probe" + err.Error()) + } + + bodyBytes, err := io.ReadAll(resp.Body) + defer resp.Body.Close() + if err != nil { + return GetProbeResponse{}, errors.New("Error in getting requested probe" + err.Error()) + } + + if resp.StatusCode == http.StatusOK { + var getProbeResponse GetProbeResponse + err = json.Unmarshal(bodyBytes, &getProbeResponse) + if err != nil { + return GetProbeResponse{}, errors.New("Error in getting requested probe" + err.Error()) + } + if len(getProbeResponse.Errors) > 0 { + return GetProbeResponse{}, errors.New(getProbeResponse.Errors[0].Message) + } + return getProbeResponse, nil + + } else { + return GetProbeResponse{}, errors.New("Unmatched status code:" + string(bodyBytes)) + } + +} + func ListProbeRequest(pid string, probetypes []*models.ProbeType, cred types.Credentials) (ListProbeResponse, error) { var gqlReq ListProbeGQLRequest gqlReq.Query = ListProbeQuery diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index 9a8939f..999f36e 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -13,4 +13,22 @@ const ( } } ` + GetProbeQuery = `query getProbe($projectID: ID!, $probeName: ID!) { + getProbe(projectID: $projectID, probeName: $probeName) { + name + description + type + infrastructureType + createdAt + createdBy{ + username + } + updatedAt + updatedBy{ + username + } + tags + } + } + ` ) diff --git a/pkg/apis/probe/types.go b/pkg/apis/probe/types.go index 36edac9..5e1a2f3 100644 --- a/pkg/apis/probe/types.go +++ b/pkg/apis/probe/types.go @@ -2,6 +2,26 @@ package probe import model "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" +type GetProbeGQLRequest struct { + Query string `json:"query"` + Variables struct { + ProjectID string `json:"projectID"` + ProbeName string `json:"probeName"` + } `json:"variables"` +} + +type GetProbeResponse struct { + Errors []struct { + Message string `json:"message"` + Path []string `json:"path"` + } `json:"errors"` + Data GetProbeResponseData `json:"data"` +} + +type GetProbeResponseData struct { + GetProbe model.Probe `json:"getProbe"` +} + type ListProbeGQLRequest struct { Query string `json:"query"` Variables struct { diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 1bb15c6..c5f30c1 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -50,114 +50,141 @@ var probesCmd = &cobra.Command{ os.Exit(1) } } - - NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") - - var selectedItems []*models.ProbeType - - if NoninteractiveMode == false { - prompt := promptui.Select{ - Label: "Do you want to enable advance filter probes?", - Items: []string{"Yes", "No"}, - } - _, option, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - return - } - fmt.Printf("You chose %q\n", option) - - if option == "Yes" { - items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} - for { + ProbeID, err := cmd.Flags().GetString("probe-id") + + if ProbeID == "" { + //check for interactive or not interactive mode + //also give option to the user for getting probe details of a single probe + + var selectedItems []*models.ProbeType + NoninteractiveMode,err := cmd.Flags().GetBool("non-interactive") + utils.PrintError(err) + + if NoninteractiveMode == false { + prompt := promptui.Select{ + Label: "Do you want details about a single Probe?", + Items: []string{"Yes", "No"}, + } + _, option, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + return + } + fmt.Printf("You chose %q\n", option) + if option == "Yes" { + utils.Red.Println("calling that same get probe thing") + + } else { prompt := promptui.Select{ - Label: "Select ProbeType", - Items: items, - Templates: &promptui.SelectTemplates{ - Active: `▸ {{ . | cyan }}`, - Inactive: ` {{ . | white }}`, - Selected: `{{ "✔" | green }} {{ . | bold }}`, - }, + Label: "Do you want to enable advance filter probes?", + Items: []string{"Yes", "No"}, } - - selectedIndex, result, err := prompt.Run() + _, option, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) - os.Exit(1) + return } - - if items[selectedIndex] == "done" { - break + fmt.Printf("You chose %q\n", option) + + if option == "Yes" { + items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + for { + prompt := promptui.Select{ + Label: "Select ProbeType", + Items: items, + Templates: &promptui.SelectTemplates{ + Active: `▸ {{ . | cyan }}`, + Inactive: ` {{ . | white }}`, + Selected: `{{ "✔" | green }} {{ . | bold }}`, + }, + } + + selectedIndex, result, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + os.Exit(1) + } + + if items[selectedIndex] == "done" { + break + } + + final := models.ProbeType(result) + selectedItems = append(selectedItems, &final) + items = append(items[:selectedIndex], items[selectedIndex+1:]...) + + } + + fmt.Printf("Selected Probe Types: %v\n", selectedItems) } - - final := models.ProbeType(result) - selectedItems = append(selectedItems, &final) - items = append(items[:selectedIndex], items[selectedIndex+1:]...) - } - - fmt.Printf("Selected Probe Types: %v\n", selectedItems) - } - } else { - var probeTypes string - probeTypes, err = cmd.Flags().GetString("probe-types") - values := strings.Split(probeTypes, ",") - for _, value := range values { - probeType := models.ProbeType(value) - selectedItems = append(selectedItems, &probeType) + + } else { + var probeTypes string + probeTypes, err = cmd.Flags().GetString("probe-types") + values := strings.Split(probeTypes, ",") + for _, value := range values { + probeType := models.ProbeType(value) + selectedItems = append(selectedItems, &probeType) + } } - } - - probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) - probes_data := probes_get.Data.Probes - - itemsPerPage := 5 - page := 1 - totalProbes := len(probes_data) - - writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) - utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") - - for { - writer.Flush() - // calculating the start and end indices for the current page - start := (page - 1) * itemsPerPage - if start >= totalProbes { - utils.Red.Println("No more probes to display") + + probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) + probes_data := probes_get.Data.Probes + + itemsPerPage := 5 + page := 1 + totalProbes := len(probes_data) + + writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) + utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") + + for { writer.Flush() - break - } - end := start + itemsPerPage - if end > totalProbes { - end = totalProbes - } - for _, probe := range probes_data[start:end] { - intTime, err := strconv.ParseInt(probe.CreatedAt, 10, 64) - if err != nil { - fmt.Println("Error converting CreatedAt to int64:", err) - continue + // calculating the start and end indices for the current page + start := (page - 1) * itemsPerPage + if start >= totalProbes { + utils.Red.Println("No more probes to display") + writer.Flush() + break } - humanTime := time.Unix(intTime, 0) - utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) - } - writer.Flush() - - // Check if it's the last item or if user wants to see more - paginationPrompt := promptui.Prompt{ - Label: "Press Enter to show more probes (or type 'q' to quit)", - AllowEdit: true, - Default: "", + end := start + itemsPerPage + if end > totalProbes { + end = totalProbes + } + for _, probe := range probes_data[start:end] { + intTime, err := strconv.ParseInt(probe.CreatedAt, 10, 64) + if err != nil { + fmt.Println("Error converting CreatedAt to int64:", err) + continue + } + humanTime := time.Unix(intTime, 0) + utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) + } + writer.Flush() + + // Check if it's the last item or if user wants to see more + paginationPrompt := promptui.Prompt{ + Label: "Press Enter to show more probes (or type 'q' to quit)", + AllowEdit: true, + Default: "", + } + + userInput, err := paginationPrompt.Run() + utils.PrintError(err) + + if userInput == "q" { + break + } + // Move to the next page + page++ } - userInput, err := paginationPrompt.Run() - utils.PrintError(err) - - if userInput == "q" { - break - } - // Move to the next page - page++ + } else { + //call the probe get endpoint to get the probes details + utils.Red.Println("get probe endpoint") } + }, } @@ -167,4 +194,5 @@ func init() { probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") probesCmd.Flags().BoolP("non-interactive", "n", false, "Set it to true for non interactive mode | Note: Always set the boolean flag as --non-interactive=Boolean") probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") + probesCmd.Flags().String("probe-id", "", "Set the probe-details to the ID of probe for getting all the details related to the probe.") } From 69884552d0008738f4254dcbed4ebf653de1db20 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 8 Mar 2024 15:46:32 +0530 Subject: [PATCH 07/18] improve logic for probe-id flag Signed-off-by: Shivam Purohit --- pkg/apis/probe/query.go | 1 - pkg/cmd/get/probe.go | 135 ++++++++++++++++++++++------------------ 2 files changed, 74 insertions(+), 62 deletions(-) diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index 999f36e..002c120 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -4,7 +4,6 @@ const ( ListProbeQuery = `query ListProbes($projectID: ID!, $infrastructureType: InfrastructureType, $probeNames: [ID!], $filter: ProbeFilterInput) { listProbes(projectID: $projectID, infrastructureType: $infrastructureType, probeNames: $probeNames, filter: $filter) { name - description type createdAt createdBy{ diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index c5f30c1..52544f7 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -51,18 +51,15 @@ var probesCmd = &cobra.Command{ } } ProbeID, err := cmd.Flags().GetString("probe-id") - + if ProbeID == "" { - //check for interactive or not interactive mode - //also give option to the user for getting probe details of a single probe - var selectedItems []*models.ProbeType - NoninteractiveMode,err := cmd.Flags().GetBool("non-interactive") + NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") utils.PrintError(err) - + if NoninteractiveMode == false { prompt := promptui.Select{ - Label: "Do you want details about a single Probe?", + Label: "Do you want to enable advance filter probes?", Items: []string{"Yes", "No"}, } _, option, err := prompt.Run() @@ -71,54 +68,38 @@ var probesCmd = &cobra.Command{ return } fmt.Printf("You chose %q\n", option) + if option == "Yes" { - utils.Red.Println("calling that same get probe thing") - - } else { - prompt := promptui.Select{ - Label: "Do you want to enable advance filter probes?", - Items: []string{"Yes", "No"}, - } - _, option, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - return - } - fmt.Printf("You chose %q\n", option) - - if option == "Yes" { - items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} - for { - prompt := promptui.Select{ - Label: "Select ProbeType", - Items: items, - Templates: &promptui.SelectTemplates{ - Active: `▸ {{ . | cyan }}`, - Inactive: ` {{ . | white }}`, - Selected: `{{ "✔" | green }} {{ . | bold }}`, - }, - } - - selectedIndex, result, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - os.Exit(1) - } - - if items[selectedIndex] == "done" { - break - } - - final := models.ProbeType(result) - selectedItems = append(selectedItems, &final) - items = append(items[:selectedIndex], items[selectedIndex+1:]...) - + items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + for { + prompt := promptui.Select{ + Label: "Select ProbeType", + Items: items, + Templates: &promptui.SelectTemplates{ + Active: `▸ {{ . | cyan }}`, + Inactive: ` {{ . | white }}`, + Selected: `{{ "✔" | green }} {{ . | bold }}`, + }, } - - fmt.Printf("Selected Probe Types: %v\n", selectedItems) + + selectedIndex, result, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + os.Exit(1) + } + + if items[selectedIndex] == "done" { + break + } + + final := models.ProbeType(result) + selectedItems = append(selectedItems, &final) + items = append(items[:selectedIndex], items[selectedIndex+1:]...) + } + + fmt.Printf("Selected Probe Types: %v\n", selectedItems) } - } else { var probeTypes string probeTypes, err = cmd.Flags().GetString("probe-types") @@ -128,20 +109,19 @@ var probesCmd = &cobra.Command{ selectedItems = append(selectedItems, &probeType) } } - + probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) probes_data := probes_get.Data.Probes - + itemsPerPage := 5 page := 1 totalProbes := len(probes_data) - + writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") - + for { writer.Flush() - // calculating the start and end indices for the current page start := (page - 1) * itemsPerPage if start >= totalProbes { utils.Red.Println("No more probes to display") @@ -162,27 +142,60 @@ var probesCmd = &cobra.Command{ utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) } writer.Flush() - - // Check if it's the last item or if user wants to see more + paginationPrompt := promptui.Prompt{ Label: "Press Enter to show more probes (or type 'q' to quit)", AllowEdit: true, Default: "", } - + userInput, err := paginationPrompt.Run() utils.PrintError(err) - + if userInput == "q" { break } - // Move to the next page page++ } } else { //call the probe get endpoint to get the probes details utils.Red.Println("get probe endpoint") + probeGet, err := apis.GetProbeRequest(projectID, ProbeID, credentials) + if err != nil { + if strings.Contains(err.Error(), "permission_denied") { + utils.Red.Println("❌ You don't have enough permissions to access this resource.") + os.Exit(1) + } else { + utils.PrintError(err) + os.Exit(1) + } + } + probeGetData := probeGet.Data.GetProbe + writer := tabwriter.NewWriter(os.Stdout, 30, 8, 0, '\t', tabwriter.AlignRight) + writer.Flush() + intUpdateTime, err := strconv.ParseInt(probeGetData.UpdatedAt, 10, 64) + if err != nil { + utils.Red.Println("Error converting UpdatedAt to int64:", err) + } + updatedTime := time.Unix(intUpdateTime, 0).String() + intCreatedTime, err := strconv.ParseInt(probeGetData.CreatedAt, 10, 64) + if err != nil { + utils.Red.Println("Error converting CreatedAt to int64:", err) + } + createdTime := time.Unix(intCreatedTime, 0).String() + writer.Flush() + utils.White_B.Fprintln(writer, "PROBE DETAILS") + utils.White.Fprintln(writer, "PROBE ID\t", probeGetData.Name) + utils.White.Fprintln(writer, "PROBE DESCRIPTION\t", *probeGetData.Description) + utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) + utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) + utils.White.Fprintln(writer, "CREATED AT\t", createdTime) + utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) + utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) + utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) + utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) + writer.Flush() } }, From 958a385451c149f8b19ef2974bf4e4fa65a60bf2 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Wed, 13 Mar 2024 10:48:59 +0530 Subject: [PATCH 08/18] fix:filter query on listprobe command Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 2 +- pkg/apis/probe/query.go | 8 ++++++-- pkg/apis/probe/types.go | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go index a5f65b4..75de8d6 100644 --- a/pkg/apis/probe/probe.go +++ b/pkg/apis/probe/probe.go @@ -63,10 +63,10 @@ func ListProbeRequest(pid string, probetypes []*models.ProbeType, cred types.Cre var gqlReq ListProbeGQLRequest gqlReq.Query = ListProbeQuery gqlReq.Variables.ProjectID = pid - gqlReq.Variables.InfrastructureType = nil gqlReq.Variables.Filter = models.ProbeFilterInput{ Type: probetypes, } + query, err := json.Marshal(gqlReq) if err != nil { return ListProbeResponse{}, errors.New("Error in listing probes" + err.Error()) diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index 002c120..d91d110 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -1,8 +1,8 @@ package probe const ( - ListProbeQuery = `query ListProbes($projectID: ID!, $infrastructureType: InfrastructureType, $probeNames: [ID!], $filter: ProbeFilterInput) { - listProbes(projectID: $projectID, infrastructureType: $infrastructureType, probeNames: $probeNames, filter: $filter) { + ListProbeQuery = `query ListProbes($projectID: ID!, $probeNames: [ID!], $filter: ProbeFilterInput) { + listProbes(projectID: $projectID, probeNames: $probeNames, filter: $filter) { name type createdAt @@ -30,4 +30,8 @@ const ( } } ` + DeleteProbeQuery = `mutation deleteProbe($probeName: ID!, $projectID: ID!) { + deleteProbe(probeName: $probeName, projectID: $projectID) + } + ` ) diff --git a/pkg/apis/probe/types.go b/pkg/apis/probe/types.go index 5e1a2f3..f1a21fc 100644 --- a/pkg/apis/probe/types.go +++ b/pkg/apis/probe/types.go @@ -26,9 +26,7 @@ type ListProbeGQLRequest struct { Query string `json:"query"` Variables struct { ProjectID string `json:"projectID"` - InfrastructureType *model.InfrastructureType `json:"infrastructureType"` - ProbeNames []string `json:"probeNames"` - Filter model.ProbeFilterInput `json:"probeFilterInput"` + Filter model.ProbeFilterInput `json:"filter"` } `json:"variables"` } From a340bf38c5f1d531d563674f5e8baedbae8f49ab Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Wed, 13 Mar 2024 10:49:26 +0530 Subject: [PATCH 09/18] fix:fmt Signed-off-by: Shivam Purohit --- pkg/apis/probe/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/probe/types.go b/pkg/apis/probe/types.go index f1a21fc..13320d0 100644 --- a/pkg/apis/probe/types.go +++ b/pkg/apis/probe/types.go @@ -25,8 +25,8 @@ type GetProbeResponseData struct { type ListProbeGQLRequest struct { Query string `json:"query"` Variables struct { - ProjectID string `json:"projectID"` - Filter model.ProbeFilterInput `json:"filter"` + ProjectID string `json:"projectID"` + Filter model.ProbeFilterInput `json:"filter"` } `json:"variables"` } From c970333f8e88b3deec51c4e1265024e3c42928f0 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Sat, 16 Mar 2024 15:38:32 +0530 Subject: [PATCH 10/18] get probe:add more details Signed-off-by: Shivam Purohit --- pkg/apis/probe/query.go | 78 +++++++++++++++++++++ pkg/cmd/get/get.go | 2 +- pkg/cmd/get/probe.go | 147 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 220 insertions(+), 7 deletions(-) diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index d91d110..86a771e 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -18,6 +18,84 @@ const ( description type infrastructureType + kubernetesHTTPProperties{ + probeTimeout + interval + retry + attempt + probePollingInterval + initialDelay + evaluationTimeout + stopOnFailure + url + method{ + get{ + criteria + responseCode + } + post{ + contentType + body + bodyPath + criteria + responseCode + } + } + insecureSkipVerify + } + kubernetesCMDProperties{ + probeTimeout + interval + retry + attempt + probePollingInterval + initialDelay + evaluationTimeout + stopOnFailure + command + comparator { + type + value + criteria + } + source + } + k8sProperties { + probeTimeout + interval + retry + attempt + probePollingInterval + initialDelay + evaluationTimeout + stopOnFailure + group + version + resource + namespace + resourceNames + fieldSelector + labelSelector + operation + } + promProperties { + probeTimeout + interval + retry + attempt + probePollingInterval + initialDelay + evaluationTimeout + stopOnFailure + endpoint + query + queryPath + comparator{ + type + value + criteria + } + } createdAt createdBy{ username diff --git a/pkg/cmd/get/get.go b/pkg/cmd/get/get.go index 98f281a..b41a526 100644 --- a/pkg/cmd/get/get.go +++ b/pkg/cmd/get/get.go @@ -36,7 +36,7 @@ var GetCmd = &cobra.Command{ litmusctl get chaos-experiment-runs --project-id="" #get list of Probes in a Project - litmusctl list probes --project-id="" + litmusctl get probes --project-id="" Note: The default location of the config file is $HOME/.litmusconfig, and can be overridden by a --config flag `, diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 52544f7..6872c58 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -160,7 +160,6 @@ var probesCmd = &cobra.Command{ } else { //call the probe get endpoint to get the probes details - utils.Red.Println("get probe endpoint") probeGet, err := apis.GetProbeRequest(projectID, ProbeID, credentials) if err != nil { if strings.Contains(err.Error(), "permission_denied") { @@ -172,8 +171,7 @@ var probesCmd = &cobra.Command{ } } probeGetData := probeGet.Data.GetProbe - writer := tabwriter.NewWriter(os.Stdout, 30, 8, 0, '\t', tabwriter.AlignRight) - writer.Flush() + writer := tabwriter.NewWriter(os.Stdout, 30, 8, 2, '\t', tabwriter.AlignRight) intUpdateTime, err := strconv.ParseInt(probeGetData.UpdatedAt, 10, 64) if err != nil { utils.Red.Println("Error converting UpdatedAt to int64:", err) @@ -184,12 +182,149 @@ var probesCmd = &cobra.Command{ utils.Red.Println("Error converting CreatedAt to int64:", err) } createdTime := time.Unix(intCreatedTime, 0).String() - writer.Flush() utils.White_B.Fprintln(writer, "PROBE DETAILS") - utils.White.Fprintln(writer, "PROBE ID\t", probeGetData.Name) - utils.White.Fprintln(writer, "PROBE DESCRIPTION\t", *probeGetData.Description) + utils.White.Fprintln(writer, "PROBE ID \t", probeGetData.Name) + utils.White.Fprintln(writer, "PROBE DESCRIPTION \t", *probeGetData.Description) utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) + if probeGetData.Type == "httpProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesHTTPProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesHTTPProperties.Interval) + if probeGetData.KubernetesHTTPProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesHTTPProperties.Attempt) + } + if probeGetData.KubernetesHTTPProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesHTTPProperties.ProbePollingInterval) + } + if probeGetData.KubernetesHTTPProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesHTTPProperties.InitialDelay) + } + if probeGetData.KubernetesHTTPProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesHTTPProperties.EvaluationTimeout) + } + if probeGetData.KubernetesHTTPProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesHTTPProperties.StopOnFailure) + } + utils.White.Fprintln(writer, "URL \t", probeGetData.KubernetesHTTPProperties.URL) + if probeGetData.KubernetesHTTPProperties.Method.Get != nil { + utils.White.Fprintln(writer, "METHOD \t", "GET") + utils.White.Fprintln(writer, "CRITERIA \t", probeGetData.KubernetesHTTPProperties.Method.Get.Criteria) + utils.White.Fprintln(writer, "RESPONSE \t", probeGetData.KubernetesHTTPProperties.Method.Get.ResponseCode) + } + if probeGetData.KubernetesHTTPProperties.Method.Post != nil { + utils.White.Fprintln(writer, "METHOD \t", "POST") + utils.White.Fprintln(writer, "CONTENT-TYPE \t", probeGetData.KubernetesHTTPProperties.Method.Post.ContentType) + if probeGetData.KubernetesHTTPProperties.Method.Post.Body != nil { + utils.White.Fprintln(writer, "BODY \t", probeGetData.KubernetesHTTPProperties.Method.Post.Body) + } + if probeGetData.KubernetesHTTPProperties.Method.Post.BodyPath != nil { + utils.White.Fprintln(writer, "BODYPATH \t", probeGetData.KubernetesHTTPProperties.Method.Post.BodyPath) + } + utils.White.Fprintln(writer, "CRITERIA \t", probeGetData.KubernetesHTTPProperties.Method.Post.Criteria) + utils.White.Fprintln(writer, "RESPONSE CODE \t", probeGetData.KubernetesHTTPProperties.Method.Post.ResponseCode) + } + if probeGetData.KubernetesHTTPProperties.InsecureSkipVerify != nil { + utils.White.Fprintln(writer, "INSECURE SKIP VERIFY \t", probeGetData.KubernetesHTTPProperties.InsecureSkipVerify) + } + + } + if probeGetData.Type == "cmdProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesCMDProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesCMDProperties.Interval) + if probeGetData.KubernetesCMDProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesCMDProperties.Attempt) + } + if probeGetData.KubernetesCMDProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesCMDProperties.ProbePollingInterval) + } + if probeGetData.KubernetesCMDProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesCMDProperties.InitialDelay) + } + if probeGetData.KubernetesCMDProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesCMDProperties.EvaluationTimeout) + } + if probeGetData.KubernetesCMDProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesCMDProperties.StopOnFailure) + } + utils.White.Fprintln(writer, "Command \t", probeGetData.KubernetesCMDProperties.Command) + if probeGetData.KubernetesCMDProperties.Comparator != nil { + utils.White.Fprintln(writer, "COMPARATOR TYPE \t", probeGetData.KubernetesCMDProperties.Comparator.Type) + utils.White.Fprintln(writer, "COMPARATOR VALUE \t", probeGetData.KubernetesCMDProperties.Comparator.Value) + utils.White.Fprintln(writer, "COMPARATOR CRITERIA \t", probeGetData.KubernetesCMDProperties.Comparator.Criteria) + } + if probeGetData.KubernetesCMDProperties.Source != nil { + + utils.White.Fprintln(writer, "Source \t", *probeGetData.KubernetesCMDProperties.Source) + } + } + if probeGetData.Type == "k8sProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.K8sProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.K8sProperties.Interval) + if probeGetData.K8sProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.K8sProperties.Attempt) + } + if probeGetData.K8sProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.K8sProperties.ProbePollingInterval) + } + if probeGetData.K8sProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.K8sProperties.InitialDelay) + } + if probeGetData.K8sProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.K8sProperties.EvaluationTimeout) + } + if probeGetData.K8sProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.K8sProperties.StopOnFailure) + } + if probeGetData.K8sProperties.Group != nil { + utils.White.Fprintln(writer, "GROUP \t", *probeGetData.K8sProperties.Group) + } + utils.White.Fprintln(writer, "VERSION \t", probeGetData.K8sProperties.Version) + utils.White.Fprintln(writer, "RESOURCE \t", probeGetData.K8sProperties.Resource) + if probeGetData.K8sProperties.Namespace != nil { + utils.White.Fprintln(writer, "NAMESPACE \t", *probeGetData.K8sProperties.Namespace) + } + if probeGetData.K8sProperties.ResourceNames != nil { + utils.White.Fprintln(writer, "RESOURCES NAMES \t", *probeGetData.K8sProperties.ResourceNames) + } + if probeGetData.K8sProperties.FieldSelector != nil { + utils.White.Fprintln(writer, "FIELD SELECTOR \t", *probeGetData.K8sProperties.FieldSelector) + } + if probeGetData.K8sProperties.LabelSelector != nil { + utils.White.Fprintln(writer, "LABEL SELECTOR \t", *probeGetData.K8sProperties.LabelSelector) + } + utils.White.Fprintln(writer, "OPERATION \t", probeGetData.K8sProperties.Operation) + + } + if probeGetData.Type == "promProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.PromProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.PromProperties.Interval) + if probeGetData.PromProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.PromProperties.Attempt) + } + if probeGetData.PromProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.PromProperties.ProbePollingInterval) + } + if probeGetData.PromProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.PromProperties.InitialDelay) + } + if probeGetData.PromProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.PromProperties.EvaluationTimeout) + } + if probeGetData.PromProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.PromProperties.StopOnFailure) + } + utils.White.Fprintln(writer, "Endpoint \t", probeGetData.PromProperties.Endpoint) + utils.White.Fprintln(writer, "Comparator Type \t", probeGetData.PromProperties.Comparator.Type) + utils.White.Fprintln(writer, "Comparator Criteria \t", probeGetData.PromProperties.Comparator.Criteria) + utils.White.Fprintln(writer, "Comparator Value \t", probeGetData.PromProperties.Comparator.Value) + if probeGetData.PromProperties.Query != nil { + utils.White.Fprintln(writer, "Query \t", *probeGetData.PromProperties.Query) + } + if probeGetData.PromProperties.QueryPath != nil { + utils.White.Fprintln(writer, "Querypath \t", *probeGetData.PromProperties.QueryPath) + } + + } utils.White.Fprintln(writer, "CREATED AT\t", createdTime) utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) From 4c5789ff7c753008426f31f4808378629d68d82c Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 21 Mar 2024 18:34:36 +0530 Subject: [PATCH 11/18] refactor get probe command into smaller funcs Signed-off-by: Shivam Purohit --- pkg/apis/probe/probe.go | 1 - pkg/cmd/get/probe.go | 296 +++++++++++++++++----------------------- 2 files changed, 127 insertions(+), 170 deletions(-) diff --git a/pkg/apis/probe/probe.go b/pkg/apis/probe/probe.go index 75de8d6..eb9969c 100644 --- a/pkg/apis/probe/probe.go +++ b/pkg/apis/probe/probe.go @@ -104,5 +104,4 @@ func ListProbeRequest(pid string, probetypes []*models.ProbeType, cred types.Cre } else { return ListProbeResponse{}, errors.New("Unmatched status code:" + string(bodyBytes)) } - } diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 6872c58..bfde15a 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -24,6 +24,7 @@ import ( models "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" apis "github.com/litmuschaos/litmusctl/pkg/apis/probe" + "github.com/litmuschaos/litmusctl/pkg/types" "github.com/litmuschaos/litmusctl/pkg/utils" "github.com/manifoldco/promptui" "github.com/spf13/cobra" @@ -53,112 +54,132 @@ var probesCmd = &cobra.Command{ ProbeID, err := cmd.Flags().GetString("probe-id") if ProbeID == "" { - var selectedItems []*models.ProbeType - NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") - utils.PrintError(err) + getProbeList(projectID, cmd, credentials) + } else { + getProbeDetails(projectID, ProbeID, credentials) - if NoninteractiveMode == false { - prompt := promptui.Select{ - Label: "Do you want to enable advance filter probes?", - Items: []string{"Yes", "No"}, - } - _, option, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - return - } - fmt.Printf("You chose %q\n", option) + } - if option == "Yes" { - items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} - for { - prompt := promptui.Select{ - Label: "Select ProbeType", - Items: items, - Templates: &promptui.SelectTemplates{ - Active: `▸ {{ . | cyan }}`, - Inactive: ` {{ . | white }}`, - Selected: `{{ "✔" | green }} {{ . | bold }}`, - }, - } + }, +} - selectedIndex, result, err := prompt.Run() - if err != nil { - fmt.Printf("Prompt failed %v\n", err) - os.Exit(1) - } +func init() { + GetCmd.AddCommand(probesCmd) - if items[selectedIndex] == "done" { - break - } + probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") + probesCmd.Flags().BoolP("non-interactive", "n", false, "Set it to true for non interactive mode | Note: Always set the boolean flag as --non-interactive=Boolean") + probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") + probesCmd.Flags().String("probe-id", "", "Set the probe-details to the ID of probe for getting all the details related to the probe.") +} - final := models.ProbeType(result) - selectedItems = append(selectedItems, &final) - items = append(items[:selectedIndex], items[selectedIndex+1:]...) +func getProbeList(projectID string, cmd *cobra.Command, credentials types.Credentials) { + var selectedItems []*models.ProbeType + NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") + utils.PrintError(err) - } + if NoninteractiveMode == false { + prompt := promptui.Select{ + Label: "Do you want to enable advance filter probes?", + Items: []string{"Yes", "No"}, + } + _, option, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + return + } + fmt.Printf("You chose %q\n", option) - fmt.Printf("Selected Probe Types: %v\n", selectedItems) + if option == "Yes" { + items := []models.ProbeType{"httpProbe", "cmdProbe", "promProbe", "k8sProbe", "done"} + for { + prompt := promptui.Select{ + Label: "Select ProbeType", + Items: items, + Templates: &promptui.SelectTemplates{ + Active: `▸ {{ . | cyan }}`, + Inactive: ` {{ . | white }}`, + Selected: `{{ "✔" | green }} {{ . | bold }}`, + }, } - } else { - var probeTypes string - probeTypes, err = cmd.Flags().GetString("probe-types") - values := strings.Split(probeTypes, ",") - for _, value := range values { - probeType := models.ProbeType(value) - selectedItems = append(selectedItems, &probeType) + + selectedIndex, result, err := prompt.Run() + if err != nil { + fmt.Printf("Prompt failed %v\n", err) + os.Exit(1) } - } - probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) - probes_data := probes_get.Data.Probes + if items[selectedIndex] == "done" { + break + } - itemsPerPage := 5 - page := 1 - totalProbes := len(probes_data) + final := models.ProbeType(result) + selectedItems = append(selectedItems, &final) + items = append(items[:selectedIndex], items[selectedIndex+1:]...) - writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) - utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") + } - for { - writer.Flush() - start := (page - 1) * itemsPerPage - if start >= totalProbes { - utils.Red.Println("No more probes to display") - writer.Flush() - break - } - end := start + itemsPerPage - if end > totalProbes { - end = totalProbes - } - for _, probe := range probes_data[start:end] { - intTime, err := strconv.ParseInt(probe.CreatedAt, 10, 64) - if err != nil { - fmt.Println("Error converting CreatedAt to int64:", err) - continue - } - humanTime := time.Unix(intTime, 0) - utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) - } - writer.Flush() + fmt.Printf("Selected Probe Types: %v\n", selectedItems) + } + } else { + var probeTypes string + probeTypes, err = cmd.Flags().GetString("probe-types") + values := strings.Split(probeTypes, ",") + for _, value := range values { + probeType := models.ProbeType(value) + selectedItems = append(selectedItems, &probeType) + } + } - paginationPrompt := promptui.Prompt{ - Label: "Press Enter to show more probes (or type 'q' to quit)", - AllowEdit: true, - Default: "", - } + probes_get, _ := apis.ListProbeRequest(projectID, selectedItems, credentials) + probes_data := probes_get.Data.Probes - userInput, err := paginationPrompt.Run() - utils.PrintError(err) + itemsPerPage := 5 + page := 1 + totalProbes := len(probes_data) - if userInput == "q" { - break - } - page++ + writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) + utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") + + for { + writer.Flush() + start := (page - 1) * itemsPerPage + if start >= totalProbes { + utils.Red.Println("No more probes to display") + writer.Flush() + break + } + end := start + itemsPerPage + if end > totalProbes { + end = totalProbes + } + for _, probe := range probes_data[start:end] { + intTime, err := strconv.ParseInt(probe.CreatedAt, 10, 64) + if err != nil { + fmt.Println("Error converting CreatedAt to int64:", err) + continue } + humanTime := time.Unix(intTime, 0) + utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) + } + writer.Flush() - } else { + paginationPrompt := promptui.Prompt{ + Label: "Press Enter to show more probes (or type 'q' to quit)", + AllowEdit: true, + Default: "", + } + + userInput, err := paginationPrompt.Run() + utils.PrintError(err) + + if userInput == "q" { + break + } + page++ + } + +} +func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) { //call the probe get endpoint to get the probes details probeGet, err := apis.GetProbeRequest(projectID, ProbeID, credentials) if err != nil { @@ -187,12 +208,16 @@ var probesCmd = &cobra.Command{ utils.White.Fprintln(writer, "PROBE DESCRIPTION \t", *probeGetData.Description) utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) + if probeGetData.Type == "httpProbe" { utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesHTTPProperties.ProbeTimeout) utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesHTTPProperties.Interval) if probeGetData.KubernetesHTTPProperties.Attempt != nil { utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesHTTPProperties.Attempt) } + if probeGetData.KubernetesHTTPProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesHTTPProperties.Retry) + } if probeGetData.KubernetesHTTPProperties.ProbePollingInterval != nil { utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesHTTPProperties.ProbePollingInterval) } @@ -205,35 +230,15 @@ var probesCmd = &cobra.Command{ if probeGetData.KubernetesHTTPProperties.StopOnFailure != nil { utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesHTTPProperties.StopOnFailure) } - utils.White.Fprintln(writer, "URL \t", probeGetData.KubernetesHTTPProperties.URL) - if probeGetData.KubernetesHTTPProperties.Method.Get != nil { - utils.White.Fprintln(writer, "METHOD \t", "GET") - utils.White.Fprintln(writer, "CRITERIA \t", probeGetData.KubernetesHTTPProperties.Method.Get.Criteria) - utils.White.Fprintln(writer, "RESPONSE \t", probeGetData.KubernetesHTTPProperties.Method.Get.ResponseCode) - } - if probeGetData.KubernetesHTTPProperties.Method.Post != nil { - utils.White.Fprintln(writer, "METHOD \t", "POST") - utils.White.Fprintln(writer, "CONTENT-TYPE \t", probeGetData.KubernetesHTTPProperties.Method.Post.ContentType) - if probeGetData.KubernetesHTTPProperties.Method.Post.Body != nil { - utils.White.Fprintln(writer, "BODY \t", probeGetData.KubernetesHTTPProperties.Method.Post.Body) - } - if probeGetData.KubernetesHTTPProperties.Method.Post.BodyPath != nil { - utils.White.Fprintln(writer, "BODYPATH \t", probeGetData.KubernetesHTTPProperties.Method.Post.BodyPath) - } - utils.White.Fprintln(writer, "CRITERIA \t", probeGetData.KubernetesHTTPProperties.Method.Post.Criteria) - utils.White.Fprintln(writer, "RESPONSE CODE \t", probeGetData.KubernetesHTTPProperties.Method.Post.ResponseCode) - } - if probeGetData.KubernetesHTTPProperties.InsecureSkipVerify != nil { - utils.White.Fprintln(writer, "INSECURE SKIP VERIFY \t", probeGetData.KubernetesHTTPProperties.InsecureSkipVerify) - } - - } - if probeGetData.Type == "cmdProbe" { + } else if probeGetData.Type == "cmdProbe" { utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesCMDProperties.ProbeTimeout) utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesCMDProperties.Interval) if probeGetData.KubernetesCMDProperties.Attempt != nil { utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesCMDProperties.Attempt) } + if probeGetData.KubernetesCMDProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesCMDProperties.Retry) + } if probeGetData.KubernetesCMDProperties.ProbePollingInterval != nil { utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesCMDProperties.ProbePollingInterval) } @@ -246,23 +251,15 @@ var probesCmd = &cobra.Command{ if probeGetData.KubernetesCMDProperties.StopOnFailure != nil { utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesCMDProperties.StopOnFailure) } - utils.White.Fprintln(writer, "Command \t", probeGetData.KubernetesCMDProperties.Command) - if probeGetData.KubernetesCMDProperties.Comparator != nil { - utils.White.Fprintln(writer, "COMPARATOR TYPE \t", probeGetData.KubernetesCMDProperties.Comparator.Type) - utils.White.Fprintln(writer, "COMPARATOR VALUE \t", probeGetData.KubernetesCMDProperties.Comparator.Value) - utils.White.Fprintln(writer, "COMPARATOR CRITERIA \t", probeGetData.KubernetesCMDProperties.Comparator.Criteria) - } - if probeGetData.KubernetesCMDProperties.Source != nil { - - utils.White.Fprintln(writer, "Source \t", *probeGetData.KubernetesCMDProperties.Source) - } - } - if probeGetData.Type == "k8sProbe" { + } else if probeGetData.Type == "k8sProbe" { utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.K8sProperties.ProbeTimeout) utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.K8sProperties.Interval) if probeGetData.K8sProperties.Attempt != nil { utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.K8sProperties.Attempt) } + if probeGetData.K8sProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.K8sProperties.Retry) + } if probeGetData.K8sProperties.ProbePollingInterval != nil { utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.K8sProperties.ProbePollingInterval) } @@ -275,32 +272,15 @@ var probesCmd = &cobra.Command{ if probeGetData.K8sProperties.StopOnFailure != nil { utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.K8sProperties.StopOnFailure) } - if probeGetData.K8sProperties.Group != nil { - utils.White.Fprintln(writer, "GROUP \t", *probeGetData.K8sProperties.Group) - } - utils.White.Fprintln(writer, "VERSION \t", probeGetData.K8sProperties.Version) - utils.White.Fprintln(writer, "RESOURCE \t", probeGetData.K8sProperties.Resource) - if probeGetData.K8sProperties.Namespace != nil { - utils.White.Fprintln(writer, "NAMESPACE \t", *probeGetData.K8sProperties.Namespace) - } - if probeGetData.K8sProperties.ResourceNames != nil { - utils.White.Fprintln(writer, "RESOURCES NAMES \t", *probeGetData.K8sProperties.ResourceNames) - } - if probeGetData.K8sProperties.FieldSelector != nil { - utils.White.Fprintln(writer, "FIELD SELECTOR \t", *probeGetData.K8sProperties.FieldSelector) - } - if probeGetData.K8sProperties.LabelSelector != nil { - utils.White.Fprintln(writer, "LABEL SELECTOR \t", *probeGetData.K8sProperties.LabelSelector) - } - utils.White.Fprintln(writer, "OPERATION \t", probeGetData.K8sProperties.Operation) - - } - if probeGetData.Type == "promProbe" { + } else if probeGetData.Type == "promProbe" { utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.PromProperties.ProbeTimeout) utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.PromProperties.Interval) if probeGetData.PromProperties.Attempt != nil { utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.PromProperties.Attempt) } + if probeGetData.PromProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.PromProperties.Retry) + } if probeGetData.PromProperties.ProbePollingInterval != nil { utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.PromProperties.ProbePollingInterval) } @@ -313,34 +293,12 @@ var probesCmd = &cobra.Command{ if probeGetData.PromProperties.StopOnFailure != nil { utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.PromProperties.StopOnFailure) } - utils.White.Fprintln(writer, "Endpoint \t", probeGetData.PromProperties.Endpoint) - utils.White.Fprintln(writer, "Comparator Type \t", probeGetData.PromProperties.Comparator.Type) - utils.White.Fprintln(writer, "Comparator Criteria \t", probeGetData.PromProperties.Comparator.Criteria) - utils.White.Fprintln(writer, "Comparator Value \t", probeGetData.PromProperties.Comparator.Value) - if probeGetData.PromProperties.Query != nil { - utils.White.Fprintln(writer, "Query \t", *probeGetData.PromProperties.Query) - } - if probeGetData.PromProperties.QueryPath != nil { - utils.White.Fprintln(writer, "Querypath \t", *probeGetData.PromProperties.QueryPath) - } - } + utils.White.Fprintln(writer, "CREATED AT\t", createdTime) utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) writer.Flush() - } - - }, -} - -func init() { - GetCmd.AddCommand(probesCmd) - - probesCmd.Flags().String("project-id", "", "Set the project-id to get Probe from a particular project.") - probesCmd.Flags().BoolP("non-interactive", "n", false, "Set it to true for non interactive mode | Note: Always set the boolean flag as --non-interactive=Boolean") - probesCmd.Flags().String("probe-types", "", "Set the probe-types as comma separated values to filter the probes") - probesCmd.Flags().String("probe-id", "", "Set the probe-details to the ID of probe for getting all the details related to the probe.") -} +} \ No newline at end of file From 9ad0d285560a501e231ca874fa8d1d4bc2193ff6 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 21 Mar 2024 18:49:31 +0530 Subject: [PATCH 12/18] fix:double printing of break statement get probe Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index bfde15a..6a52a3d 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -145,7 +145,6 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden start := (page - 1) * itemsPerPage if start >= totalProbes { utils.Red.Println("No more probes to display") - writer.Flush() break } end := start + itemsPerPage From e2e6e5bf68cdd54b5a33fb5b3d6cbcf50d63b6d5 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 21 Mar 2024 18:50:03 +0530 Subject: [PATCH 13/18] fix:fmt Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 242 +++++++++++++++++++++---------------------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 6a52a3d..73663a7 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -179,125 +179,125 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden } func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) { - //call the probe get endpoint to get the probes details - probeGet, err := apis.GetProbeRequest(projectID, ProbeID, credentials) - if err != nil { - if strings.Contains(err.Error(), "permission_denied") { - utils.Red.Println("❌ You don't have enough permissions to access this resource.") - os.Exit(1) - } else { - utils.PrintError(err) - os.Exit(1) - } - } - probeGetData := probeGet.Data.GetProbe - writer := tabwriter.NewWriter(os.Stdout, 30, 8, 2, '\t', tabwriter.AlignRight) - intUpdateTime, err := strconv.ParseInt(probeGetData.UpdatedAt, 10, 64) - if err != nil { - utils.Red.Println("Error converting UpdatedAt to int64:", err) - } - updatedTime := time.Unix(intUpdateTime, 0).String() - intCreatedTime, err := strconv.ParseInt(probeGetData.CreatedAt, 10, 64) - if err != nil { - utils.Red.Println("Error converting CreatedAt to int64:", err) - } - createdTime := time.Unix(intCreatedTime, 0).String() - utils.White_B.Fprintln(writer, "PROBE DETAILS") - utils.White.Fprintln(writer, "PROBE ID \t", probeGetData.Name) - utils.White.Fprintln(writer, "PROBE DESCRIPTION \t", *probeGetData.Description) - utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) - utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) - - if probeGetData.Type == "httpProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesHTTPProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesHTTPProperties.Interval) - if probeGetData.KubernetesHTTPProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesHTTPProperties.Attempt) - } - if probeGetData.KubernetesHTTPProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesHTTPProperties.Retry) - } - if probeGetData.KubernetesHTTPProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesHTTPProperties.ProbePollingInterval) - } - if probeGetData.KubernetesHTTPProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesHTTPProperties.InitialDelay) - } - if probeGetData.KubernetesHTTPProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesHTTPProperties.EvaluationTimeout) - } - if probeGetData.KubernetesHTTPProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesHTTPProperties.StopOnFailure) - } - } else if probeGetData.Type == "cmdProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesCMDProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesCMDProperties.Interval) - if probeGetData.KubernetesCMDProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesCMDProperties.Attempt) - } - if probeGetData.KubernetesCMDProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesCMDProperties.Retry) - } - if probeGetData.KubernetesCMDProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesCMDProperties.ProbePollingInterval) - } - if probeGetData.KubernetesCMDProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesCMDProperties.InitialDelay) - } - if probeGetData.KubernetesCMDProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesCMDProperties.EvaluationTimeout) - } - if probeGetData.KubernetesCMDProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesCMDProperties.StopOnFailure) - } - } else if probeGetData.Type == "k8sProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.K8sProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.K8sProperties.Interval) - if probeGetData.K8sProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.K8sProperties.Attempt) - } - if probeGetData.K8sProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.K8sProperties.Retry) - } - if probeGetData.K8sProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.K8sProperties.ProbePollingInterval) - } - if probeGetData.K8sProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.K8sProperties.InitialDelay) - } - if probeGetData.K8sProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.K8sProperties.EvaluationTimeout) - } - if probeGetData.K8sProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.K8sProperties.StopOnFailure) - } - } else if probeGetData.Type == "promProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.PromProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.PromProperties.Interval) - if probeGetData.PromProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.PromProperties.Attempt) - } - if probeGetData.PromProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.PromProperties.Retry) - } - if probeGetData.PromProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.PromProperties.ProbePollingInterval) - } - if probeGetData.PromProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.PromProperties.InitialDelay) - } - if probeGetData.PromProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.PromProperties.EvaluationTimeout) - } - if probeGetData.PromProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.PromProperties.StopOnFailure) - } - } + //call the probe get endpoint to get the probes details + probeGet, err := apis.GetProbeRequest(projectID, ProbeID, credentials) + if err != nil { + if strings.Contains(err.Error(), "permission_denied") { + utils.Red.Println("❌ You don't have enough permissions to access this resource.") + os.Exit(1) + } else { + utils.PrintError(err) + os.Exit(1) + } + } + probeGetData := probeGet.Data.GetProbe + writer := tabwriter.NewWriter(os.Stdout, 30, 8, 2, '\t', tabwriter.AlignRight) + intUpdateTime, err := strconv.ParseInt(probeGetData.UpdatedAt, 10, 64) + if err != nil { + utils.Red.Println("Error converting UpdatedAt to int64:", err) + } + updatedTime := time.Unix(intUpdateTime, 0).String() + intCreatedTime, err := strconv.ParseInt(probeGetData.CreatedAt, 10, 64) + if err != nil { + utils.Red.Println("Error converting CreatedAt to int64:", err) + } + createdTime := time.Unix(intCreatedTime, 0).String() + utils.White_B.Fprintln(writer, "PROBE DETAILS") + utils.White.Fprintln(writer, "PROBE ID \t", probeGetData.Name) + utils.White.Fprintln(writer, "PROBE DESCRIPTION \t", *probeGetData.Description) + utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) + utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) - utils.White.Fprintln(writer, "CREATED AT\t", createdTime) - utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) - utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) - utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) - utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) - writer.Flush() -} \ No newline at end of file + if probeGetData.Type == "httpProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesHTTPProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesHTTPProperties.Interval) + if probeGetData.KubernetesHTTPProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesHTTPProperties.Attempt) + } + if probeGetData.KubernetesHTTPProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesHTTPProperties.Retry) + } + if probeGetData.KubernetesHTTPProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesHTTPProperties.ProbePollingInterval) + } + if probeGetData.KubernetesHTTPProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesHTTPProperties.InitialDelay) + } + if probeGetData.KubernetesHTTPProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesHTTPProperties.EvaluationTimeout) + } + if probeGetData.KubernetesHTTPProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesHTTPProperties.StopOnFailure) + } + } else if probeGetData.Type == "cmdProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesCMDProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesCMDProperties.Interval) + if probeGetData.KubernetesCMDProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesCMDProperties.Attempt) + } + if probeGetData.KubernetesCMDProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesCMDProperties.Retry) + } + if probeGetData.KubernetesCMDProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesCMDProperties.ProbePollingInterval) + } + if probeGetData.KubernetesCMDProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesCMDProperties.InitialDelay) + } + if probeGetData.KubernetesCMDProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesCMDProperties.EvaluationTimeout) + } + if probeGetData.KubernetesCMDProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesCMDProperties.StopOnFailure) + } + } else if probeGetData.Type == "k8sProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.K8sProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.K8sProperties.Interval) + if probeGetData.K8sProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.K8sProperties.Attempt) + } + if probeGetData.K8sProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.K8sProperties.Retry) + } + if probeGetData.K8sProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.K8sProperties.ProbePollingInterval) + } + if probeGetData.K8sProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.K8sProperties.InitialDelay) + } + if probeGetData.K8sProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.K8sProperties.EvaluationTimeout) + } + if probeGetData.K8sProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.K8sProperties.StopOnFailure) + } + } else if probeGetData.Type == "promProbe" { + utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.PromProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.PromProperties.Interval) + if probeGetData.PromProperties.Attempt != nil { + utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.PromProperties.Attempt) + } + if probeGetData.PromProperties.Retry != nil { + utils.White.Fprintln(writer, "RETRY \t", *probeGetData.PromProperties.Retry) + } + if probeGetData.PromProperties.ProbePollingInterval != nil { + utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.PromProperties.ProbePollingInterval) + } + if probeGetData.PromProperties.InitialDelay != nil { + utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.PromProperties.InitialDelay) + } + if probeGetData.PromProperties.EvaluationTimeout != nil { + utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.PromProperties.EvaluationTimeout) + } + if probeGetData.PromProperties.StopOnFailure != nil { + utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.PromProperties.StopOnFailure) + } + } + + utils.White.Fprintln(writer, "CREATED AT\t", createdTime) + utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) + utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) + utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) + utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) + writer.Flush() +} From 63818c89175b9c70c1be17ed67a0e0185756d199 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Thu, 21 Mar 2024 19:30:03 +0530 Subject: [PATCH 14/18] remove toolchain Signed-off-by: Shivam Purohit --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index c06071e..aaa6701 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module github.com/litmuschaos/litmusctl go 1.21 -toolchain go1.22.1 require ( github.com/argoproj/argo-workflows/v3 v3.5.5 From 263a556accb9f18e5055b4837d190858e6837f56 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 22 Mar 2024 01:10:29 +0530 Subject: [PATCH 15/18] fix swap created by/at Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 73663a7..62282d6 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -138,7 +138,7 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden totalProbes := len(probes_data) writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) - utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED AT\t CREATED BY") + utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED BY\t CREATED AT") for { writer.Flush() From c3c3cbf56f6431c597a54961e1aa8883337fe2e5 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 22 Mar 2024 18:48:21 +0530 Subject: [PATCH 16/18] refactor the get probe cmd Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 151 +++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 84 deletions(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 62282d6..9b89033 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -73,6 +73,8 @@ func init() { } func getProbeList(projectID string, cmd *cobra.Command, credentials types.Credentials) { + + // calls the probeList endpoint for the list of probes var selectedItems []*models.ProbeType NoninteractiveMode, err := cmd.Flags().GetBool("non-interactive") utils.PrintError(err) @@ -208,90 +210,15 @@ func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) { utils.White.Fprintln(writer, "PROBE TYPE \t", probeGetData.Type) utils.White.Fprintln(writer, "PROBE INFRASTRUCTURE TYPE \t", probeGetData.InfrastructureType) - if probeGetData.Type == "httpProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesHTTPProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesHTTPProperties.Interval) - if probeGetData.KubernetesHTTPProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesHTTPProperties.Attempt) - } - if probeGetData.KubernetesHTTPProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesHTTPProperties.Retry) - } - if probeGetData.KubernetesHTTPProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesHTTPProperties.ProbePollingInterval) - } - if probeGetData.KubernetesHTTPProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesHTTPProperties.InitialDelay) - } - if probeGetData.KubernetesHTTPProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesHTTPProperties.EvaluationTimeout) - } - if probeGetData.KubernetesHTTPProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesHTTPProperties.StopOnFailure) - } - } else if probeGetData.Type == "cmdProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.KubernetesCMDProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.KubernetesCMDProperties.Interval) - if probeGetData.KubernetesCMDProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.KubernetesCMDProperties.Attempt) - } - if probeGetData.KubernetesCMDProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.KubernetesCMDProperties.Retry) - } - if probeGetData.KubernetesCMDProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.KubernetesCMDProperties.ProbePollingInterval) - } - if probeGetData.KubernetesCMDProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.KubernetesCMDProperties.InitialDelay) - } - if probeGetData.KubernetesCMDProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.KubernetesCMDProperties.EvaluationTimeout) - } - if probeGetData.KubernetesCMDProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.KubernetesCMDProperties.StopOnFailure) - } - } else if probeGetData.Type == "k8sProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.K8sProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.K8sProperties.Interval) - if probeGetData.K8sProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.K8sProperties.Attempt) - } - if probeGetData.K8sProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.K8sProperties.Retry) - } - if probeGetData.K8sProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.K8sProperties.ProbePollingInterval) - } - if probeGetData.K8sProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.K8sProperties.InitialDelay) - } - if probeGetData.K8sProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.K8sProperties.EvaluationTimeout) - } - if probeGetData.K8sProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.K8sProperties.StopOnFailure) - } - } else if probeGetData.Type == "promProbe" { - utils.White.Fprintln(writer, "TIMEOUT \t", probeGetData.PromProperties.ProbeTimeout) - utils.White.Fprintln(writer, "INTERVAL \t", probeGetData.PromProperties.Interval) - if probeGetData.PromProperties.Attempt != nil { - utils.White.Fprintln(writer, "ATTEMPT \t", *probeGetData.PromProperties.Attempt) - } - if probeGetData.PromProperties.Retry != nil { - utils.White.Fprintln(writer, "RETRY \t", *probeGetData.PromProperties.Retry) - } - if probeGetData.PromProperties.ProbePollingInterval != nil { - utils.White.Fprintln(writer, "POLLING INTERVAL \t", *probeGetData.PromProperties.ProbePollingInterval) - } - if probeGetData.PromProperties.InitialDelay != nil { - utils.White.Fprintln(writer, "INITIAL DELAY \t", *probeGetData.PromProperties.InitialDelay) - } - if probeGetData.PromProperties.EvaluationTimeout != nil { - utils.White.Fprintln(writer, "EVALUATION TIMEOUT \t", *probeGetData.PromProperties.EvaluationTimeout) - } - if probeGetData.PromProperties.StopOnFailure != nil { - utils.White.Fprintln(writer, "STOP ON FAILURE \t", *probeGetData.PromProperties.StopOnFailure) - } + switch probeGetData.Type { + case "httpProbe": + printHTTPProbeDetails(writer, probeGetData) + case "cmdProbe": + printCmdProbeDetails(writer, probeGetData) + case "k8sProbe": + printK8sProbeDetails(writer, probeGetData) + case "promProbe": + printPromProbeDetails(writer, probeGetData) } utils.White.Fprintln(writer, "CREATED AT\t", createdTime) @@ -301,3 +228,59 @@ func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) { utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) writer.Flush() } + +func printHTTPProbeDetails(writer *tabwriter.Writer, probeData models.Probe) { + utils.White.Fprintln(writer, "TIMEOUT \t", probeData.KubernetesHTTPProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeData.KubernetesHTTPProperties.Interval) + printOptionalIntProperty(writer, "ATTEMPT", probeData.KubernetesHTTPProperties.Attempt) + printOptionalIntProperty(writer, "RETRY", probeData.KubernetesHTTPProperties.Retry) + printOptionalProperty(writer, "POLLING INTERVAL", probeData.KubernetesHTTPProperties.ProbePollingInterval) + printOptionalProperty(writer, "INITIAL DELAY", probeData.KubernetesHTTPProperties.InitialDelay) + printOptionalProperty(writer, "EVALUATION TIMEOUT", probeData.KubernetesHTTPProperties.EvaluationTimeout) + printOptionalBoolProperty(writer, "STOP ON FAILURE", probeData.KubernetesHTTPProperties.StopOnFailure) +} +func printCmdProbeDetails(writer *tabwriter.Writer, probeData models.Probe) { + utils.White.Fprintln(writer, "TIMEOUT \t", probeData.KubernetesCMDProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeData.KubernetesCMDProperties.Interval) + printOptionalIntProperty(writer, "ATTEMPT", probeData.KubernetesCMDProperties.Attempt) + printOptionalIntProperty(writer, "RETRY", probeData.KubernetesCMDProperties.Retry) + printOptionalProperty(writer, "POLLING INTERVAL", probeData.KubernetesCMDProperties.ProbePollingInterval) + printOptionalProperty(writer, "INITIAL DELAY", probeData.KubernetesCMDProperties.InitialDelay) + printOptionalProperty(writer, "EVALUATION TIMEOUT", probeData.KubernetesCMDProperties.EvaluationTimeout) + printOptionalBoolProperty(writer, "STOP ON FAILURE", probeData.KubernetesCMDProperties.StopOnFailure) +} +func printK8sProbeDetails(writer *tabwriter.Writer, probeData models.Probe) { + utils.White.Fprintln(writer, "TIMEOUT \t", probeData.K8sProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeData.K8sProperties.Interval) + printOptionalIntProperty(writer, "ATTEMPT", probeData.K8sProperties.Attempt) + printOptionalIntProperty(writer, "RETRY", probeData.K8sProperties.Retry) + printOptionalProperty(writer, "POLLING INTERVAL", probeData.K8sProperties.ProbePollingInterval) + printOptionalProperty(writer, "INITIAL DELAY", probeData.K8sProperties.InitialDelay) + printOptionalProperty(writer, "EVALUATION TIMEOUT", probeData.K8sProperties.EvaluationTimeout) + printOptionalBoolProperty(writer, "STOP ON FAILURE", probeData.K8sProperties.StopOnFailure) +} +func printPromProbeDetails(writer *tabwriter.Writer, probeData models.Probe) { + utils.White.Fprintln(writer, "TIMEOUT \t", probeData.PromProperties.ProbeTimeout) + utils.White.Fprintln(writer, "INTERVAL \t", probeData.PromProperties.Interval) + printOptionalIntProperty(writer, "ATTEMPT", probeData.PromProperties.Attempt) + printOptionalIntProperty(writer, "RETRY", probeData.PromProperties.Retry) + printOptionalProperty(writer, "POLLING INTERVAL", probeData.PromProperties.ProbePollingInterval) + printOptionalProperty(writer, "INITIAL DELAY", probeData.PromProperties.InitialDelay) + printOptionalProperty(writer, "EVALUATION TIMEOUT", probeData.PromProperties.EvaluationTimeout) + printOptionalBoolProperty(writer, "STOP ON FAILURE", probeData.PromProperties.StopOnFailure) +} +func printOptionalProperty(writer *tabwriter.Writer, name string, value *string) { + if value != nil { + utils.White.Fprintln(writer, name+"\t", *value) + } +} +func printOptionalIntProperty(writer *tabwriter.Writer, name string, value *int) { + if value != nil { + utils.White.Fprintln(writer, name+"\t", *value) + } +} +func printOptionalBoolProperty(writer *tabwriter.Writer, name string, value *bool) { + if value != nil { + utils.White.Fprintln(writer, name+"\t", *value) + } +} From b20fd7a95a182a359aea8bb1cdd1475bebc88614 Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 22 Mar 2024 18:52:26 +0530 Subject: [PATCH 17/18] remove unnecessary fields from get probe query Signed-off-by: Shivam Purohit --- pkg/apis/probe/query.go | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/pkg/apis/probe/query.go b/pkg/apis/probe/query.go index 86a771e..b7e5cce 100644 --- a/pkg/apis/probe/query.go +++ b/pkg/apis/probe/query.go @@ -27,21 +27,6 @@ const ( initialDelay evaluationTimeout stopOnFailure - url - method{ - get{ - criteria - responseCode - } - post{ - contentType - body - bodyPath - criteria - responseCode - } - } - insecureSkipVerify } kubernetesCMDProperties{ probeTimeout @@ -52,13 +37,6 @@ const ( initialDelay evaluationTimeout stopOnFailure - command - comparator { - type - value - criteria - } - source } k8sProperties { probeTimeout @@ -69,14 +47,6 @@ const ( initialDelay evaluationTimeout stopOnFailure - group - version - resource - namespace - resourceNames - fieldSelector - labelSelector - operation } promProperties { probeTimeout @@ -87,14 +57,6 @@ const ( initialDelay evaluationTimeout stopOnFailure - endpoint - query - queryPath - comparator{ - type - value - criteria - } } createdAt createdBy{ From 8546861ccc6e3bf8225c98383288cf06a7f88bfd Mon Sep 17 00:00:00 2001 From: Shivam Purohit Date: Fri, 22 Mar 2024 19:07:44 +0530 Subject: [PATCH 18/18] add referencedBy in output get probe Signed-off-by: Shivam Purohit --- pkg/cmd/get/probe.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/get/probe.go b/pkg/cmd/get/probe.go index 9b89033..cc4e129 100644 --- a/pkg/cmd/get/probe.go +++ b/pkg/cmd/get/probe.go @@ -140,7 +140,7 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden totalProbes := len(probes_data) writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) - utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED BY\t CREATED AT") + utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t REFERENCED BY\t CREATED BY\t CREATED AT") for { writer.Flush() @@ -160,7 +160,12 @@ func getProbeList(projectID string, cmd *cobra.Command, credentials types.Creden continue } humanTime := time.Unix(intTime, 0) - utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) + var probeReferencedBy int + if probe.ReferencedBy != nil { + probeReferencedBy = *probe.ReferencedBy + } + + utils.White.Fprintln(writer, probe.Name+"\t"+fmt.Sprintf("%v", probe.Type)+"\t"+fmt.Sprintf("%d", probeReferencedBy)+"\t"+probe.CreatedBy.Username+"\t"+humanTime.String()) } writer.Flush() @@ -226,6 +231,9 @@ func getProbeDetails(projectID, ProbeID string, credentials types.Credentials) { utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) + if probeGetData.ReferencedBy != nil { + utils.White.Fprintln(writer, "REFERENCED BY\t", *probeGetData.ReferencedBy) + } writer.Flush() }