diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f43195373d1..8fe96a5cce5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -63,7 +63,7 @@ jobs: # echo export DEX_SERVER="litmusportal-dex-server" >> env-vars - name: Uploading envs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: env_artifact path: chaoscenter/env-vars @@ -78,7 +78,7 @@ jobs: uses: actions/checkout@v4 - name: Downloading image artficate - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: env_artifact path: chaoscenter @@ -116,7 +116,7 @@ jobs: uses: actions/checkout@v4 - name: Downloading image artficate - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: env_artifact path: chaoscenter @@ -154,7 +154,7 @@ jobs: uses: actions/checkout@v4 - name: Downloading image artficate - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: env_artifact path: chaoscenter @@ -192,7 +192,7 @@ jobs: uses: actions/checkout@v4 - name: Downloading image artficate - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: env_artifact path: chaoscenter @@ -243,7 +243,7 @@ jobs: uses: actions/checkout@v4 - name: Downloading image artficate - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: env_artifact path: chaoscenter @@ -279,4 +279,4 @@ jobs: source env-vars FRONTEND_IMAGE=${{ matrix.frontend.image_name }} timestamp=`date "+%s"` - make push-frontend \ No newline at end of file + make push-frontend diff --git a/ADOPTERS.md b/ADOPTERS.md index 61ca4083ee0..941e4f46f63 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -29,7 +29,7 @@ The companies listed here conform to [CNCF's definition of end-users](https://gi |[Flipkart](https://www.flipkart.com/)|Chaos Engineering at Flipkart|[Our Story](https://github.com/litmuschaos/litmus/issues/2191#issuecomment-1966904935)| |[Talend](https://www.talend.com/)|Chaos Engineering for our pipelines and weekly checks|[Our Story](https://github.com/litmuschaos/litmus/issues/2191#issuecomment-2005254600)| |[Delivery Hero](https://www.deliveryhero.com/)|Enhancing Resiliency of Our Services|[Our Story](https://github.com/litmuschaos/litmus/issues/2191#issuecomment-1997465958)| - +|[Wingie Enuygun Company](https://www.wingie.com/)|Chaos Engineering for an Online Travel and Finance Platform|[Our Story](https://github.com/litmuschaos/litmus/issues/2191#issuecomment-2331265698)| ### Cloud-Native Vendors diff --git a/README.md b/README.md index 02b16845624..cb7c8d80f59 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,6 @@ Fill out the [LitmusChaos Meetings invite form](https://forms.gle/xYZyZ2gTWMqz7x Community Blogs: -- Daniyal Rayn: [Do I need Chaos Engineering on my environment? Trust me you need it!](https://maveric-systems.com/blog/do-i-need-chaos-engineering-on-my-environment-trust-me-you-need-it/) - LiveWyer: [LitmusChaos Showcase: Chaos Experiments in a Helm Chart Test Suite](https://livewyer.io/blog/2021/03/22/litmuschaos-showcase-chaos-experiments-in-a-helm-chart-test-suite/) - Jessica Cherry: [Test Kubernetes cluster failures and experiments in your terminal](https://opensource.com/article/21/6/kubernetes-litmus-chaos) - Yang Chuansheng(KubeSphere): [KubeSphere 部署 Litmus 至 Kubernetes 开启混沌实验](https://kubesphere.io/zh/blogs/litmus-kubesphere/) @@ -138,8 +137,6 @@ Community Blogs: - Akram Riahi(WeScale):[Chaos Engineering : Litmus sous tous les angles](https://blog.wescale.fr/2021/03/11/chaos-engineering-litmus-sous-tous-les-angles/) - Prashanto Priyanshu(LensKart):[Lenskart’s approach to Chaos Engineering-Part 2](https://blog.lenskart.com/lenskarts-approach-to-chaos-engineering-part-2-6290e4f3a74e) - DevsDay.ru(Russian):[LitmusChaos at Kubecon EU '21](https://devsday.ru/blog/details/40746) -- Ryan Pei(Armory): [LitmusChaos in your Spinnaker Pipeline](https://www.armory.io/blog/litmuschaos-in-your-spinnaker-pipeline/) -- David Gildeh(Zebrium): [Using Autonomous Monitoring with Litmus Chaos Engine on Kubernetes](https://www.zebrium.com/blog/using-autonomous-monitoring-with-litmus-chaos-engine-on-kubernetes) ## Adopters diff --git a/adopters/organizations/wingie-enuygun.md b/adopters/organizations/wingie-enuygun.md new file mode 100644 index 00000000000..7a6c1ed2f1c --- /dev/null +++ b/adopters/organizations/wingie-enuygun.md @@ -0,0 +1,11 @@ +# Wingie Enuygun Company +[Wingie Enuygun Company](https://www.wingie.com/) is a leading travel and technology company providing seamless travel solutions across various platforms. + +## Why do we use Litmus +We use Litmus to identify bottlenecks in our systems, detect issues early, and foresee potential errors. This allows us to take proactive measures and maintain the resilience and performance of our infrastructure. + +## How do we use Litmus +Litmus is integrated into our QA cycles, where it plays a crucial role in catching bugs and verifying the overall resilience of our systems. + +## Benefits in using Litmus +Litmus chaos experiments are straightforward to implement and can be easily customized or extended to meet our specific requirements, enabling us to effectively manage and optimize our systems at Wingie Enuygun. diff --git a/chaoscenter/authentication/api/handlers/rest/project_handler.go b/chaoscenter/authentication/api/handlers/rest/project_handler.go index 8ebe227df8b..52e95a2932b 100644 --- a/chaoscenter/authentication/api/handlers/rest/project_handler.go +++ b/chaoscenter/authentication/api/handlers/rest/project_handler.go @@ -325,8 +325,12 @@ func CreateProject(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, userRequest.UserID) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } // checking if project name is empty @@ -456,8 +460,12 @@ func SendInvitation(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } // Validating member role @@ -558,8 +566,12 @@ func AcceptInvitation(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = validations.RbacValidator(c.MustGet("uid").(string), member.ProjectID, @@ -614,8 +626,12 @@ func DeclineInvitation(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = validations.RbacValidator(c.MustGet("uid").(string), member.ProjectID, @@ -684,8 +700,12 @@ func LeaveProject(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = validations.RbacValidator(c.MustGet("uid").(string), member.ProjectID, @@ -744,8 +764,12 @@ func RemoveInvitation(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = validations.RbacValidator(c.MustGet("uid").(string), member.ProjectID, @@ -824,8 +848,12 @@ func UpdateProjectName(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, c.MustGet("uid").(string)) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = validations.RbacValidator(c.MustGet("uid").(string), diff --git a/chaoscenter/authentication/api/handlers/rest/user_handlers.go b/chaoscenter/authentication/api/handlers/rest/user_handlers.go index 3d81dc22d54..d8bcf5d9afa 100644 --- a/chaoscenter/authentication/api/handlers/rest/user_handlers.go +++ b/chaoscenter/authentication/api/handlers/rest/user_handlers.go @@ -136,13 +136,18 @@ func UpdateUser(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, uid) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } err = service.UpdateUser(&userRequest) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) + return } c.JSON(http.StatusOK, gin.H{"message": "User details updated successfully"}) } @@ -263,7 +268,7 @@ func InviteUsers(service services.ApplicationService) gin.HandlerFunc { // @Failure 400 {object} response.ErrInvalidRequest // @Failure 400 {object} response.ErrUserNotFound // @Failure 400 {object} response.ErrUserDeactivated -// @Failure 400 {object} response.ErrInvalidCredentials +// @Failure 401 {object} response.ErrInvalidCredentials // @Failure 500 {object} response.ErrServerError // @Success 200 {object} response.LoginResponse{} // @Router /login [post] @@ -554,8 +559,12 @@ func ResetPassword(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, uid) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } if userPasswordRequest.NewPassword != "" { @@ -610,8 +619,12 @@ func UpdateUserState(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, adminUser.ID) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } if entities.Role(userRole) != entities.RoleAdmin { @@ -689,8 +702,12 @@ func CreateApiToken(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, apiTokenRequest.UserID) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } // Checking if user exists @@ -785,8 +802,12 @@ func DeleteApiToken(service services.ApplicationService) gin.HandlerFunc { initialLogin, err := CheckInitialLogin(service, deleteApiTokenRequest.UserID) if err != nil { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrServerError)) - } else if initialLogin { + return + } + + if initialLogin { c.JSON(utils.ErrorStatusCodes[utils.ErrServerError], presenter.CreateErrorResponse(utils.ErrPasswordNotUpdated)) + return } token := deleteApiTokenRequest.Token diff --git a/chaoscenter/authentication/go.mod b/chaoscenter/authentication/go.mod index d7cbc1c578a..6f60d17a941 100644 --- a/chaoscenter/authentication/go.mod +++ b/chaoscenter/authentication/go.mod @@ -12,10 +12,10 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 github.com/swaggo/swag v1.16.3 - go.mongodb.org/mongo-driver v1.16.1 + go.mongodb.org/mongo-driver v1.17.0 golang.org/x/crypto v0.26.0 - golang.org/x/oauth2 v0.20.0 - google.golang.org/grpc v1.65.0 + golang.org/x/oauth2 v0.21.0 + google.golang.org/grpc v1.66.2 google.golang.org/protobuf v1.34.2 ) @@ -56,14 +56,14 @@ require ( github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/chaoscenter/authentication/go.sum b/chaoscenter/authentication/go.sum index 57b860264b0..7754fa61a8e 100644 --- a/chaoscenter/authentication/go.sum +++ b/chaoscenter/authentication/go.sum @@ -116,11 +116,11 @@ github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= +github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8= -go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw= +go.mongodb.org/mongo-driver v1.17.0 h1:Hp4q2MCjvY19ViwimTs00wHi7G4yzxh4/2+nTx8r40k= +go.mongodb.org/mongo-driver v1.17.0/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= @@ -137,11 +137,11 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -174,10 +174,10 @@ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxb golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/chaoscenter/authentication/pkg/utils/configs.go b/chaoscenter/authentication/pkg/utils/configs.go index 16aa0356aa7..49aad2b2f19 100644 --- a/chaoscenter/authentication/pkg/utils/configs.go +++ b/chaoscenter/authentication/pkg/utils/configs.go @@ -37,7 +37,7 @@ var ( ApiTokenCollection = "api-token" UsernameField = "username" ExpiresAtField = "expires_at" - PasswordEncryptionCost = 15 + PasswordEncryptionCost = 8 DefaultLitmusGqlGrpcEndpoint = "localhost" DefaultLitmusGqlGrpcPort = ":8000" //DefaultLitmusGqlGrpcPortHttps = ":8001" // enable when in use diff --git a/chaoscenter/authentication/pkg/utils/sanitizers.go b/chaoscenter/authentication/pkg/utils/sanitizers.go index df9c4d936a0..817ec4684a9 100644 --- a/chaoscenter/authentication/pkg/utils/sanitizers.go +++ b/chaoscenter/authentication/pkg/utils/sanitizers.go @@ -16,7 +16,7 @@ func SanitizeString(input string) string { /* ValidateStrictPassword represents and checks for the following patterns: - Input is at least 8 characters long and at most 16 characters long -- Input contains at least one special character of these @$!%*?_& +- Input contains at least one special character of these @$!%*?_&# - Input contains at least one digit - Input contains at least one uppercase alphabet - Input contains at least one lowercase alphabet @@ -33,7 +33,7 @@ func ValidateStrictPassword(input string) error { digits := `[0-9]{1}` lowerAlphabets := `[a-z]{1}` capitalAlphabets := `[A-Z]{1}` - specialCharacters := `[@$!%*?_&]{1}` + specialCharacters := `[@$!%*?_&#]{1}` if b, err := regexp.MatchString(digits, input); !b || err != nil { return fmt.Errorf("password does not contain digits") } diff --git a/chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls b/chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls index 0323301850a..b6003ab121b 100644 --- a/chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls +++ b/chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls @@ -715,7 +715,7 @@ type GetExperimentStatsResponse { totalExpCategorizedByResiliencyScore: [ResilienceScoreCategory]! } -extend type Query { +type Query { """ @@ -737,7 +737,7 @@ extend type Query { getExperimentStats(projectID: ID!): GetExperimentStatsResponse! } -extend type Mutation { +type Mutation { """ Creates a new experiment and applies its manifest """ diff --git a/chaoscenter/graphql/definitions/shared/chaos_infrastructure.graphqls b/chaoscenter/graphql/definitions/shared/chaos_infrastructure.graphqls index d0c2b4b5a5c..467a6a2da76 100644 --- a/chaoscenter/graphql/definitions/shared/chaos_infrastructure.graphqls +++ b/chaoscenter/graphql/definitions/shared/chaos_infrastructure.graphqls @@ -358,11 +358,11 @@ type KubeObjectResponse { """ Type of the Kubernetes object """ - kubeObj: [KubeObject]! + kubeObj: KubeObject! } """ -KubeObject consists of the namespace and the available resources in the same +KubeObject consists of the available resources in a namespace """ type KubeObject { """ @@ -404,16 +404,75 @@ input KubeObjectRequest { GVR Request """ kubeObjRequest: KubeGVRRequest + """ + Namespace in which the Kubernetes object is present + """ + namespace: String! objectType: String! workloads: [Workload] } +""" +Defines details for fetching Kubernetes namespace data +""" +input KubeNamespaceRequest { + """ + ID of the infra + """ + infraID: ID! +} + +""" +Define name in the infra (not really useful at the moment but maybe we will need other field later) +""" +type KubeNamespace{ + """ + Name of the namespace + """ + name: String! +} + + + input KubeGVRRequest { group: String! version: String! resource: String! } +""" +Response received for querying Kubernetes Namespaces +""" +type KubeNamespaceResponse { + """ + ID of the infra in which the Kubernetes namespace is present + """ + infraID: ID! + """ + List of the Kubernetes namespace + """ + kubeNamespace: [KubeNamespace]! +} + +""" +Defines the details of Kubernetes namespace +""" +input KubeNamespaceData { + """ + Unique request ID for fetching Kubernetes namespace details + """ + requestID: ID! + """ + ID of the infra in which the Kubernetes namespace is present + """ + infraID: InfraIdentity! + """ + List of KubeNamespace return by subscriber + """ + kubeNamespace: String! +} + + """ Defines the details of Kubernetes object """ @@ -638,9 +697,15 @@ extend type Mutation { """ # authorized directive not required kubeObj(request: KubeObjectData!): String! + + """ + Receives kubernetes namespace data from subscriber + """ + # authorized directive not required + kubeNamespace(request: KubeNamespaceData!): String! } -extend type Subscription { +type Subscription { # INFRA OPERATIONS """ Listens infra events from the graphql server @@ -663,4 +728,9 @@ extend type Subscription { Returns a kubernetes object given an input """ getKubeObject(request: KubeObjectRequest!): KubeObjectResponse! + + """ + Returns a kubernetes namespaces given an input + """ + getKubeNamespace(request: KubeNamespaceRequest!): KubeNamespaceResponse! } diff --git a/chaoscenter/graphql/definitions/shared/chaoshub.graphqls b/chaoscenter/graphql/definitions/shared/chaoshub.graphqls index 952ee98cf19..12f1cafb2f7 100644 --- a/chaoscenter/graphql/definitions/shared/chaoshub.graphqls +++ b/chaoscenter/graphql/definitions/shared/chaoshub.graphqls @@ -31,6 +31,10 @@ type ChaosHub implements ResourceDetails & Audit { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ ID of the project in which the chaos hub is present """ projectID: ID! @@ -206,6 +210,10 @@ type ChaosHubStatus implements ResourceDetails & Audit { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is available or not. """ isAvailable: Boolean! @@ -320,6 +328,10 @@ input CreateChaosHubRequest { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! @@ -382,6 +394,10 @@ input CloningInput { """ repoURL: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! @@ -426,6 +442,10 @@ input CreateRemoteChaosHub { URL of the git repository """ repoURL: String! + """ + Connected Hub of remote repository + """ + remoteHub: String! } @@ -455,6 +475,10 @@ input UpdateChaosHubRequest { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! diff --git a/chaoscenter/graphql/server/go.mod b/chaoscenter/graphql/server/go.mod index 2bd2910eb44..945db83f223 100644 --- a/chaoscenter/graphql/server/go.mod +++ b/chaoscenter/graphql/server/go.mod @@ -20,7 +20,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.9.0 - github.com/tidwall/gjson v1.17.1 + github.com/tidwall/gjson v1.17.3 github.com/tidwall/sjson v1.2.5 github.com/vektah/gqlparser/v2 v2.5.16 go.mongodb.org/mongo-driver v1.16.1 diff --git a/chaoscenter/graphql/server/go.sum b/chaoscenter/graphql/server/go.sum index 8aff530921c..2084bf5b251 100644 --- a/chaoscenter/graphql/server/go.sum +++ b/chaoscenter/graphql/server/go.sum @@ -1120,8 +1120,8 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/thecodeteam/goscaleio v0.1.0/go.mod h1:68sdkZAsK8bvEwBlbQnlLS+xU+hvLYM/iQ8KXej1AwM= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= -github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= +github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/chaoscenter/graphql/server/graph/chaos_experiment.resolvers.go b/chaoscenter/graphql/server/graph/chaos_experiment.resolvers.go index 874dcf910ad..f45367aee19 100644 --- a/chaoscenter/graphql/server/graph/chaos_experiment.resolvers.go +++ b/chaoscenter/graphql/server/graph/chaos_experiment.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/graph/chaos_experiment_run.resolvers.go b/chaoscenter/graphql/server/graph/chaos_experiment_run.resolvers.go index 62a82b0de5f..35ab1e8994d 100644 --- a/chaoscenter/graphql/server/graph/chaos_experiment_run.resolvers.go +++ b/chaoscenter/graphql/server/graph/chaos_experiment_run.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/graph/chaos_infrastructure.resolvers.go b/chaoscenter/graphql/server/graph/chaos_infrastructure.resolvers.go index 7e4540509eb..2ba387b412b 100644 --- a/chaoscenter/graphql/server/graph/chaos_infrastructure.resolvers.go +++ b/chaoscenter/graphql/server/graph/chaos_infrastructure.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" @@ -116,6 +116,11 @@ func (r *mutationResolver) KubeObj(ctx context.Context, request model.KubeObject return r.chaosInfrastructureService.KubeObj(request, *data_store.Store) } +// KubeNamespace is the resolver for the kubeNamespace field. +func (r *mutationResolver) KubeNamespace(ctx context.Context, request model.KubeNamespaceData) (string, error) { + return r.chaosInfrastructureService.KubeNamespace(request, *data_store.Store) +} + // GetInfra is the resolver for the getInfra field. func (r *queryResolver) GetInfra(ctx context.Context, projectID string, infraID string) (*model.Infra, error) { logFields := logrus.Fields{ @@ -350,6 +355,24 @@ func (r *subscriptionResolver) GetKubeObject(ctx context.Context, request model. return kubeObjData, nil } +// GetKubeNamespace is the resolver for the getKubeNamespace field. +func (r *subscriptionResolver) GetKubeNamespace(ctx context.Context, request model.KubeNamespaceRequest) (<-chan *model.KubeNamespaceResponse, error) { + logrus.Print("NEW NAMESPACE REQUEST", request.InfraID) + kubeNamespaceData := make(chan *model.KubeNamespaceResponse) + reqID := uuid.New() + data_store.Store.Mutex.Lock() + data_store.Store.KubeNamespaceData[reqID.String()] = kubeNamespaceData + data_store.Store.Mutex.Unlock() + go func() { + <-ctx.Done() + logrus.Println("Closed KubeNamespace Listener") + delete(data_store.Store.KubeNamespaceData, reqID.String()) + }() + go r.chaosExperimentHandler.GetKubeNamespaceData(reqID.String(), request, *data_store.Store) + + return kubeNamespaceData, nil +} + // Subscription returns generated.SubscriptionResolver implementation. func (r *Resolver) Subscription() generated.SubscriptionResolver { return &subscriptionResolver{r} } diff --git a/chaoscenter/graphql/server/graph/chaoshub.resolvers.go b/chaoscenter/graphql/server/graph/chaoshub.resolvers.go index e6e86caa8d3..9eb0396ed37 100644 --- a/chaoscenter/graphql/server/graph/chaoshub.resolvers.go +++ b/chaoscenter/graphql/server/graph/chaoshub.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" @@ -14,7 +14,6 @@ import ( // AddChaosHub is the resolver for the addChaosHub field. func (r *mutationResolver) AddChaosHub(ctx context.Context, projectID string, request model.CreateChaosHubRequest) (*model.ChaosHub, error) { - if err := authorization.ValidateRole(ctx, projectID, authorization.MutationRbacRules[authorization.AddChaosHub], model.InvitationAccepted.String()); err != nil { diff --git a/chaoscenter/graphql/server/graph/environment.resolvers.go b/chaoscenter/graphql/server/graph/environment.resolvers.go index b9fd9a8496a..7cbfdd03e9f 100644 --- a/chaoscenter/graphql/server/graph/environment.resolvers.go +++ b/chaoscenter/graphql/server/graph/environment.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/graph/generated/generated.go b/chaoscenter/graphql/server/graph/generated/generated.go index 932e018a654..9f53f4eaaca 100644 --- a/chaoscenter/graphql/server/graph/generated/generated.go +++ b/chaoscenter/graphql/server/graph/generated/generated.go @@ -91,6 +91,7 @@ type ComplexityRoot struct { Name func(childComplexity int) int Password func(childComplexity int) int ProjectID func(childComplexity int) int + RemoteHub func(childComplexity int) int RepoBranch func(childComplexity int) int RepoURL func(childComplexity int) int SSHPrivateKey func(childComplexity int) int @@ -115,6 +116,7 @@ type ComplexityRoot struct { LastSyncedAt func(childComplexity int) int Name func(childComplexity int) int Password func(childComplexity int) int + RemoteHub func(childComplexity int) int RepoBranch func(childComplexity int) int RepoURL func(childComplexity int) int SSHPrivateKey func(childComplexity int) int @@ -398,6 +400,15 @@ type ComplexityRoot struct { Version func(childComplexity int) int } + KubeNamespace struct { + Name func(childComplexity int) int + } + + KubeNamespaceResponse struct { + InfraID func(childComplexity int) int + KubeNamespace func(childComplexity int) int + } + KubeObject struct { Data func(childComplexity int) int Namespace func(childComplexity int) int @@ -497,6 +508,7 @@ type ComplexityRoot struct { GenerateSSHKey func(childComplexity int) int GetManifestWithInfraID func(childComplexity int, projectID string, infraID string, accessKey string) int GitopsNotifier func(childComplexity int, clusterInfo model.InfraIdentity, experimentID string) int + KubeNamespace func(childComplexity int, request model.KubeNamespaceData) int KubeObj func(childComplexity int, request model.KubeObjectData) int PodLog func(childComplexity int, request model.PodLog) int RegisterInfra func(childComplexity int, projectID string, request model.RegisterInfraRequest) int @@ -694,10 +706,11 @@ type ComplexityRoot struct { } Subscription struct { - GetInfraEvents func(childComplexity int, projectID string) int - GetKubeObject func(childComplexity int, request model.KubeObjectRequest) int - GetPodLog func(childComplexity int, request model.PodLogRequest) int - InfraConnect func(childComplexity int, request model.InfraIdentity) int + GetInfraEvents func(childComplexity int, projectID string) int + GetKubeNamespace func(childComplexity int, request model.KubeNamespaceRequest) int + GetKubeObject func(childComplexity int, request model.KubeObjectRequest) int + GetPodLog func(childComplexity int, request model.PodLogRequest) int + InfraConnect func(childComplexity int, request model.InfraIdentity) int } UserDetails struct { @@ -727,6 +740,7 @@ type MutationResolver interface { GetManifestWithInfraID(ctx context.Context, projectID string, infraID string, accessKey string) (string, error) PodLog(ctx context.Context, request model.PodLog) (string, error) KubeObj(ctx context.Context, request model.KubeObjectData) (string, error) + KubeNamespace(ctx context.Context, request model.KubeNamespaceData) (string, error) AddChaosHub(ctx context.Context, projectID string, request model.CreateChaosHubRequest) (*model.ChaosHub, error) AddRemoteChaosHub(ctx context.Context, projectID string, request model.CreateRemoteChaosHub) (*model.ChaosHub, error) SaveChaosHub(ctx context.Context, projectID string, request model.CreateChaosHubRequest) (*model.ChaosHub, error) @@ -786,6 +800,7 @@ type SubscriptionResolver interface { InfraConnect(ctx context.Context, request model.InfraIdentity) (<-chan *model.InfraActionResponse, error) GetPodLog(ctx context.Context, request model.PodLogRequest) (<-chan *model.PodLogResponse, error) GetKubeObject(ctx context.Context, request model.KubeObjectRequest) (<-chan *model.KubeObjectResponse, error) + GetKubeNamespace(ctx context.Context, request model.KubeNamespaceRequest) (<-chan *model.KubeNamespaceResponse, error) } type executableSchema struct { @@ -1031,6 +1046,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ChaosHub.ProjectID(childComplexity), true + case "ChaosHub.remoteHub": + if e.complexity.ChaosHub.RemoteHub == nil { + break + } + + return e.complexity.ChaosHub.RemoteHub(childComplexity), true + case "ChaosHub.repoBranch": if e.complexity.ChaosHub.RepoBranch == nil { break @@ -1178,6 +1200,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ChaosHubStatus.Password(childComplexity), true + case "ChaosHubStatus.remoteHub": + if e.complexity.ChaosHubStatus.RemoteHub == nil { + break + } + + return e.complexity.ChaosHubStatus.RemoteHub(childComplexity), true + case "ChaosHubStatus.repoBranch": if e.complexity.ChaosHubStatus.RepoBranch == nil { break @@ -2557,6 +2586,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.K8SProbe.Version(childComplexity), true + case "KubeNamespace.name": + if e.complexity.KubeNamespace.Name == nil { + break + } + + return e.complexity.KubeNamespace.Name(childComplexity), true + + case "KubeNamespaceResponse.infraID": + if e.complexity.KubeNamespaceResponse.InfraID == nil { + break + } + + return e.complexity.KubeNamespaceResponse.InfraID(childComplexity), true + + case "KubeNamespaceResponse.kubeNamespace": + if e.complexity.KubeNamespaceResponse.KubeNamespace == nil { + break + } + + return e.complexity.KubeNamespaceResponse.KubeNamespace(childComplexity), true + case "KubeObject.data": if e.complexity.KubeObject.Data == nil { break @@ -3081,6 +3131,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.GitopsNotifier(childComplexity, args["clusterInfo"].(model.InfraIdentity), args["experimentID"].(string)), true + case "Mutation.kubeNamespace": + if e.complexity.Mutation.KubeNamespace == nil { + break + } + + args, err := ec.field_Mutation_kubeNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.KubeNamespace(childComplexity, args["request"].(model.KubeNamespaceData)), true + case "Mutation.kubeObj": if e.complexity.Mutation.KubeObj == nil { break @@ -4256,6 +4318,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Subscription.GetInfraEvents(childComplexity, args["projectID"].(string)), true + case "Subscription.getKubeNamespace": + if e.complexity.Subscription.GetKubeNamespace == nil { + break + } + + args, err := ec.field_Subscription_getKubeNamespace_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.GetKubeNamespace(childComplexity, args["request"].(model.KubeNamespaceRequest)), true + case "Subscription.getKubeObject": if e.complexity.Subscription.GetKubeObject == nil { break @@ -4361,6 +4435,8 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputInfraIdentity, ec.unmarshalInputK8SProbeRequest, ec.unmarshalInputKubeGVRRequest, + ec.unmarshalInputKubeNamespaceData, + ec.unmarshalInputKubeNamespaceRequest, ec.unmarshalInputKubeObjectData, ec.unmarshalInputKubeObjectRequest, ec.unmarshalInputKubernetesCMDProbeRequest, @@ -5217,7 +5293,7 @@ type GetExperimentStatsResponse { totalExpCategorizedByResiliencyScore: [ResilienceScoreCategory]! } -extend type Query { +type Query { """ @@ -5239,7 +5315,7 @@ extend type Query { getExperimentStats(projectID: ID!): GetExperimentStatsResponse! } -extend type Mutation { +type Mutation { """ Creates a new experiment and applies its manifest """ @@ -5682,11 +5758,11 @@ type KubeObjectResponse { """ Type of the Kubernetes object """ - kubeObj: [KubeObject]! + kubeObj: KubeObject! } """ -KubeObject consists of the namespace and the available resources in the same +KubeObject consists of the available resources in a namespace """ type KubeObject { """ @@ -5728,16 +5804,75 @@ input KubeObjectRequest { GVR Request """ kubeObjRequest: KubeGVRRequest + """ + Namespace in which the Kubernetes object is present + """ + namespace: String! objectType: String! workloads: [Workload] } +""" +Defines details for fetching Kubernetes namespace data +""" +input KubeNamespaceRequest { + """ + ID of the infra + """ + infraID: ID! +} + +""" +Define name in the infra (not really useful at the moment but maybe we will need other field later) +""" +type KubeNamespace{ + """ + Name of the namespace + """ + name: String! +} + + + input KubeGVRRequest { group: String! version: String! resource: String! } +""" +Response received for querying Kubernetes Namespaces +""" +type KubeNamespaceResponse { + """ + ID of the infra in which the Kubernetes namespace is present + """ + infraID: ID! + """ + List of the Kubernetes namespace + """ + kubeNamespace: [KubeNamespace]! +} + +""" +Defines the details of Kubernetes namespace +""" +input KubeNamespaceData { + """ + Unique request ID for fetching Kubernetes namespace details + """ + requestID: ID! + """ + ID of the infra in which the Kubernetes namespace is present + """ + infraID: InfraIdentity! + """ + List of KubeNamespace return by subscriber + """ + kubeNamespace: String! +} + + """ Defines the details of Kubernetes object """ @@ -5962,9 +6097,15 @@ extend type Mutation { """ # authorized directive not required kubeObj(request: KubeObjectData!): String! + + """ + Receives kubernetes namespace data from subscriber + """ + # authorized directive not required + kubeNamespace(request: KubeNamespaceData!): String! } -extend type Subscription { +type Subscription { # INFRA OPERATIONS """ Listens infra events from the graphql server @@ -5987,6 +6128,11 @@ extend type Subscription { Returns a kubernetes object given an input """ getKubeObject(request: KubeObjectRequest!): KubeObjectResponse! + + """ + Returns a kubernetes namespaces given an input + """ + getKubeNamespace(request: KubeNamespaceRequest!): KubeNamespaceResponse! } `, BuiltIn: false}, {Name: "../../../definitions/shared/chaoshub.graphqls", Input: `enum AuthType { @@ -6022,6 +6168,10 @@ type ChaosHub implements ResourceDetails & Audit { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ ID of the project in which the chaos hub is present """ projectID: ID! @@ -6197,6 +6347,10 @@ type ChaosHubStatus implements ResourceDetails & Audit { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is available or not. """ isAvailable: Boolean! @@ -6311,6 +6465,10 @@ input CreateChaosHubRequest { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! @@ -6373,6 +6531,10 @@ input CloningInput { """ repoURL: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! @@ -6417,6 +6579,10 @@ input CreateRemoteChaosHub { URL of the git repository """ repoURL: String! + """ + Connected Hub of remote repository + """ + remoteHub: String! } @@ -6446,6 +6612,10 @@ input UpdateChaosHubRequest { """ repoBranch: String! """ + Connected Hub of remote repository + """ + remoteHub: String! + """ Bool value indicating whether the hub is private or not. """ isPrivate: Boolean! @@ -8607,6 +8777,21 @@ func (ec *executionContext) field_Mutation_gitopsNotifier_args(ctx context.Conte return args, nil } +func (ec *executionContext) field_Mutation_kubeNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.KubeNamespaceData + if tmp, ok := rawArgs["request"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("request")) + arg0, err = ec.unmarshalNKubeNamespaceData2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["request"] = arg0 + return args, nil +} + func (ec *executionContext) field_Mutation_kubeObj_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -9717,6 +9902,21 @@ func (ec *executionContext) field_Subscription_getInfraEvents_args(ctx context.C return args, nil } +func (ec *executionContext) field_Subscription_getKubeNamespace_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.KubeNamespaceRequest + if tmp, ok := rawArgs["request"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("request")) + arg0, err = ec.unmarshalNKubeNamespaceRequest2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceRequest(ctx, tmp) + if err != nil { + return nil, err + } + } + args["request"] = arg0 + return args, nil +} + func (ec *executionContext) field_Subscription_getKubeObject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -9831,7 +10031,7 @@ func (ec *executionContext) _ActionPayload_requestID(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_requestID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_requestID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -9875,7 +10075,7 @@ func (ec *executionContext) _ActionPayload_requestType(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_requestType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_requestType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -9919,7 +10119,7 @@ func (ec *executionContext) _ActionPayload_k8sManifest(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_k8sManifest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_k8sManifest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -9963,7 +10163,7 @@ func (ec *executionContext) _ActionPayload_namespace(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -10004,7 +10204,7 @@ func (ec *executionContext) _ActionPayload_externalData(ctx context.Context, fie return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_externalData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_externalData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -10045,7 +10245,7 @@ func (ec *executionContext) _ActionPayload_username(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActionPayload_username(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ActionPayload_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ActionPayload", Field: field, @@ -10089,7 +10289,7 @@ func (ec *executionContext) _Annotation_categories(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_categories(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_categories(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10133,7 +10333,7 @@ func (ec *executionContext) _Annotation_vendor(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_vendor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_vendor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10177,7 +10377,7 @@ func (ec *executionContext) _Annotation_createdAt(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10221,7 +10421,7 @@ func (ec *executionContext) _Annotation_repository(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_repository(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_repository(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10265,7 +10465,7 @@ func (ec *executionContext) _Annotation_support(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_support(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_support(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10309,7 +10509,7 @@ func (ec *executionContext) _Annotation_chartDescription(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Annotation_chartDescription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Annotation_chartDescription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Annotation", Field: field, @@ -10353,7 +10553,7 @@ func (ec *executionContext) _ChaosExperimentResponse_experimentID(ctx context.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10397,7 +10597,7 @@ func (ec *executionContext) _ChaosExperimentResponse_projectID(ctx context.Conte return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10441,7 +10641,7 @@ func (ec *executionContext) _ChaosExperimentResponse_cronSyntax(ctx context.Cont return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_cronSyntax(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_cronSyntax(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10485,7 +10685,7 @@ func (ec *executionContext) _ChaosExperimentResponse_experimentName(ctx context. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10529,7 +10729,7 @@ func (ec *executionContext) _ChaosExperimentResponse_experimentDescription(ctx c return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentDescription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_experimentDescription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10573,7 +10773,7 @@ func (ec *executionContext) _ChaosExperimentResponse_isCustomExperiment(ctx cont return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_isCustomExperiment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_isCustomExperiment(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10614,7 +10814,7 @@ func (ec *executionContext) _ChaosExperimentResponse_tags(ctx context.Context, f return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosExperimentResponse_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosExperimentResponse_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosExperimentResponse", Field: field, @@ -10658,7 +10858,7 @@ func (ec *executionContext) _ChaosHub_id(ctx context.Context, field graphql.Coll return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10702,7 +10902,7 @@ func (ec *executionContext) _ChaosHub_repoURL(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_repoURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_repoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10746,7 +10946,51 @@ func (ec *executionContext) _ChaosHub_repoBranch(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_repoBranch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_repoBranch(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ChaosHub", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ChaosHub_remoteHub(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHub) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ChaosHub_remoteHub(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RemoteHub, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ChaosHub_remoteHub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10790,7 +11034,7 @@ func (ec *executionContext) _ChaosHub_projectID(ctx context.Context, field graph return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10834,7 +11078,7 @@ func (ec *executionContext) _ChaosHub_isDefault(ctx context.Context, field graph return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_isDefault(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_isDefault(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10878,7 +11122,7 @@ func (ec *executionContext) _ChaosHub_name(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10919,7 +11163,7 @@ func (ec *executionContext) _ChaosHub_tags(ctx context.Context, field graphql.Co return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -10960,7 +11204,7 @@ func (ec *executionContext) _ChaosHub_createdBy(ctx context.Context, field graph return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11009,7 +11253,7 @@ func (ec *executionContext) _ChaosHub_updatedBy(ctx context.Context, field graph return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11058,7 +11302,7 @@ func (ec *executionContext) _ChaosHub_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11102,7 +11346,7 @@ func (ec *executionContext) _ChaosHub_hubType(ctx context.Context, field graphql return ec.marshalNHubType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐHubType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_hubType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_hubType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11146,7 +11390,7 @@ func (ec *executionContext) _ChaosHub_isPrivate(ctx context.Context, field graph return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_isPrivate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_isPrivate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11190,7 +11434,7 @@ func (ec *executionContext) _ChaosHub_authType(ctx context.Context, field graphq return ec.marshalNAuthType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐAuthType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_authType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_authType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11231,7 +11475,7 @@ func (ec *executionContext) _ChaosHub_token(ctx context.Context, field graphql.C return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11272,7 +11516,7 @@ func (ec *executionContext) _ChaosHub_userName(ctx context.Context, field graphq return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_userName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11313,7 +11557,7 @@ func (ec *executionContext) _ChaosHub_password(ctx context.Context, field graphq return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_password(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_password(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11354,7 +11598,7 @@ func (ec *executionContext) _ChaosHub_sshPrivateKey(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_sshPrivateKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_sshPrivateKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11398,7 +11642,7 @@ func (ec *executionContext) _ChaosHub_isRemoved(ctx context.Context, field graph return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11442,7 +11686,7 @@ func (ec *executionContext) _ChaosHub_createdAt(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11486,7 +11730,7 @@ func (ec *executionContext) _ChaosHub_updatedAt(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11530,7 +11774,7 @@ func (ec *executionContext) _ChaosHub_lastSyncedAt(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHub_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHub_lastSyncedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHub", Field: field, @@ -11574,7 +11818,7 @@ func (ec *executionContext) _ChaosHubStatus_id(ctx context.Context, field graphq return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11618,7 +11862,7 @@ func (ec *executionContext) _ChaosHubStatus_repoURL(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_repoURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_repoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11662,95 +11906,7 @@ func (ec *executionContext) _ChaosHubStatus_repoBranch(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_repoBranch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ChaosHubStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ChaosHubStatus_isAvailable(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ChaosHubStatus_isAvailable(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsAvailable, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ChaosHubStatus_isAvailable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ChaosHubStatus", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ChaosHubStatus_totalFaults(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ChaosHubStatus_totalFaults(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TotalFaults, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ChaosHubStatus_totalFaults(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_repoBranch(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11763,8 +11919,8 @@ func (ec *executionContext) fieldContext_ChaosHubStatus_totalFaults(ctx context. return fc, nil } -func (ec *executionContext) _ChaosHubStatus_totalExperiments(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ChaosHubStatus_totalExperiments(ctx, field) +func (ec *executionContext) _ChaosHubStatus_remoteHub(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ChaosHubStatus_remoteHub(ctx, field) if err != nil { return graphql.Null } @@ -11777,7 +11933,7 @@ func (ec *executionContext) _ChaosHubStatus_totalExperiments(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalExperiments, nil + return obj.RemoteHub, nil }) if err != nil { ec.Error(ctx, err) @@ -11794,7 +11950,139 @@ func (ec *executionContext) _ChaosHubStatus_totalExperiments(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_totalExperiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_remoteHub(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ChaosHubStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ChaosHubStatus_isAvailable(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ChaosHubStatus_isAvailable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsAvailable, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ChaosHubStatus_isAvailable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ChaosHubStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ChaosHubStatus_totalFaults(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ChaosHubStatus_totalFaults(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalFaults, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ChaosHubStatus_totalFaults(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ChaosHubStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _ChaosHubStatus_totalExperiments(ctx context.Context, field graphql.CollectedField, obj *model.ChaosHubStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ChaosHubStatus_totalExperiments(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalExperiments, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ChaosHubStatus_totalExperiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11838,7 +12126,7 @@ func (ec *executionContext) _ChaosHubStatus_name(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11882,7 +12170,7 @@ func (ec *executionContext) _ChaosHubStatus_hubType(ctx context.Context, field g return ec.marshalNHubType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐHubType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_hubType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_hubType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11926,7 +12214,7 @@ func (ec *executionContext) _ChaosHubStatus_isPrivate(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_isPrivate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_isPrivate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -11970,7 +12258,7 @@ func (ec *executionContext) _ChaosHubStatus_authType(ctx context.Context, field return ec.marshalNAuthType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐAuthType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_authType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_authType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12011,7 +12299,7 @@ func (ec *executionContext) _ChaosHubStatus_token(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12052,7 +12340,7 @@ func (ec *executionContext) _ChaosHubStatus_userName(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_userName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12093,7 +12381,7 @@ func (ec *executionContext) _ChaosHubStatus_password(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_password(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_password(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12137,7 +12425,7 @@ func (ec *executionContext) _ChaosHubStatus_isRemoved(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12178,7 +12466,7 @@ func (ec *executionContext) _ChaosHubStatus_sshPrivateKey(ctx context.Context, f return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_sshPrivateKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_sshPrivateKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12219,7 +12507,7 @@ func (ec *executionContext) _ChaosHubStatus_sshPublicKey(ctx context.Context, fi return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_sshPublicKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_sshPublicKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12263,7 +12551,7 @@ func (ec *executionContext) _ChaosHubStatus_lastSyncedAt(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_lastSyncedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_lastSyncedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12304,7 +12592,7 @@ func (ec *executionContext) _ChaosHubStatus_tags(ctx context.Context, field grap return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12345,7 +12633,7 @@ func (ec *executionContext) _ChaosHubStatus_createdBy(ctx context.Context, field return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12394,7 +12682,7 @@ func (ec *executionContext) _ChaosHubStatus_updatedBy(ctx context.Context, field return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12446,7 +12734,7 @@ func (ec *executionContext) _ChaosHubStatus_createdAt(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12490,7 +12778,7 @@ func (ec *executionContext) _ChaosHubStatus_updatedAt(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12531,7 +12819,7 @@ func (ec *executionContext) _ChaosHubStatus_description(ctx context.Context, fie return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12575,7 +12863,7 @@ func (ec *executionContext) _ChaosHubStatus_isDefault(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ChaosHubStatus_isDefault(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ChaosHubStatus_isDefault(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ChaosHubStatus", Field: field, @@ -12619,7 +12907,7 @@ func (ec *executionContext) _Chart_apiVersion(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Chart_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Chart_apiVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Chart", Field: field, @@ -12663,7 +12951,7 @@ func (ec *executionContext) _Chart_kind(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Chart_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Chart_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Chart", Field: field, @@ -12707,7 +12995,7 @@ func (ec *executionContext) _Chart_metadata(ctx context.Context, field graphql.C return ec.marshalNMetadata2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Chart_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Chart_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Chart", Field: field, @@ -12759,7 +13047,7 @@ func (ec *executionContext) _Chart_spec(ctx context.Context, field graphql.Colle return ec.marshalNSpec2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐSpec(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Chart_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Chart_spec(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Chart", Field: field, @@ -12831,7 +13119,7 @@ func (ec *executionContext) _Chart_packageInfo(ctx context.Context, field graphq return ec.marshalNPackageInformation2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐPackageInformation(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Chart_packageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Chart_packageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Chart", Field: field, @@ -12881,7 +13169,7 @@ func (ec *executionContext) _Comparator_type(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Comparator_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Comparator_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Comparator", Field: field, @@ -12925,7 +13213,7 @@ func (ec *executionContext) _Comparator_value(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Comparator_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Comparator_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Comparator", Field: field, @@ -12969,7 +13257,7 @@ func (ec *executionContext) _Comparator_criteria(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Comparator_criteria(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Comparator_criteria(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Comparator", Field: field, @@ -13013,7 +13301,7 @@ func (ec *executionContext) _ConfirmInfraRegistrationResponse_isInfraConfirmed(c return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_isInfraConfirmed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_isInfraConfirmed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ConfirmInfraRegistrationResponse", Field: field, @@ -13054,7 +13342,7 @@ func (ec *executionContext) _ConfirmInfraRegistrationResponse_newAccessKey(ctx c return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_newAccessKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_newAccessKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ConfirmInfraRegistrationResponse", Field: field, @@ -13095,7 +13383,7 @@ func (ec *executionContext) _ConfirmInfraRegistrationResponse_infraID(ctx contex return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_infraID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ConfirmInfraRegistrationResponse_infraID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ConfirmInfraRegistrationResponse", Field: field, @@ -13139,7 +13427,7 @@ func (ec *executionContext) _Environment_projectID(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13183,7 +13471,7 @@ func (ec *executionContext) _Environment_environmentID(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_environmentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_environmentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13227,7 +13515,7 @@ func (ec *executionContext) _Environment_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13268,7 +13556,7 @@ func (ec *executionContext) _Environment_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13309,7 +13597,7 @@ func (ec *executionContext) _Environment_tags(ctx context.Context, field graphql return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13353,7 +13641,7 @@ func (ec *executionContext) _Environment_type(ctx context.Context, field graphql return ec.marshalNEnvironmentType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐEnvironmentType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13397,7 +13685,7 @@ func (ec *executionContext) _Environment_createdAt(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13438,7 +13726,7 @@ func (ec *executionContext) _Environment_createdBy(ctx context.Context, field gr return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13487,7 +13775,7 @@ func (ec *executionContext) _Environment_updatedBy(ctx context.Context, field gr return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13539,7 +13827,7 @@ func (ec *executionContext) _Environment_updatedAt(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13580,7 +13868,7 @@ func (ec *executionContext) _Environment_isRemoved(ctx context.Context, field gr return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13621,7 +13909,7 @@ func (ec *executionContext) _Environment_infraIDs(ctx context.Context, field gra return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Environment_infraIDs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Environment_infraIDs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Environment", Field: field, @@ -13665,7 +13953,7 @@ func (ec *executionContext) _ExecutedByExperiment_experimentID(ctx context.Conte return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutedByExperiment_experimentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutedByExperiment_experimentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutedByExperiment", Field: field, @@ -13709,7 +13997,7 @@ func (ec *executionContext) _ExecutedByExperiment_experimentName(ctx context.Con return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutedByExperiment_experimentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutedByExperiment_experimentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutedByExperiment", Field: field, @@ -13753,7 +14041,7 @@ func (ec *executionContext) _ExecutedByExperiment_updatedAt(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutedByExperiment_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutedByExperiment_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutedByExperiment", Field: field, @@ -13794,7 +14082,7 @@ func (ec *executionContext) _ExecutedByExperiment_updatedBy(ctx context.Context, return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutedByExperiment_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutedByExperiment_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutedByExperiment", Field: field, @@ -13846,7 +14134,7 @@ func (ec *executionContext) _ExecutionHistory_mode(ctx context.Context, field gr return ec.marshalNMode2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMode(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutionHistory_mode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutionHistory_mode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutionHistory", Field: field, @@ -13890,7 +14178,7 @@ func (ec *executionContext) _ExecutionHistory_faultName(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutionHistory_faultName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutionHistory_faultName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutionHistory", Field: field, @@ -13934,7 +14222,7 @@ func (ec *executionContext) _ExecutionHistory_status(ctx context.Context, field return ec.marshalNStatus2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutionHistory_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutionHistory_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutionHistory", Field: field, @@ -13984,7 +14272,7 @@ func (ec *executionContext) _ExecutionHistory_executedByExperiment(ctx context.C return ec.marshalNExecutedByExperiment2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExecutedByExperiment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExecutionHistory_executedByExperiment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExecutionHistory_executedByExperiment(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExecutionHistory", Field: field, @@ -14038,7 +14326,7 @@ func (ec *executionContext) _Experiment_projectID(ctx context.Context, field gra return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14082,7 +14370,7 @@ func (ec *executionContext) _Experiment_experimentID(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_experimentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_experimentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14123,7 +14411,7 @@ func (ec *executionContext) _Experiment_experimentType(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_experimentType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_experimentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14167,7 +14455,7 @@ func (ec *executionContext) _Experiment_experimentManifest(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_experimentManifest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_experimentManifest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14211,7 +14499,7 @@ func (ec *executionContext) _Experiment_cronSyntax(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_cronSyntax(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_cronSyntax(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14255,7 +14543,7 @@ func (ec *executionContext) _Experiment_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14299,7 +14587,7 @@ func (ec *executionContext) _Experiment_description(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14343,7 +14631,7 @@ func (ec *executionContext) _Experiment_weightages(ctx context.Context, field gr return ec.marshalNWeightages2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐWeightagesᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_weightages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_weightages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14393,7 +14681,7 @@ func (ec *executionContext) _Experiment_isCustomExperiment(ctx context.Context, return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_isCustomExperiment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_isCustomExperiment(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14437,7 +14725,7 @@ func (ec *executionContext) _Experiment_updatedAt(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14481,7 +14769,7 @@ func (ec *executionContext) _Experiment_createdAt(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14522,7 +14810,7 @@ func (ec *executionContext) _Experiment_infra(ctx context.Context, field graphql return ec.marshalOInfra2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfra(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_infra(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_infra(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14622,7 +14910,7 @@ func (ec *executionContext) _Experiment_isRemoved(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14663,7 +14951,7 @@ func (ec *executionContext) _Experiment_tags(ctx context.Context, field graphql. return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14704,7 +14992,7 @@ func (ec *executionContext) _Experiment_createdBy(ctx context.Context, field gra return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14753,7 +15041,7 @@ func (ec *executionContext) _Experiment_recentExperimentRunDetails(ctx context.C return ec.marshalORecentExperimentRun2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐRecentExperimentRun(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_recentExperimentRunDetails(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_recentExperimentRunDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14812,7 +15100,7 @@ func (ec *executionContext) _Experiment_updatedBy(ctx context.Context, field gra return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiment_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiment_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiment", Field: field, @@ -14864,7 +15152,7 @@ func (ec *executionContext) _ExperimentDetails_engineDetails(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentDetails_engineDetails(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentDetails_engineDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentDetails", Field: field, @@ -14908,7 +15196,7 @@ func (ec *executionContext) _ExperimentDetails_experimentDetails(ctx context.Con return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentDetails_experimentDetails(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentDetails_experimentDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentDetails", Field: field, @@ -14952,7 +15240,7 @@ func (ec *executionContext) _ExperimentRun_projectID(ctx context.Context, field return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -14996,7 +15284,7 @@ func (ec *executionContext) _ExperimentRun_experimentRunID(ctx context.Context, return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_experimentRunID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_experimentRunID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15037,7 +15325,7 @@ func (ec *executionContext) _ExperimentRun_experimentType(ctx context.Context, f return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_experimentType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_experimentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15081,7 +15369,7 @@ func (ec *executionContext) _ExperimentRun_experimentID(ctx context.Context, fie return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_experimentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_experimentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15125,7 +15413,7 @@ func (ec *executionContext) _ExperimentRun_weightages(ctx context.Context, field return ec.marshalNWeightages2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐWeightagesᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_weightages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_weightages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15175,7 +15463,7 @@ func (ec *executionContext) _ExperimentRun_updatedAt(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15219,7 +15507,7 @@ func (ec *executionContext) _ExperimentRun_createdAt(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15263,7 +15551,7 @@ func (ec *executionContext) _ExperimentRun_infra(ctx context.Context, field grap return ec.marshalNInfra2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfra(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_infra(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_infra(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15363,7 +15651,7 @@ func (ec *executionContext) _ExperimentRun_experimentName(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_experimentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_experimentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15407,7 +15695,7 @@ func (ec *executionContext) _ExperimentRun_experimentManifest(ctx context.Contex return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_experimentManifest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_experimentManifest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15451,7 +15739,7 @@ func (ec *executionContext) _ExperimentRun_phase(ctx context.Context, field grap return ec.marshalNExperimentRunStatus2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExperimentRunStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_phase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_phase(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15492,7 +15780,7 @@ func (ec *executionContext) _ExperimentRun_resiliencyScore(ctx context.Context, return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_resiliencyScore(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_resiliencyScore(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15533,7 +15821,7 @@ func (ec *executionContext) _ExperimentRun_faultsPassed(ctx context.Context, fie return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_faultsPassed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_faultsPassed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15574,7 +15862,7 @@ func (ec *executionContext) _ExperimentRun_faultsFailed(ctx context.Context, fie return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_faultsFailed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_faultsFailed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15615,7 +15903,7 @@ func (ec *executionContext) _ExperimentRun_faultsAwaited(ctx context.Context, fi return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_faultsAwaited(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_faultsAwaited(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15656,7 +15944,7 @@ func (ec *executionContext) _ExperimentRun_faultsStopped(ctx context.Context, fi return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_faultsStopped(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_faultsStopped(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15697,7 +15985,7 @@ func (ec *executionContext) _ExperimentRun_faultsNa(ctx context.Context, field g return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_faultsNa(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_faultsNa(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15738,7 +16026,7 @@ func (ec *executionContext) _ExperimentRun_totalFaults(ctx context.Context, fiel return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_totalFaults(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_totalFaults(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15782,7 +16070,7 @@ func (ec *executionContext) _ExperimentRun_executionData(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_executionData(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_executionData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15823,7 +16111,7 @@ func (ec *executionContext) _ExperimentRun_isRemoved(ctx context.Context, field return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15864,7 +16152,7 @@ func (ec *executionContext) _ExperimentRun_updatedBy(ctx context.Context, field return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15913,7 +16201,7 @@ func (ec *executionContext) _ExperimentRun_createdBy(ctx context.Context, field return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -15962,7 +16250,7 @@ func (ec *executionContext) _ExperimentRun_notifyID(ctx context.Context, field g return ec.marshalOID2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_notifyID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_notifyID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -16006,7 +16294,7 @@ func (ec *executionContext) _ExperimentRun_runSequence(ctx context.Context, fiel return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ExperimentRun_runSequence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ExperimentRun_runSequence(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ExperimentRun", Field: field, @@ -16050,7 +16338,7 @@ func (ec *executionContext) _Experiments_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiments_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiments_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiments", Field: field, @@ -16094,7 +16382,7 @@ func (ec *executionContext) _Experiments_CSV(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiments_CSV(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiments_CSV(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiments", Field: field, @@ -16138,7 +16426,7 @@ func (ec *executionContext) _Experiments_desc(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Experiments_desc(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Experiments_desc(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Experiments", Field: field, @@ -16182,7 +16470,7 @@ func (ec *executionContext) _FaultDetails_fault(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultDetails_fault(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultDetails_fault(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultDetails", Field: field, @@ -16226,7 +16514,7 @@ func (ec *executionContext) _FaultDetails_engine(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultDetails_engine(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultDetails_engine(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultDetails", Field: field, @@ -16270,7 +16558,7 @@ func (ec *executionContext) _FaultDetails_csv(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultDetails_csv(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultDetails_csv(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultDetails", Field: field, @@ -16314,7 +16602,7 @@ func (ec *executionContext) _FaultList_name(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultList_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultList_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultList", Field: field, @@ -16358,7 +16646,7 @@ func (ec *executionContext) _FaultList_displayName(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultList_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultList_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultList", Field: field, @@ -16402,7 +16690,7 @@ func (ec *executionContext) _FaultList_description(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultList_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultList_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultList", Field: field, @@ -16443,7 +16731,7 @@ func (ec *executionContext) _FaultList_plan(ctx context.Context, field graphql.C return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_FaultList_plan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_FaultList_plan(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "FaultList", Field: field, @@ -16487,7 +16775,7 @@ func (ec *executionContext) _GET_criteria(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GET_criteria(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GET_criteria(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GET", Field: field, @@ -16531,7 +16819,7 @@ func (ec *executionContext) _GET_responseCode(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GET_responseCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GET_responseCode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GET", Field: field, @@ -16575,7 +16863,7 @@ func (ec *executionContext) _GetChaosHubStatsResponse_totalChaosHubs(ctx context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetChaosHubStatsResponse_totalChaosHubs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetChaosHubStatsResponse_totalChaosHubs(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetChaosHubStatsResponse", Field: field, @@ -16619,7 +16907,7 @@ func (ec *executionContext) _GetExperimentResponse_experimentDetails(ctx context return ec.marshalNExperiment2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExperiment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentResponse_experimentDetails(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentResponse_experimentDetails(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentResponse", Field: field, @@ -16696,7 +16984,7 @@ func (ec *executionContext) _GetExperimentResponse_averageResiliencyScore(ctx co return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentResponse_averageResiliencyScore(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentResponse_averageResiliencyScore(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentResponse", Field: field, @@ -16740,7 +17028,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalExperimentRuns(c return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -16784,7 +17072,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalCompletedExperim return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalCompletedExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalCompletedExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -16828,7 +17116,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalTerminatedExperi return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalTerminatedExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalTerminatedExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -16872,7 +17160,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalRunningExperimen return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalRunningExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalRunningExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -16916,7 +17204,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalStoppedExperimen return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalStoppedExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalStoppedExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -16960,7 +17248,7 @@ func (ec *executionContext) _GetExperimentRunStatsResponse_totalErroredExperimen return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalErroredExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentRunStatsResponse_totalErroredExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentRunStatsResponse", Field: field, @@ -17004,7 +17292,7 @@ func (ec *executionContext) _GetExperimentStatsResponse_totalExperiments(ctx con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentStatsResponse_totalExperiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentStatsResponse_totalExperiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentStatsResponse", Field: field, @@ -17048,7 +17336,7 @@ func (ec *executionContext) _GetExperimentStatsResponse_totalExpCategorizedByRes return ec.marshalNResilienceScoreCategory2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐResilienceScoreCategory(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetExperimentStatsResponse_totalExpCategorizedByResiliencyScore(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetExperimentStatsResponse_totalExpCategorizedByResiliencyScore(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetExperimentStatsResponse", Field: field, @@ -17098,7 +17386,7 @@ func (ec *executionContext) _GetInfraStatsResponse_totalInfrastructures(ctx cont return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalInfrastructures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalInfrastructures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetInfraStatsResponse", Field: field, @@ -17142,7 +17430,7 @@ func (ec *executionContext) _GetInfraStatsResponse_totalActiveInfrastructure(ctx return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalActiveInfrastructure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalActiveInfrastructure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetInfraStatsResponse", Field: field, @@ -17186,7 +17474,7 @@ func (ec *executionContext) _GetInfraStatsResponse_totalInactiveInfrastructures( return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalInactiveInfrastructures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalInactiveInfrastructures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetInfraStatsResponse", Field: field, @@ -17230,7 +17518,7 @@ func (ec *executionContext) _GetInfraStatsResponse_totalConfirmedInfrastructure( return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalConfirmedInfrastructure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalConfirmedInfrastructure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetInfraStatsResponse", Field: field, @@ -17274,7 +17562,7 @@ func (ec *executionContext) _GetInfraStatsResponse_totalNonConfirmedInfrastructu return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalNonConfirmedInfrastructures(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetInfraStatsResponse_totalNonConfirmedInfrastructures(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetInfraStatsResponse", Field: field, @@ -17318,7 +17606,7 @@ func (ec *executionContext) _GetProbeReferenceResponse_projectID(ctx context.Con return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbeReferenceResponse_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbeReferenceResponse_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbeReferenceResponse", Field: field, @@ -17362,7 +17650,7 @@ func (ec *executionContext) _GetProbeReferenceResponse_name(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbeReferenceResponse_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbeReferenceResponse_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbeReferenceResponse", Field: field, @@ -17406,7 +17694,7 @@ func (ec *executionContext) _GetProbeReferenceResponse_totalRuns(ctx context.Con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbeReferenceResponse_totalRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbeReferenceResponse_totalRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbeReferenceResponse", Field: field, @@ -17450,7 +17738,7 @@ func (ec *executionContext) _GetProbeReferenceResponse_recentExecutions(ctx cont return ec.marshalNRecentExecutions2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐRecentExecutions(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbeReferenceResponse_recentExecutions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbeReferenceResponse_recentExecutions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbeReferenceResponse", Field: field, @@ -17502,7 +17790,7 @@ func (ec *executionContext) _GetProbesInExperimentRunResponse_probe(ctx context. return ec.marshalNProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐProbe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_probe(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_probe(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbesInExperimentRunResponse", Field: field, @@ -17580,7 +17868,7 @@ func (ec *executionContext) _GetProbesInExperimentRunResponse_mode(ctx context.C return ec.marshalNMode2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMode(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_mode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_mode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbesInExperimentRunResponse", Field: field, @@ -17624,7 +17912,7 @@ func (ec *executionContext) _GetProbesInExperimentRunResponse_status(ctx context return ec.marshalNStatus2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GetProbesInExperimentRunResponse_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GetProbesInExperimentRunResponse", Field: field, @@ -17674,7 +17962,7 @@ func (ec *executionContext) _GitConfigResponse_enabled(ctx context.Context, fiel return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17718,7 +18006,7 @@ func (ec *executionContext) _GitConfigResponse_projectID(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17759,7 +18047,7 @@ func (ec *executionContext) _GitConfigResponse_branch(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_branch(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_branch(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17800,7 +18088,7 @@ func (ec *executionContext) _GitConfigResponse_repoURL(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_repoURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_repoURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17841,7 +18129,7 @@ func (ec *executionContext) _GitConfigResponse_authType(ctx context.Context, fie return ec.marshalOAuthType2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐAuthType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_authType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_authType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17882,7 +18170,7 @@ func (ec *executionContext) _GitConfigResponse_token(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17923,7 +18211,7 @@ func (ec *executionContext) _GitConfigResponse_userName(ctx context.Context, fie return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_userName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_userName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -17964,7 +18252,7 @@ func (ec *executionContext) _GitConfigResponse_password(ctx context.Context, fie return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_password(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_password(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -18005,7 +18293,7 @@ func (ec *executionContext) _GitConfigResponse_sshPrivateKey(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_GitConfigResponse_sshPrivateKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_GitConfigResponse_sshPrivateKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "GitConfigResponse", Field: field, @@ -18046,7 +18334,7 @@ func (ec *executionContext) _ImageRegistry_isDefault(ctx context.Context, field return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_isDefault(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_isDefault(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18090,7 +18378,7 @@ func (ec *executionContext) _ImageRegistry_imageRegistryName(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_imageRegistryName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_imageRegistryName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18134,7 +18422,7 @@ func (ec *executionContext) _ImageRegistry_imageRepoName(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_imageRepoName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_imageRepoName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18178,7 +18466,7 @@ func (ec *executionContext) _ImageRegistry_imageRegistryType(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_imageRegistryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_imageRegistryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18219,7 +18507,7 @@ func (ec *executionContext) _ImageRegistry_secretName(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_secretName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_secretName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18260,7 +18548,7 @@ func (ec *executionContext) _ImageRegistry_secretNamespace(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_secretNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_secretNamespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18301,7 +18589,7 @@ func (ec *executionContext) _ImageRegistry_enableRegistry(ctx context.Context, f return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistry_enableRegistry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistry_enableRegistry(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistry", Field: field, @@ -18345,7 +18633,7 @@ func (ec *executionContext) _ImageRegistryResponse_isDefault(ctx context.Context return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_isDefault(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_isDefault(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18386,7 +18674,7 @@ func (ec *executionContext) _ImageRegistryResponse_imageRegistryInfo(ctx context return ec.marshalOImageRegistry2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐImageRegistry(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_imageRegistryInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_imageRegistryInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18446,7 +18734,7 @@ func (ec *executionContext) _ImageRegistryResponse_imageRegistryID(ctx context.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_imageRegistryID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_imageRegistryID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18490,7 +18778,7 @@ func (ec *executionContext) _ImageRegistryResponse_projectID(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18531,7 +18819,7 @@ func (ec *executionContext) _ImageRegistryResponse_updatedAt(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18572,7 +18860,7 @@ func (ec *executionContext) _ImageRegistryResponse_createdAt(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18613,7 +18901,7 @@ func (ec *executionContext) _ImageRegistryResponse_createdBy(ctx context.Context return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18662,7 +18950,7 @@ func (ec *executionContext) _ImageRegistryResponse_updatedBy(ctx context.Context return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18711,7 +18999,7 @@ func (ec *executionContext) _ImageRegistryResponse_isRemoved(ctx context.Context return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ImageRegistryResponse_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ImageRegistryResponse_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ImageRegistryResponse", Field: field, @@ -18755,7 +19043,7 @@ func (ec *executionContext) _Infra_projectID(ctx context.Context, field graphql. return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -18799,7 +19087,7 @@ func (ec *executionContext) _Infra_infraID(ctx context.Context, field graphql.Co return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -18843,7 +19131,7 @@ func (ec *executionContext) _Infra_name(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -18884,7 +19172,7 @@ func (ec *executionContext) _Infra_description(ctx context.Context, field graphq return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -18925,7 +19213,7 @@ func (ec *executionContext) _Infra_tags(ctx context.Context, field graphql.Colle return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -18969,7 +19257,7 @@ func (ec *executionContext) _Infra_environmentID(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_environmentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_environmentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19013,7 +19301,7 @@ func (ec *executionContext) _Infra_platformName(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_platformName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_platformName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19057,7 +19345,7 @@ func (ec *executionContext) _Infra_isActive(ctx context.Context, field graphql.C return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_isActive(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_isActive(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19101,7 +19389,7 @@ func (ec *executionContext) _Infra_isInfraConfirmed(ctx context.Context, field g return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_isInfraConfirmed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_isInfraConfirmed(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19145,7 +19433,7 @@ func (ec *executionContext) _Infra_isRemoved(ctx context.Context, field graphql. return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_isRemoved(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_isRemoved(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19189,7 +19477,7 @@ func (ec *executionContext) _Infra_updatedAt(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19233,7 +19521,7 @@ func (ec *executionContext) _Infra_createdAt(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19274,7 +19562,7 @@ func (ec *executionContext) _Infra_noOfExperiments(ctx context.Context, field gr return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_noOfExperiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_noOfExperiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19315,7 +19603,7 @@ func (ec *executionContext) _Infra_noOfExperimentRuns(ctx context.Context, field return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_noOfExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_noOfExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19359,7 +19647,7 @@ func (ec *executionContext) _Infra_token(ctx context.Context, field graphql.Coll return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19400,7 +19688,7 @@ func (ec *executionContext) _Infra_infraNamespace(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraNamespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19441,7 +19729,7 @@ func (ec *executionContext) _Infra_serviceAccount(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_serviceAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_serviceAccount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19485,7 +19773,7 @@ func (ec *executionContext) _Infra_infraScope(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraScope(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraScope(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19526,7 +19814,7 @@ func (ec *executionContext) _Infra_infraNsExists(ctx context.Context, field grap return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraNsExists(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraNsExists(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19567,7 +19855,7 @@ func (ec *executionContext) _Infra_infraSaExists(ctx context.Context, field grap return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraSaExists(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraSaExists(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19608,7 +19896,7 @@ func (ec *executionContext) _Infra_lastExperimentTimestamp(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_lastExperimentTimestamp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_lastExperimentTimestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19652,7 +19940,7 @@ func (ec *executionContext) _Infra_startTime(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_startTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_startTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19696,7 +19984,7 @@ func (ec *executionContext) _Infra_version(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19737,7 +20025,7 @@ func (ec *executionContext) _Infra_createdBy(ctx context.Context, field graphql. return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19786,7 +20074,7 @@ func (ec *executionContext) _Infra_updatedBy(ctx context.Context, field graphql. return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19835,7 +20123,7 @@ func (ec *executionContext) _Infra_infraType(ctx context.Context, field graphql. return ec.marshalOInfrastructureType2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfrastructureType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_infraType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_infraType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19879,7 +20167,7 @@ func (ec *executionContext) _Infra_updateStatus(ctx context.Context, field graph return ec.marshalNUpdateStatus2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUpdateStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Infra_updateStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Infra_updateStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Infra", Field: field, @@ -19923,7 +20211,7 @@ func (ec *executionContext) _InfraActionResponse_projectID(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraActionResponse_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraActionResponse_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraActionResponse", Field: field, @@ -19967,7 +20255,7 @@ func (ec *executionContext) _InfraActionResponse_action(ctx context.Context, fie return ec.marshalNActionPayload2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐActionPayload(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraActionResponse_action(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraActionResponse_action(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraActionResponse", Field: field, @@ -20025,7 +20313,7 @@ func (ec *executionContext) _InfraEventResponse_eventID(ctx context.Context, fie return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraEventResponse_eventID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraEventResponse_eventID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraEventResponse", Field: field, @@ -20069,7 +20357,7 @@ func (ec *executionContext) _InfraEventResponse_eventType(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraEventResponse_eventType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraEventResponse_eventType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraEventResponse", Field: field, @@ -20113,7 +20401,7 @@ func (ec *executionContext) _InfraEventResponse_eventName(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraEventResponse_eventName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraEventResponse_eventName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraEventResponse", Field: field, @@ -20157,7 +20445,7 @@ func (ec *executionContext) _InfraEventResponse_description(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraEventResponse_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraEventResponse_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraEventResponse", Field: field, @@ -20201,7 +20489,7 @@ func (ec *executionContext) _InfraEventResponse_infra(ctx context.Context, field return ec.marshalNInfra2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfra(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraEventResponse_infra(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraEventResponse_infra(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraEventResponse", Field: field, @@ -20301,7 +20589,7 @@ func (ec *executionContext) _InfraVersionDetails_latestVersion(ctx context.Conte return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraVersionDetails_latestVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraVersionDetails_latestVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraVersionDetails", Field: field, @@ -20345,7 +20633,7 @@ func (ec *executionContext) _InfraVersionDetails_compatibleVersions(ctx context. return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_InfraVersionDetails_compatibleVersions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_InfraVersionDetails_compatibleVersions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "InfraVersionDetails", Field: field, @@ -20389,7 +20677,7 @@ func (ec *executionContext) _K8SProbe_probeTimeout(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_probeTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_probeTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20433,7 +20721,7 @@ func (ec *executionContext) _K8SProbe_interval(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_interval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20474,7 +20762,7 @@ func (ec *executionContext) _K8SProbe_retry(ctx context.Context, field graphql.C return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_retry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_retry(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20515,7 +20803,7 @@ func (ec *executionContext) _K8SProbe_attempt(ctx context.Context, field graphql return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_attempt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_attempt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20556,7 +20844,7 @@ func (ec *executionContext) _K8SProbe_probePollingInterval(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_probePollingInterval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_probePollingInterval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20597,7 +20885,7 @@ func (ec *executionContext) _K8SProbe_initialDelay(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_initialDelay(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20638,7 +20926,7 @@ func (ec *executionContext) _K8SProbe_evaluationTimeout(ctx context.Context, fie return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_evaluationTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_evaluationTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20679,7 +20967,7 @@ func (ec *executionContext) _K8SProbe_stopOnFailure(ctx context.Context, field g return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_stopOnFailure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_stopOnFailure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20720,7 +21008,7 @@ func (ec *executionContext) _K8SProbe_group(ctx context.Context, field graphql.C return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_group(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_group(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20764,7 +21052,7 @@ func (ec *executionContext) _K8SProbe_version(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20808,7 +21096,7 @@ func (ec *executionContext) _K8SProbe_resource(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_resource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_resource(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20849,7 +21137,7 @@ func (ec *executionContext) _K8SProbe_namespace(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20890,7 +21178,7 @@ func (ec *executionContext) _K8SProbe_resourceNames(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_resourceNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_resourceNames(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20931,7 +21219,7 @@ func (ec *executionContext) _K8SProbe_fieldSelector(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_fieldSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_fieldSelector(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -20972,7 +21260,7 @@ func (ec *executionContext) _K8SProbe_labelSelector(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_labelSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_labelSelector(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -21016,7 +21304,7 @@ func (ec *executionContext) _K8SProbe_operation(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_K8SProbe_operation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_K8SProbe_operation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "K8SProbe", Field: field, @@ -21029,6 +21317,142 @@ func (ec *executionContext) fieldContext_K8SProbe_operation(ctx context.Context, return fc, nil } +func (ec *executionContext) _KubeNamespace_name(ctx context.Context, field graphql.CollectedField, obj *model.KubeNamespace) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_KubeNamespace_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_KubeNamespace_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "KubeNamespace", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _KubeNamespaceResponse_infraID(ctx context.Context, field graphql.CollectedField, obj *model.KubeNamespaceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_KubeNamespaceResponse_infraID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InfraID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_KubeNamespaceResponse_infraID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "KubeNamespaceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _KubeNamespaceResponse_kubeNamespace(ctx context.Context, field graphql.CollectedField, obj *model.KubeNamespaceResponse) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_KubeNamespaceResponse_kubeNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.KubeNamespace, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.KubeNamespace) + fc.Result = res + return ec.marshalNKubeNamespace2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespace(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_KubeNamespaceResponse_kubeNamespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "KubeNamespaceResponse", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_KubeNamespace_name(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type KubeNamespace", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _KubeObject_namespace(ctx context.Context, field graphql.CollectedField, obj *model.KubeObject) (ret graphql.Marshaler) { fc, err := ec.fieldContext_KubeObject_namespace(ctx, field) if err != nil { @@ -21060,7 +21484,7 @@ func (ec *executionContext) _KubeObject_namespace(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubeObject_namespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubeObject_namespace(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubeObject", Field: field, @@ -21104,7 +21528,7 @@ func (ec *executionContext) _KubeObject_data(ctx context.Context, field graphql. return ec.marshalNObjectData2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐObjectData(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubeObject_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubeObject_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubeObject", Field: field, @@ -21154,7 +21578,7 @@ func (ec *executionContext) _KubeObjectResponse_infraID(ctx context.Context, fie return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubeObjectResponse_infraID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubeObjectResponse_infraID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubeObjectResponse", Field: field, @@ -21193,12 +21617,12 @@ func (ec *executionContext) _KubeObjectResponse_kubeObj(ctx context.Context, fie } return graphql.Null } - res := resTmp.([]*model.KubeObject) + res := resTmp.(*model.KubeObject) fc.Result = res - return ec.marshalNKubeObject2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx, field.Selections, res) + return ec.marshalNKubeObject2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubeObjectResponse_kubeObj(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubeObjectResponse_kubeObj(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubeObjectResponse", Field: field, @@ -21248,7 +21672,7 @@ func (ec *executionContext) _KubernetesCMDProbe_probeTimeout(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_probeTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_probeTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21292,7 +21716,7 @@ func (ec *executionContext) _KubernetesCMDProbe_interval(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_interval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21333,7 +21757,7 @@ func (ec *executionContext) _KubernetesCMDProbe_retry(ctx context.Context, field return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_retry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_retry(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21374,7 +21798,7 @@ func (ec *executionContext) _KubernetesCMDProbe_attempt(ctx context.Context, fie return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_attempt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_attempt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21415,7 +21839,7 @@ func (ec *executionContext) _KubernetesCMDProbe_probePollingInterval(ctx context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_probePollingInterval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_probePollingInterval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21456,7 +21880,7 @@ func (ec *executionContext) _KubernetesCMDProbe_initialDelay(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_initialDelay(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21497,7 +21921,7 @@ func (ec *executionContext) _KubernetesCMDProbe_evaluationTimeout(ctx context.Co return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_evaluationTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_evaluationTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21538,7 +21962,7 @@ func (ec *executionContext) _KubernetesCMDProbe_stopOnFailure(ctx context.Contex return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_stopOnFailure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_stopOnFailure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21582,7 +22006,7 @@ func (ec *executionContext) _KubernetesCMDProbe_command(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_command(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_command(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21626,7 +22050,7 @@ func (ec *executionContext) _KubernetesCMDProbe_comparator(ctx context.Context, return ec.marshalNComparator2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐComparator(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_comparator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_comparator(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21675,7 +22099,7 @@ func (ec *executionContext) _KubernetesCMDProbe_source(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesCMDProbe_source(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesCMDProbe_source(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesCMDProbe", Field: field, @@ -21719,7 +22143,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_probeTimeout(ctx context.Contex return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_probeTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_probeTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21763,7 +22187,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_interval(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_interval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21804,7 +22228,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_retry(ctx context.Context, fiel return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_retry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_retry(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21845,7 +22269,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_attempt(ctx context.Context, fi return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_attempt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_attempt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21886,7 +22310,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_probePollingInterval(ctx contex return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_probePollingInterval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_probePollingInterval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21927,7 +22351,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_initialDelay(ctx context.Contex return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_initialDelay(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -21968,7 +22392,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_evaluationTimeout(ctx context.C return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_evaluationTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_evaluationTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -22009,7 +22433,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_stopOnFailure(ctx context.Conte return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_stopOnFailure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_stopOnFailure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -22053,7 +22477,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_url(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -22097,7 +22521,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_method(ctx context.Context, fie return ec.marshalNMethod2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMethod(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_method(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_method(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -22144,7 +22568,7 @@ func (ec *executionContext) _KubernetesHTTPProbe_insecureSkipVerify(ctx context. return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_KubernetesHTTPProbe_insecureSkipVerify(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_KubernetesHTTPProbe_insecureSkipVerify(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "KubernetesHTTPProbe", Field: field, @@ -22188,7 +22612,7 @@ func (ec *executionContext) _Link_name(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Link_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Link_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Link", Field: field, @@ -22232,7 +22656,7 @@ func (ec *executionContext) _Link_url(ctx context.Context, field graphql.Collect return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Link_url(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Link_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Link", Field: field, @@ -22276,7 +22700,7 @@ func (ec *executionContext) _ListEnvironmentResponse_totalNoOfEnvironments(ctx c return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListEnvironmentResponse_totalNoOfEnvironments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListEnvironmentResponse_totalNoOfEnvironments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListEnvironmentResponse", Field: field, @@ -22317,7 +22741,7 @@ func (ec *executionContext) _ListEnvironmentResponse_environments(ctx context.Co return ec.marshalOEnvironment2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListEnvironmentResponse_environments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListEnvironmentResponse_environments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListEnvironmentResponse", Field: field, @@ -22387,7 +22811,7 @@ func (ec *executionContext) _ListExperimentResponse_totalNoOfExperiments(ctx con return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListExperimentResponse_totalNoOfExperiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListExperimentResponse_totalNoOfExperiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListExperimentResponse", Field: field, @@ -22431,7 +22855,7 @@ func (ec *executionContext) _ListExperimentResponse_experiments(ctx context.Cont return ec.marshalNExperiment2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExperiment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListExperimentResponse_experiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListExperimentResponse_experiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListExperimentResponse", Field: field, @@ -22511,7 +22935,7 @@ func (ec *executionContext) _ListExperimentRunResponse_totalNoOfExperimentRuns(c return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListExperimentRunResponse_totalNoOfExperimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListExperimentRunResponse_totalNoOfExperimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListExperimentRunResponse", Field: field, @@ -22555,7 +22979,7 @@ func (ec *executionContext) _ListExperimentRunResponse_experimentRuns(ctx contex return ec.marshalNExperimentRun2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExperimentRun(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListExperimentRunResponse_experimentRuns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListExperimentRunResponse_experimentRuns(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListExperimentRunResponse", Field: field, @@ -22649,7 +23073,7 @@ func (ec *executionContext) _ListInfraResponse_totalNoOfInfras(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListInfraResponse_totalNoOfInfras(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListInfraResponse_totalNoOfInfras(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListInfraResponse", Field: field, @@ -22693,7 +23117,7 @@ func (ec *executionContext) _ListInfraResponse_infras(ctx context.Context, field return ec.marshalNInfra2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfra(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ListInfraResponse_infras(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ListInfraResponse_infras(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ListInfraResponse", Field: field, @@ -22793,7 +23217,7 @@ func (ec *executionContext) _Maintainer_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Maintainer_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Maintainer_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Maintainer", Field: field, @@ -22837,7 +23261,7 @@ func (ec *executionContext) _Maintainer_email(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Maintainer_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Maintainer_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Maintainer", Field: field, @@ -22881,7 +23305,7 @@ func (ec *executionContext) _Metadata_name(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Metadata", Field: field, @@ -22925,7 +23349,7 @@ func (ec *executionContext) _Metadata_version(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Metadata", Field: field, @@ -22969,7 +23393,7 @@ func (ec *executionContext) _Metadata_annotations(ctx context.Context, field gra return ec.marshalNAnnotation2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐAnnotation(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Metadata_annotations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_annotations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Metadata", Field: field, @@ -23024,7 +23448,7 @@ func (ec *executionContext) _Method_get(ctx context.Context, field graphql.Colle return ec.marshalOGET2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐGet(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Method_get(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Method_get(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Method", Field: field, @@ -23071,7 +23495,7 @@ func (ec *executionContext) _Method_post(ctx context.Context, field graphql.Coll return ec.marshalOPOST2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐPost(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Method_post(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Method_post(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Method", Field: field, @@ -23980,6 +24404,61 @@ func (ec *executionContext) fieldContext_Mutation_kubeObj(ctx context.Context, f return fc, nil } +func (ec *executionContext) _Mutation_kubeNamespace(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_kubeNamespace(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().KubeNamespace(rctx, fc.Args["request"].(model.KubeNamespaceData)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_kubeNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_kubeNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Mutation_addChaosHub(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_addChaosHub(ctx, field) if err != nil { @@ -24045,6 +24524,8 @@ func (ec *executionContext) fieldContext_Mutation_addChaosHub(ctx context.Contex return ec.fieldContext_ChaosHub_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHub_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHub_remoteHub(ctx, field) case "projectID": return ec.fieldContext_ChaosHub_projectID(ctx, field) case "isDefault": @@ -24164,6 +24645,8 @@ func (ec *executionContext) fieldContext_Mutation_addRemoteChaosHub(ctx context. return ec.fieldContext_ChaosHub_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHub_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHub_remoteHub(ctx, field) case "projectID": return ec.fieldContext_ChaosHub_projectID(ctx, field) case "isDefault": @@ -24283,6 +24766,8 @@ func (ec *executionContext) fieldContext_Mutation_saveChaosHub(ctx context.Conte return ec.fieldContext_ChaosHub_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHub_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHub_remoteHub(ctx, field) case "projectID": return ec.fieldContext_ChaosHub_projectID(ctx, field) case "isDefault": @@ -24463,7 +24948,7 @@ func (ec *executionContext) _Mutation_generateSSHKey(ctx context.Context, field return ec.marshalNSSHKey2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐSSHKey(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_generateSSHKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_generateSSHKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -24547,6 +25032,8 @@ func (ec *executionContext) fieldContext_Mutation_updateChaosHub(ctx context.Con return ec.fieldContext_ChaosHub_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHub_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHub_remoteHub(ctx, field) case "projectID": return ec.fieldContext_ChaosHub_projectID(ctx, field) case "isDefault": @@ -25756,7 +26243,7 @@ func (ec *executionContext) _ObjectData_labels(ctx context.Context, field graphq return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ObjectData_labels(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ObjectData_labels(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ObjectData", Field: field, @@ -25800,7 +26287,7 @@ func (ec *executionContext) _ObjectData_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ObjectData_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ObjectData_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ObjectData", Field: field, @@ -25841,7 +26328,7 @@ func (ec *executionContext) _POST_contentType(ctx context.Context, field graphql return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_POST_contentType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_POST_contentType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "POST", Field: field, @@ -25882,7 +26369,7 @@ func (ec *executionContext) _POST_body(ctx context.Context, field graphql.Collec return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_POST_body(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_POST_body(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "POST", Field: field, @@ -25923,7 +26410,7 @@ func (ec *executionContext) _POST_bodyPath(ctx context.Context, field graphql.Co return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_POST_bodyPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_POST_bodyPath(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "POST", Field: field, @@ -25967,7 +26454,7 @@ func (ec *executionContext) _POST_criteria(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_POST_criteria(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_POST_criteria(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "POST", Field: field, @@ -26011,7 +26498,7 @@ func (ec *executionContext) _POST_responseCode(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_POST_responseCode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_POST_responseCode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "POST", Field: field, @@ -26055,7 +26542,7 @@ func (ec *executionContext) _PROMProbe_probeTimeout(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_probeTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_probeTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26099,7 +26586,7 @@ func (ec *executionContext) _PROMProbe_interval(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_interval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_interval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26140,7 +26627,7 @@ func (ec *executionContext) _PROMProbe_retry(ctx context.Context, field graphql. return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_retry(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_retry(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26181,7 +26668,7 @@ func (ec *executionContext) _PROMProbe_attempt(ctx context.Context, field graphq return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_attempt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_attempt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26222,7 +26709,7 @@ func (ec *executionContext) _PROMProbe_probePollingInterval(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_probePollingInterval(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_probePollingInterval(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26263,7 +26750,7 @@ func (ec *executionContext) _PROMProbe_initialDelay(ctx context.Context, field g return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_initialDelay(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_initialDelay(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26304,7 +26791,7 @@ func (ec *executionContext) _PROMProbe_evaluationTimeout(ctx context.Context, fi return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_evaluationTimeout(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_evaluationTimeout(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26345,7 +26832,7 @@ func (ec *executionContext) _PROMProbe_stopOnFailure(ctx context.Context, field return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_stopOnFailure(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_stopOnFailure(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26389,7 +26876,7 @@ func (ec *executionContext) _PROMProbe_endpoint(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_endpoint(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_endpoint(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26430,7 +26917,7 @@ func (ec *executionContext) _PROMProbe_query(ctx context.Context, field graphql. return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_query(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_query(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26471,7 +26958,7 @@ func (ec *executionContext) _PROMProbe_queryPath(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_queryPath(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_queryPath(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26515,7 +27002,7 @@ func (ec *executionContext) _PROMProbe_comparator(ctx context.Context, field gra return ec.marshalNComparator2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐComparator(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PROMProbe_comparator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PROMProbe_comparator(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PROMProbe", Field: field, @@ -26567,7 +27054,7 @@ func (ec *executionContext) _PackageInformation_packageName(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PackageInformation_packageName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PackageInformation_packageName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PackageInformation", Field: field, @@ -26611,7 +27098,7 @@ func (ec *executionContext) _PackageInformation_experiments(ctx context.Context, return ec.marshalNExperiments2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExperimentsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PackageInformation_experiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PackageInformation_experiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PackageInformation", Field: field, @@ -26663,7 +27150,7 @@ func (ec *executionContext) _PodLogResponse_experimentRunID(ctx context.Context, return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PodLogResponse_experimentRunID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PodLogResponse_experimentRunID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PodLogResponse", Field: field, @@ -26707,7 +27194,7 @@ func (ec *executionContext) _PodLogResponse_podName(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PodLogResponse_podName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PodLogResponse_podName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PodLogResponse", Field: field, @@ -26751,7 +27238,7 @@ func (ec *executionContext) _PodLogResponse_podType(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PodLogResponse_podType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PodLogResponse_podType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PodLogResponse", Field: field, @@ -26795,7 +27282,7 @@ func (ec *executionContext) _PodLogResponse_log(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PodLogResponse_log(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PodLogResponse_log(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PodLogResponse", Field: field, @@ -26839,7 +27326,7 @@ func (ec *executionContext) _PredefinedExperimentList_experimentName(ctx context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PredefinedExperimentList", Field: field, @@ -26883,7 +27370,7 @@ func (ec *executionContext) _PredefinedExperimentList_experimentCSV(ctx context. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentCSV(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentCSV(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PredefinedExperimentList", Field: field, @@ -26927,7 +27414,7 @@ func (ec *executionContext) _PredefinedExperimentList_experimentManifest(ctx con return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentManifest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PredefinedExperimentList_experimentManifest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "PredefinedExperimentList", Field: field, @@ -26971,7 +27458,7 @@ func (ec *executionContext) _Probe_projectID(ctx context.Context, field graphql. return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27015,7 +27502,7 @@ func (ec *executionContext) _Probe_name(ctx context.Context, field graphql.Colle return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27056,7 +27543,7 @@ func (ec *executionContext) _Probe_description(ctx context.Context, field graphq return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27097,7 +27584,7 @@ func (ec *executionContext) _Probe_tags(ctx context.Context, field graphql.Colle return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_tags(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27141,7 +27628,7 @@ func (ec *executionContext) _Probe_type(ctx context.Context, field graphql.Colle return ec.marshalNProbeType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐProbeType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27185,7 +27672,7 @@ func (ec *executionContext) _Probe_infrastructureType(ctx context.Context, field return ec.marshalNInfrastructureType2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfrastructureType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_infrastructureType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_infrastructureType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27226,7 +27713,7 @@ func (ec *executionContext) _Probe_kubernetesHTTPProperties(ctx context.Context, return ec.marshalOKubernetesHTTPProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubernetesHTTPProbe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_kubernetesHTTPProperties(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_kubernetesHTTPProperties(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27291,7 +27778,7 @@ func (ec *executionContext) _Probe_kubernetesCMDProperties(ctx context.Context, return ec.marshalOKubernetesCMDProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubernetesCMDProbe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_kubernetesCMDProperties(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_kubernetesCMDProperties(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27356,7 +27843,7 @@ func (ec *executionContext) _Probe_k8sProperties(ctx context.Context, field grap return ec.marshalOK8SProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐK8SProbe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_k8sProperties(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_k8sProperties(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27431,7 +27918,7 @@ func (ec *executionContext) _Probe_promProperties(ctx context.Context, field gra return ec.marshalOPROMProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐPROMProbe(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_promProperties(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_promProperties(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27498,7 +27985,7 @@ func (ec *executionContext) _Probe_recentExecutions(ctx context.Context, field g return ec.marshalOProbeRecentExecutions2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐProbeRecentExecutionsᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_recentExecutions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_recentExecutions(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27547,7 +28034,7 @@ func (ec *executionContext) _Probe_referencedBy(ctx context.Context, field graph return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_referencedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_referencedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27591,7 +28078,7 @@ func (ec *executionContext) _Probe_updatedAt(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27635,7 +28122,7 @@ func (ec *executionContext) _Probe_createdAt(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27676,7 +28163,7 @@ func (ec *executionContext) _Probe_updatedBy(ctx context.Context, field graphql. return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27725,7 +28212,7 @@ func (ec *executionContext) _Probe_createdBy(ctx context.Context, field graphql. return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Probe_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Probe_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Probe", Field: field, @@ -27777,7 +28264,7 @@ func (ec *executionContext) _ProbeRecentExecutions_faultName(ctx context.Context return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProbeRecentExecutions_faultName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ProbeRecentExecutions_faultName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ProbeRecentExecutions", Field: field, @@ -27821,7 +28308,7 @@ func (ec *executionContext) _ProbeRecentExecutions_status(ctx context.Context, f return ec.marshalNStatus2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProbeRecentExecutions_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ProbeRecentExecutions_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ProbeRecentExecutions", Field: field, @@ -27871,7 +28358,7 @@ func (ec *executionContext) _ProbeRecentExecutions_executedByExperiment(ctx cont return ec.marshalNExecutedByExperiment2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExecutedByExperiment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ProbeRecentExecutions_executedByExperiment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ProbeRecentExecutions_executedByExperiment(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ProbeRecentExecutions", Field: field, @@ -27925,7 +28412,7 @@ func (ec *executionContext) _Provider_name(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Provider_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Provider_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Provider", Field: field, @@ -28973,7 +29460,7 @@ func (ec *executionContext) _Query_getServerVersion(ctx context.Context, field g return ec.marshalNServerVersionResponse2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐServerVersionResponse(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_getServerVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_getServerVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -29227,6 +29714,8 @@ func (ec *executionContext) fieldContext_Query_listChaosHub(ctx context.Context, return ec.fieldContext_ChaosHubStatus_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHubStatus_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHubStatus_remoteHub(ctx, field) case "isAvailable": return ec.fieldContext_ChaosHubStatus_isAvailable(ctx, field) case "totalFaults": @@ -29352,6 +29841,8 @@ func (ec *executionContext) fieldContext_Query_getChaosHub(ctx context.Context, return ec.fieldContext_ChaosHubStatus_repoURL(ctx, field) case "repoBranch": return ec.fieldContext_ChaosHubStatus_repoBranch(ctx, field) + case "remoteHub": + return ec.fieldContext_ChaosHubStatus_remoteHub(ctx, field) case "isAvailable": return ec.fieldContext_ChaosHubStatus_isAvailable(ctx, field) case "totalFaults": @@ -30753,7 +31244,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -30811,7 +31302,7 @@ func (ec *executionContext) _RecentExecutions_faultName(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExecutions_faultName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExecutions_faultName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExecutions", Field: field, @@ -30855,7 +31346,7 @@ func (ec *executionContext) _RecentExecutions_mode(ctx context.Context, field gr return ec.marshalNMode2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMode(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExecutions_mode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExecutions_mode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExecutions", Field: field, @@ -30899,7 +31390,7 @@ func (ec *executionContext) _RecentExecutions_executionHistory(ctx context.Conte return ec.marshalNExecutionHistory2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐExecutionHistoryᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExecutions_executionHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExecutions_executionHistory(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExecutions", Field: field, @@ -30953,7 +31444,7 @@ func (ec *executionContext) _RecentExperimentRun_experimentRunID(ctx context.Con return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_experimentRunID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_experimentRunID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -30997,7 +31488,7 @@ func (ec *executionContext) _RecentExperimentRun_phase(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_phase(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_phase(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31038,7 +31529,7 @@ func (ec *executionContext) _RecentExperimentRun_resiliencyScore(ctx context.Con return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_resiliencyScore(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_resiliencyScore(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31082,7 +31573,7 @@ func (ec *executionContext) _RecentExperimentRun_updatedAt(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_updatedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31126,7 +31617,7 @@ func (ec *executionContext) _RecentExperimentRun_createdAt(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_createdAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31167,7 +31658,7 @@ func (ec *executionContext) _RecentExperimentRun_createdBy(ctx context.Context, return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31216,7 +31707,7 @@ func (ec *executionContext) _RecentExperimentRun_updatedBy(ctx context.Context, return ec.marshalOUserDetails2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐUserDetails(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_updatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_updatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31268,7 +31759,7 @@ func (ec *executionContext) _RecentExperimentRun_runSequence(ctx context.Context return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RecentExperimentRun_runSequence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RecentExperimentRun_runSequence(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RecentExperimentRun", Field: field, @@ -31312,7 +31803,7 @@ func (ec *executionContext) _RegisterInfraResponse_token(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegisterInfraResponse_token(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegisterInfraResponse_token(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RegisterInfraResponse", Field: field, @@ -31356,7 +31847,7 @@ func (ec *executionContext) _RegisterInfraResponse_infraID(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegisterInfraResponse_infraID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegisterInfraResponse_infraID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RegisterInfraResponse", Field: field, @@ -31400,7 +31891,7 @@ func (ec *executionContext) _RegisterInfraResponse_name(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegisterInfraResponse_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegisterInfraResponse_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RegisterInfraResponse", Field: field, @@ -31444,7 +31935,7 @@ func (ec *executionContext) _RegisterInfraResponse_manifest(ctx context.Context, return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RegisterInfraResponse_manifest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegisterInfraResponse_manifest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RegisterInfraResponse", Field: field, @@ -31488,7 +31979,7 @@ func (ec *executionContext) _ResilienceScoreCategory_id(ctx context.Context, fie return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ResilienceScoreCategory_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResilienceScoreCategory_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ResilienceScoreCategory", Field: field, @@ -31532,7 +32023,7 @@ func (ec *executionContext) _ResilienceScoreCategory_count(ctx context.Context, return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ResilienceScoreCategory_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ResilienceScoreCategory_count(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ResilienceScoreCategory", Field: field, @@ -31576,7 +32067,7 @@ func (ec *executionContext) _RunChaosExperimentResponse_notifyID(ctx context.Con return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RunChaosExperimentResponse_notifyID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RunChaosExperimentResponse_notifyID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "RunChaosExperimentResponse", Field: field, @@ -31620,7 +32111,7 @@ func (ec *executionContext) _SSHKey_publicKey(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SSHKey_publicKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SSHKey_publicKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SSHKey", Field: field, @@ -31664,7 +32155,7 @@ func (ec *executionContext) _SSHKey_privateKey(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SSHKey_privateKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SSHKey_privateKey(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "SSHKey", Field: field, @@ -31708,7 +32199,7 @@ func (ec *executionContext) _ServerVersionResponse_key(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ServerVersionResponse_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ServerVersionResponse_key(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ServerVersionResponse", Field: field, @@ -31752,7 +32243,7 @@ func (ec *executionContext) _ServerVersionResponse_value(ctx context.Context, fi return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ServerVersionResponse_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ServerVersionResponse_value(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ServerVersionResponse", Field: field, @@ -31796,7 +32287,7 @@ func (ec *executionContext) _Spec_displayName(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -31840,7 +32331,7 @@ func (ec *executionContext) _Spec_categoryDescription(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_categoryDescription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_categoryDescription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -31884,7 +32375,7 @@ func (ec *executionContext) _Spec_keywords(ctx context.Context, field graphql.Co return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_keywords(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -31928,7 +32419,7 @@ func (ec *executionContext) _Spec_maturity(ctx context.Context, field graphql.Co return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_maturity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_maturity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -31972,7 +32463,7 @@ func (ec *executionContext) _Spec_maintainers(ctx context.Context, field graphql return ec.marshalNMaintainer2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐMaintainerᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_maintainers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_maintainers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32022,7 +32513,7 @@ func (ec *executionContext) _Spec_minKubeVersion(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_minKubeVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_minKubeVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32066,7 +32557,7 @@ func (ec *executionContext) _Spec_provider(ctx context.Context, field graphql.Co return ec.marshalNProvider2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐProvider(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_provider(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_provider(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32114,7 +32605,7 @@ func (ec *executionContext) _Spec_links(ctx context.Context, field graphql.Colle return ec.marshalNLink2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐLinkᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_links(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_links(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32164,7 +32655,7 @@ func (ec *executionContext) _Spec_faults(ctx context.Context, field graphql.Coll return ec.marshalNFaultList2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐFaultListᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_faults(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_faults(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32215,7 +32706,7 @@ func (ec *executionContext) _Spec_experiments(ctx context.Context, field graphql return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_experiments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_experiments(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32259,7 +32750,7 @@ func (ec *executionContext) _Spec_chaosExpCRDLink(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_chaosExpCRDLink(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_chaosExpCRDLink(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32303,7 +32794,7 @@ func (ec *executionContext) _Spec_platforms(ctx context.Context, field graphql.C return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_platforms(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_platforms(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32344,7 +32835,7 @@ func (ec *executionContext) _Spec_chaosType(ctx context.Context, field graphql.C return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Spec_chaosType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Spec_chaosType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Spec", Field: field, @@ -32388,7 +32879,7 @@ func (ec *executionContext) _Status_verdict(ctx context.Context, field graphql.C return ec.marshalNProbeVerdict2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐProbeVerdict(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_verdict(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Status_verdict(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Status", Field: field, @@ -32429,7 +32920,7 @@ func (ec *executionContext) _Status_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Status_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Status_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Status", Field: field, @@ -32473,7 +32964,7 @@ func (ec *executionContext) _StopExperimentRunsRequest_projectID(ctx context.Con return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StopExperimentRunsRequest_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StopExperimentRunsRequest_projectID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "StopExperimentRunsRequest", Field: field, @@ -32517,7 +33008,7 @@ func (ec *executionContext) _StopExperimentRunsRequest_experimentID(ctx context. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StopExperimentRunsRequest_experimentID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StopExperimentRunsRequest_experimentID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "StopExperimentRunsRequest", Field: field, @@ -32558,7 +33049,7 @@ func (ec *executionContext) _StopExperimentRunsRequest_experimentRunID(ctx conte return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_StopExperimentRunsRequest_experimentRunID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_StopExperimentRunsRequest_experimentRunID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "StopExperimentRunsRequest", Field: field, @@ -32901,6 +33392,81 @@ func (ec *executionContext) fieldContext_Subscription_getKubeObject(ctx context. return fc, nil } +func (ec *executionContext) _Subscription_getKubeNamespace(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { + fc, err := ec.fieldContext_Subscription_getKubeNamespace(ctx, field) + if err != nil { + return nil + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().GetKubeNamespace(rctx, fc.Args["request"].(model.KubeNamespaceRequest)) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return nil + } + return func(ctx context.Context) graphql.Marshaler { + select { + case res, ok := <-resTmp.(<-chan *model.KubeNamespaceResponse): + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalNKubeNamespaceResponse2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceResponse(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + case <-ctx.Done(): + return nil + } + } +} + +func (ec *executionContext) fieldContext_Subscription_getKubeNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Subscription", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "infraID": + return ec.fieldContext_KubeNamespaceResponse_infraID(ctx, field) + case "kubeNamespace": + return ec.fieldContext_KubeNamespaceResponse_kubeNamespace(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type KubeNamespaceResponse", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Subscription_getKubeNamespace_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _UserDetails_userID(ctx context.Context, field graphql.CollectedField, obj *model.UserDetails) (ret graphql.Marshaler) { fc, err := ec.fieldContext_UserDetails_userID(ctx, field) if err != nil { @@ -32932,7 +33498,7 @@ func (ec *executionContext) _UserDetails_userID(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserDetails_userID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserDetails_userID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "UserDetails", Field: field, @@ -32976,7 +33542,7 @@ func (ec *executionContext) _UserDetails_username(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserDetails_username(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserDetails_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "UserDetails", Field: field, @@ -33020,7 +33586,7 @@ func (ec *executionContext) _UserDetails_email(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_UserDetails_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UserDetails_email(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "UserDetails", Field: field, @@ -33064,7 +33630,7 @@ func (ec *executionContext) _Weightages_faultName(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Weightages_faultName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Weightages_faultName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Weightages", Field: field, @@ -33108,7 +33674,7 @@ func (ec *executionContext) _Weightages_weightage(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Weightages_weightage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Weightages_weightage(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Weightages", Field: field, @@ -33152,7 +33718,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -33193,7 +33759,7 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -33237,7 +33803,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -33281,7 +33847,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -33335,7 +33901,7 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Directive", Field: field, @@ -33379,7 +33945,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -33420,7 +33986,7 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -33464,7 +34030,7 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -33505,7 +34071,7 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__EnumValue", Field: field, @@ -33549,7 +34115,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33590,7 +34156,7 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33634,7 +34200,7 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33688,7 +34254,7 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33754,7 +34320,7 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33795,7 +34361,7 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Field", Field: field, @@ -33839,7 +34405,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -33880,7 +34446,7 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -33924,7 +34490,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -33987,7 +34553,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__InputValue", Field: field, @@ -34028,7 +34594,7 @@ func (ec *executionContext) ___Schema_description(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34072,7 +34638,7 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34138,7 +34704,7 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34201,7 +34767,7 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34264,7 +34830,7 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34330,7 +34896,7 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Schema", Field: field, @@ -34386,7 +34952,7 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34427,7 +34993,7 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34468,7 +35034,7 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34575,7 +35141,7 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34638,7 +35204,7 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34763,7 +35329,7 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34814,7 +35380,7 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -34877,7 +35443,7 @@ func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field gr return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "__Type", Field: field, @@ -35136,7 +35702,7 @@ func (ec *executionContext) unmarshalInputCloningInput(ctx context.Context, obj asMap[k] = v } - fieldsInOrder := [...]string{"name", "repoBranch", "repoURL", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "isDefault"} + fieldsInOrder := [...]string{"name", "repoBranch", "repoURL", "remoteHub", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "isDefault"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -35164,6 +35730,13 @@ func (ec *executionContext) unmarshalInputCloningInput(ctx context.Context, obj return it, err } it.RepoURL = data + case "remoteHub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("remoteHub")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RemoteHub = data case "isPrivate": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isPrivate")) data, err := ec.unmarshalNBoolean2bool(ctx, v) @@ -35267,7 +35840,7 @@ func (ec *executionContext) unmarshalInputCreateChaosHubRequest(ctx context.Cont asMap[k] = v } - fieldsInOrder := [...]string{"name", "tags", "description", "repoURL", "repoBranch", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "sshPublicKey"} + fieldsInOrder := [...]string{"name", "tags", "description", "repoURL", "repoBranch", "remoteHub", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "sshPublicKey"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -35309,6 +35882,13 @@ func (ec *executionContext) unmarshalInputCreateChaosHubRequest(ctx context.Cont return it, err } it.RepoBranch = data + case "remoteHub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("remoteHub")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RemoteHub = data case "isPrivate": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isPrivate")) data, err := ec.unmarshalNBoolean2bool(ctx, v) @@ -35426,7 +36006,7 @@ func (ec *executionContext) unmarshalInputCreateRemoteChaosHub(ctx context.Conte asMap[k] = v } - fieldsInOrder := [...]string{"name", "tags", "description", "repoURL"} + fieldsInOrder := [...]string{"name", "tags", "description", "repoURL", "remoteHub"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -35461,6 +36041,13 @@ func (ec *executionContext) unmarshalInputCreateRemoteChaosHub(ctx context.Conte return it, err } it.RepoURL = data + case "remoteHub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("remoteHub")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RemoteHub = data } } @@ -36520,6 +37107,74 @@ func (ec *executionContext) unmarshalInputKubeGVRRequest(ctx context.Context, ob return it, nil } +func (ec *executionContext) unmarshalInputKubeNamespaceData(ctx context.Context, obj interface{}) (model.KubeNamespaceData, error) { + var it model.KubeNamespaceData + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"requestID", "infraID", "kubeNamespace"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "requestID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("requestID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.RequestID = data + case "infraID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infraID")) + data, err := ec.unmarshalNInfraIdentity2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐInfraIdentity(ctx, v) + if err != nil { + return it, err + } + it.InfraID = data + case "kubeNamespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kubeNamespace")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.KubeNamespace = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputKubeNamespaceRequest(ctx context.Context, obj interface{}) (model.KubeNamespaceRequest, error) { + var it model.KubeNamespaceRequest + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"infraID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "infraID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infraID")) + data, err := ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + it.InfraID = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputKubeObjectData(ctx context.Context, obj interface{}) (model.KubeObjectData, error) { var it model.KubeObjectData asMap := map[string]interface{}{} @@ -36568,7 +37223,7 @@ func (ec *executionContext) unmarshalInputKubeObjectRequest(ctx context.Context, asMap[k] = v } - fieldsInOrder := [...]string{"infraID", "kubeObjRequest", "objectType", "workloads"} + fieldsInOrder := [...]string{"infraID", "kubeObjRequest", "namespace", "objectType", "workloads"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -36589,6 +37244,13 @@ func (ec *executionContext) unmarshalInputKubeObjectRequest(ctx context.Context, return it, err } it.KubeObjRequest = data + case "namespace": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("namespace")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Namespace = data case "objectType": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("objectType")) data, err := ec.unmarshalNString2string(ctx, v) @@ -37822,7 +38484,7 @@ func (ec *executionContext) unmarshalInputUpdateChaosHubRequest(ctx context.Cont asMap[k] = v } - fieldsInOrder := [...]string{"id", "name", "description", "tags", "repoURL", "repoBranch", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "sshPublicKey"} + fieldsInOrder := [...]string{"id", "name", "description", "tags", "repoURL", "repoBranch", "remoteHub", "isPrivate", "authType", "token", "userName", "password", "sshPrivateKey", "sshPublicKey"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -37871,6 +38533,13 @@ func (ec *executionContext) unmarshalInputUpdateChaosHubRequest(ctx context.Cont return it, err } it.RepoBranch = data + case "remoteHub": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("remoteHub")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RemoteHub = data case "isPrivate": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isPrivate")) data, err := ec.unmarshalNBoolean2bool(ctx, v) @@ -38438,6 +39107,11 @@ func (ec *executionContext) _ChaosHub(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { out.Invalids++ } + case "remoteHub": + out.Values[i] = ec._ChaosHub_remoteHub(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "projectID": out.Values[i] = ec._ChaosHub_projectID(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -38553,6 +39227,11 @@ func (ec *executionContext) _ChaosHubStatus(ctx context.Context, sel ast.Selecti if out.Values[i] == graphql.Null { out.Invalids++ } + case "remoteHub": + out.Values[i] = ec._ChaosHubStatus_remoteHub(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "isAvailable": out.Values[i] = ec._ChaosHubStatus_isAvailable(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -40329,6 +41008,89 @@ func (ec *executionContext) _K8SProbe(ctx context.Context, sel ast.SelectionSet, return out } +var kubeNamespaceImplementors = []string{"KubeNamespace"} + +func (ec *executionContext) _KubeNamespace(ctx context.Context, sel ast.SelectionSet, obj *model.KubeNamespace) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, kubeNamespaceImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("KubeNamespace") + case "name": + out.Values[i] = ec._KubeNamespace_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var kubeNamespaceResponseImplementors = []string{"KubeNamespaceResponse"} + +func (ec *executionContext) _KubeNamespaceResponse(ctx context.Context, sel ast.SelectionSet, obj *model.KubeNamespaceResponse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, kubeNamespaceResponseImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("KubeNamespaceResponse") + case "infraID": + out.Values[i] = ec._KubeNamespaceResponse_infraID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kubeNamespace": + out.Values[i] = ec._KubeNamespaceResponse_kubeNamespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var kubeObjectImplementors = []string{"KubeObject"} func (ec *executionContext) _KubeObject(ctx context.Context, sel ast.SelectionSet, obj *model.KubeObject) graphql.Marshaler { @@ -41018,6 +41780,13 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } + case "kubeNamespace": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_kubeNamespace(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "addChaosHub": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addChaosHub(ctx, field) @@ -42120,7 +42889,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "getEnvironment": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -42139,7 +42908,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "listEnvironments": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -42180,7 +42949,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "listImageRegistry": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -42921,6 +43690,8 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selection return ec._Subscription_getPodLog(ctx, fields[0]) case "getKubeObject": return ec._Subscription_getKubeObject(ctx, fields[0]) + case "getKubeNamespace": + return ec._Subscription_getKubeNamespace(ctx, fields[0]) default: panic("unknown field " + strconv.Quote(fields[0].Name)) } @@ -44223,7 +44994,7 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) marshalNKubeObject2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx context.Context, sel ast.SelectionSet, v []*model.KubeObject) graphql.Marshaler { +func (ec *executionContext) marshalNKubeNamespace2ᚕᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespace(ctx context.Context, sel ast.SelectionSet, v []*model.KubeNamespace) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -44247,7 +45018,7 @@ func (ec *executionContext) marshalNKubeObject2ᚕᚖgithubᚗcomᚋlitmuschaos if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOKubeObject2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx, sel, v[i]) + ret[i] = ec.marshalOKubeNamespace2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespace(ctx, sel, v[i]) } if isLen1 { f(i) @@ -44261,6 +45032,40 @@ func (ec *executionContext) marshalNKubeObject2ᚕᚖgithubᚗcomᚋlitmuschaos return ret } +func (ec *executionContext) unmarshalNKubeNamespaceData2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceData(ctx context.Context, v interface{}) (model.KubeNamespaceData, error) { + res, err := ec.unmarshalInputKubeNamespaceData(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNKubeNamespaceRequest2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceRequest(ctx context.Context, v interface{}) (model.KubeNamespaceRequest, error) { + res, err := ec.unmarshalInputKubeNamespaceRequest(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNKubeNamespaceResponse2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceResponse(ctx context.Context, sel ast.SelectionSet, v model.KubeNamespaceResponse) graphql.Marshaler { + return ec._KubeNamespaceResponse(ctx, sel, &v) +} + +func (ec *executionContext) marshalNKubeNamespaceResponse2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespaceResponse(ctx context.Context, sel ast.SelectionSet, v *model.KubeNamespaceResponse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._KubeNamespaceResponse(ctx, sel, v) +} + +func (ec *executionContext) marshalNKubeObject2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx context.Context, sel ast.SelectionSet, v *model.KubeObject) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._KubeObject(ctx, sel, v) +} + func (ec *executionContext) unmarshalNKubeObjectData2githubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObjectData(ctx context.Context, v interface{}) (model.KubeObjectData, error) { res, err := ec.unmarshalInputKubeObjectData(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -45812,11 +46617,11 @@ func (ec *executionContext) unmarshalOKubeGVRRequest2ᚖgithubᚗcomᚋlitmuscha return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOKubeObject2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeObject(ctx context.Context, sel ast.SelectionSet, v *model.KubeObject) graphql.Marshaler { +func (ec *executionContext) marshalOKubeNamespace2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubeNamespace(ctx context.Context, sel ast.SelectionSet, v *model.KubeNamespace) graphql.Marshaler { if v == nil { return graphql.Null } - return ec._KubeObject(ctx, sel, v) + return ec._KubeNamespace(ctx, sel, v) } func (ec *executionContext) marshalOKubernetesCMDProbe2ᚖgithubᚗcomᚋlitmuschaosᚋlitmusᚋchaoscenterᚋgraphqlᚋserverᚋgraphᚋmodelᚐKubernetesCMDProbe(ctx context.Context, sel ast.SelectionSet, v *model.KubernetesCMDProbe) graphql.Marshaler { diff --git a/chaoscenter/graphql/server/graph/gitops.resolvers.go b/chaoscenter/graphql/server/graph/gitops.resolvers.go index b6f1b19547f..d068e5ed7ef 100644 --- a/chaoscenter/graphql/server/graph/gitops.resolvers.go +++ b/chaoscenter/graphql/server/graph/gitops.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/graph/image_registry.resolvers.go b/chaoscenter/graphql/server/graph/image_registry.resolvers.go index aa85df1385b..2bc58bebadf 100644 --- a/chaoscenter/graphql/server/graph/image_registry.resolvers.go +++ b/chaoscenter/graphql/server/graph/image_registry.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/graph/model/models_gen.go b/chaoscenter/graphql/server/graph/model/models_gen.go index b4173ea00b2..9734945dfb1 100644 --- a/chaoscenter/graphql/server/graph/model/models_gen.go +++ b/chaoscenter/graphql/server/graph/model/models_gen.go @@ -138,6 +138,8 @@ type ChaosHub struct { RepoURL string `json:"repoURL"` // Branch of the git repository RepoBranch string `json:"repoBranch"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` // ID of the project in which the chaos hub is present ProjectID string `json:"projectID"` // Default Hub Identifier @@ -213,6 +215,8 @@ type ChaosHubStatus struct { RepoURL string `json:"repoURL"` // Branch of the git repository RepoBranch string `json:"repoBranch"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` // Bool value indicating whether the hub is available or not. IsAvailable bool `json:"isAvailable"` // Total number of experiments in the hub @@ -292,6 +296,8 @@ type CloningInput struct { RepoBranch string `json:"repoBranch"` // URL of the git repository RepoURL string `json:"repoURL"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` // Bool value indicating whether the hub is private or not. IsPrivate bool `json:"isPrivate"` // Type of authentication used: BASIC, SSH, TOKEN @@ -344,6 +350,8 @@ type CreateChaosHubRequest struct { RepoURL string `json:"repoURL"` // Branch of the git repository RepoBranch string `json:"repoBranch"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` // Bool value indicating whether the hub is private or not. IsPrivate bool `json:"isPrivate"` // Type of authentication used: BASIC, SSH, TOKEN @@ -377,6 +385,8 @@ type CreateRemoteChaosHub struct { Description *string `json:"description,omitempty"` // URL of the git repository RepoURL string `json:"repoURL"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` } // Defines the start date and end date for the filtering the data @@ -1149,7 +1159,37 @@ type KubeGVRRequest struct { Resource string `json:"resource"` } -// KubeObject consists of the namespace and the available resources in the same +// Define name in the infra (not really useful at the moment but maybe we will need other field later) +type KubeNamespace struct { + // Name of the namespace + Name string `json:"name"` +} + +// Defines the details of Kubernetes namespace +type KubeNamespaceData struct { + // Unique request ID for fetching Kubernetes namespace details + RequestID string `json:"requestID"` + // ID of the infra in which the Kubernetes namespace is present + InfraID *InfraIdentity `json:"infraID"` + // List of KubeNamespace return by subscriber + KubeNamespace string `json:"kubeNamespace"` +} + +// Defines details for fetching Kubernetes namespace data +type KubeNamespaceRequest struct { + // ID of the infra + InfraID string `json:"infraID"` +} + +// Response received for querying Kubernetes Namespaces +type KubeNamespaceResponse struct { + // ID of the infra in which the Kubernetes namespace is present + InfraID string `json:"infraID"` + // List of the Kubernetes namespace + KubeNamespace []*KubeNamespace `json:"kubeNamespace"` +} + +// KubeObject consists of the available resources in a namespace type KubeObject struct { // Namespace of the resource Namespace string `json:"namespace"` @@ -1173,8 +1213,10 @@ type KubeObjectRequest struct { InfraID string `json:"infraID"` // GVR Request KubeObjRequest *KubeGVRRequest `json:"kubeObjRequest,omitempty"` - ObjectType string `json:"objectType"` - Workloads []*Workload `json:"workloads,omitempty"` + // Namespace in which the Kubernetes object is present + Namespace string `json:"namespace"` + ObjectType string `json:"objectType"` + Workloads []*Workload `json:"workloads,omitempty"` } // Response received for querying Kubernetes Object @@ -1182,7 +1224,7 @@ type KubeObjectResponse struct { // ID of the infra in which the Kubernetes object is present InfraID string `json:"infraID"` // Type of the Kubernetes object - KubeObj []*KubeObject `json:"kubeObj"` + KubeObj *KubeObject `json:"kubeObj"` } // Defines the CMD probe properties @@ -1945,6 +1987,8 @@ type UpdateChaosHubRequest struct { RepoURL string `json:"repoURL"` // Branch of the git repository RepoBranch string `json:"repoBranch"` + // Connected Hub of remote repository + RemoteHub string `json:"remoteHub"` // Bool value indicating whether the hub is private or not. IsPrivate bool `json:"isPrivate"` // Type of authentication used: BASIC, SSH, TOKEN diff --git a/chaoscenter/graphql/server/graph/probe.resolvers.go b/chaoscenter/graphql/server/graph/probe.resolvers.go index 71b7291e024..46636fb2834 100644 --- a/chaoscenter/graphql/server/graph/probe.resolvers.go +++ b/chaoscenter/graphql/server/graph/probe.resolvers.go @@ -2,7 +2,7 @@ package graph // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.42 +// Code generated by github.com/99designs/gqlgen version v0.17.49 import ( "context" diff --git a/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go b/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go index c2ff92baa35..ee51be6d05f 100644 --- a/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go +++ b/chaoscenter/graphql/server/pkg/chaos_experiment/handler/handler.go @@ -1234,7 +1234,33 @@ func (c *ChaosExperimentHandler) GetKubeObjData(reqID string, kubeObject model.K } else if reqChan, ok := r.KubeObjectData[reqID]; ok { resp := model.KubeObjectResponse{ InfraID: kubeObject.InfraID, - KubeObj: []*model.KubeObject{}, + KubeObj: &model.KubeObject{}, + } + reqChan <- &resp + close(reqChan) + } +} + +func (c *ChaosExperimentHandler) GetKubeNamespaceData(reqID string, kubeNamespace model.KubeNamespaceRequest, r store.StateData) { + reqType := "namespace" + data, err := json.Marshal(kubeNamespace) + if err != nil { + logrus.Print("ERROR WHILE MARSHALLING POD DETAILS") + } + externalData := string(data) + payload := model.InfraActionResponse{ + Action: &model.ActionPayload{ + RequestID: reqID, + RequestType: reqType, + ExternalData: &externalData, + }, + } + if clusterChan, ok := r.ConnectedInfra[kubeNamespace.InfraID]; ok { + clusterChan <- &payload + } else if reqChan, ok := r.KubeNamespaceData[reqID]; ok { + resp := model.KubeNamespaceResponse{ + InfraID: kubeNamespace.InfraID, + KubeNamespace: []*model.KubeNamespace{}, } reqChan <- &resp close(reqChan) diff --git a/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go b/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go new file mode 100644 index 00000000000..31ff3b9aa5f --- /dev/null +++ b/chaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.go @@ -0,0 +1,111 @@ +package fuzz_tests + +import ( + "context" + "testing" + + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment_run" + dbChaosExperiment "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment" + dbChaosExperimentRun "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment_run" + dbChaosInfra "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_infrastructure" + dbMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/mocks" + + fuzz "github.com/AdaLogics/go-fuzz-headers" + store "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/data-store" + "github.com/stretchr/testify/mock" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" +) + +type MockServices struct { + ChaosExperimentOperator *dbChaosExperiment.Operator + ChaosExperimentRunOperator *dbChaosExperimentRun.Operator + ChaosInfrastructureOperator *dbChaosInfra.Operator + MongodbOperator *dbMocks.MongoOperator + ChaosExperimentRunService chaos_experiment_run.Service +} + +func NewMockServices() *MockServices { + var ( + mongodbMockOperator = new(dbMocks.MongoOperator) + chaosExperimentOperator = dbChaosExperiment.NewChaosExperimentOperator(mongodbMockOperator) + chaosExperimentRunOperator = dbChaosExperimentRun.NewChaosExperimentRunOperator(mongodbMockOperator) + chaosInfrastructureOperator = dbChaosInfra.NewInfrastructureOperator(mongodbMockOperator) + chaosExperimentRunService chaos_experiment_run.Service = chaos_experiment_run.NewChaosExperimentRunService( + chaosExperimentOperator, + chaosInfrastructureOperator, + chaosExperimentRunOperator, + ) + ) + return &MockServices{ + ChaosExperimentOperator: chaosExperimentOperator, + ChaosExperimentRunOperator: chaosExperimentRunOperator, + ChaosInfrastructureOperator: chaosInfrastructureOperator, + MongodbOperator: mongodbMockOperator, + ChaosExperimentRunService: chaosExperimentRunService, + } +} + +func FuzzProcessExperimentRunStop(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + Query bson.D + ExperimentRunID *string + Experiment dbChaosExperiment.ChaosExperimentRequest + Username string + ProjectID string + StoreStateData *store.StateData + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.MongodbOperator.On("Update", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&mongo.UpdateResult{}, nil).Once() + err = mockServices.ChaosExperimentRunService.ProcessExperimentRunStop( + context.Background(), + targetStruct.Query, + targetStruct.ExperimentRunID, + targetStruct.Experiment, + targetStruct.Username, + targetStruct.ProjectID, + targetStruct.StoreStateData, + ) + if err != nil { + t.Errorf("ProcessExperimentRunStop() error = %v", err) + } + }) +} + +func FuzzProcessCompletedExperimentRun(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + ExecData chaos_experiment_run.ExecutionData + WfID string + RunID string + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + findResult := []interface{}{bson.D{ + {Key: "experiment_id", Value: targetStruct.WfID}, + }} + mockServices := NewMockServices() + singleResult := mongo.NewSingleResultFromDocument(findResult[0], nil, nil) + mockServices.MongodbOperator.On("Get", mock.Anything, mock.Anything, mock.Anything).Return(singleResult, nil).Once() + + _, err = mockServices.ChaosExperimentRunService.ProcessCompletedExperimentRun( + targetStruct.ExecData, + targetStruct.WfID, + targetStruct.RunID, + ) + if err != nil { + t.Errorf("ProcessCompletedExperimentRun() error = %v", err) + } + }) +} diff --git a/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/fuzz_tests/handler_fuzz_test.go b/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/fuzz_tests/handler_fuzz_test.go new file mode 100644 index 00000000000..56af374f378 --- /dev/null +++ b/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/fuzz_tests/handler_fuzz_test.go @@ -0,0 +1,242 @@ +package fuzz_tests + +import ( + "context" + "strings" + "testing" + "time" + + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler" + chaosInfraMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks" + dbChaosExperiment "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment" + dbChaosExperimentRun "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment_run" + dbMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/mocks" + dbGitOpsMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/gitops/model/mocks" + + fuzz "github.com/AdaLogics/go-fuzz-headers" + + "github.com/google/uuid" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + typesMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment_run/model/mocks" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb" + "github.com/stretchr/testify/mock" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" +) + +type MockServices struct { + ChaosExperimentRunService *typesMocks.ChaosExperimentRunService + InfrastructureService *chaosInfraMocks.InfraService + GitOpsService *dbGitOpsMocks.GitOpsService + ChaosExperimentOperator *dbChaosExperiment.Operator + ChaosExperimentRunOperator *dbChaosExperimentRun.Operator + MongodbOperator *dbMocks.MongoOperator + ChaosExperimentRunHandler *handler.ChaosExperimentRunHandler +} + +func NewMockServices() *MockServices { + var ( + mongodbMockOperator = new(dbMocks.MongoOperator) + infrastructureService = new(chaosInfraMocks.InfraService) + gitOpsService = new(dbGitOpsMocks.GitOpsService) + chaosExperimentRunService = new(typesMocks.ChaosExperimentRunService) + chaosExperimentOperator = dbChaosExperiment.NewChaosExperimentOperator(mongodbMockOperator) + chaosExperimentRunOperator = dbChaosExperimentRun.NewChaosExperimentRunOperator(mongodbMockOperator) + ) + var chaosExperimentRunHandler = handler.NewChaosExperimentRunHandler( + chaosExperimentRunService, + infrastructureService, + gitOpsService, + chaosExperimentOperator, + chaosExperimentRunOperator, + mongodbMockOperator, + ) + return &MockServices{ + ChaosExperimentRunService: chaosExperimentRunService, + InfrastructureService: infrastructureService, + GitOpsService: gitOpsService, + ChaosExperimentOperator: chaosExperimentOperator, + ChaosExperimentRunOperator: chaosExperimentRunOperator, + MongodbOperator: mongodbMockOperator, + ChaosExperimentRunHandler: chaosExperimentRunHandler, + } +} + +func FuzzGetExperimentRun(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + ProjectID string + ExperimentRunID string + NotifyID string + }{} + + targetStruct.ProjectID = uuid.New().String() + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + ctx := context.Background() + mockServices := NewMockServices() + findResult := []interface{}{bson.D{ + {Key: "experiment_run_id", Value: targetStruct.ExperimentRunID}, + {Key: "project_id", Value: targetStruct.ProjectID}, + {Key: "infra_id", Value: "mockInfraID"}, + {Key: "kubernetesInfraDetails", Value: bson.A{ + bson.D{ + {Key: "InfraID", Value: "mockInfraID"}, + {Key: "Name", Value: "MockInfra"}, + {Key: "EnvironmentID", Value: "mockEnvID"}, + {Key: "Description", Value: "Mock Infrastructure"}, + {Key: "PlatformName", Value: "Kubernetes"}, + {Key: "IsActive", Value: true}, + {Key: "UpdatedAt", Value: time.Now().Unix()}, + {Key: "CreatedAt", Value: time.Now().Unix()}, + }, + }}, + {Key: "experiment", Value: bson.A{ + bson.D{ + {Key: "ExperimentName", Value: "MockExperiment"}, + {Key: "ExperimentType", Value: "MockType"}, + {Key: "Revision", Value: bson.A{ + bson.D{ + {Key: "RevisionID", Value: uuid.NewString()}, + {Key: "ExperimentManifest", Value: "mockManifest"}, + {Key: "Weightages", Value: bson.A{ + bson.D{{Key: "FaultName", Value: "fault1"}, {Key: "Weightage", Value: 10}}, + bson.D{{Key: "FaultName", Value: "fault2"}, {Key: "Weightage", Value: 20}}, + }}, + }, + }}, + }, + }}, + }} + + cursor, _ := mongo.NewCursorFromDocuments(findResult, nil, nil) + mockServices.MongodbOperator.On("Aggregate", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(cursor, nil).Once() + + res, err := mockServices.ChaosExperimentRunHandler.GetExperimentRun(ctx, targetStruct.ProjectID, &targetStruct.ExperimentRunID, &targetStruct.NotifyID) + if err != nil { + t.Errorf("ChaosExperimentRunHandler.GetExperimentRun() error = %v", err) + return + } + if res == nil { + t.Errorf("Returned response is nil") + } + }) +} + +func FuzzListExperimentRun(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + ProjectID string + Request model.ListExperimentRunRequest + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + findResult := []interface{}{bson.D{ + {Key: "project_id", Value: targetStruct.ProjectID}, + {Key: "infra_id", Value: "abc"}, + { + Key: "revision", Value: []dbChaosExperiment.ExperimentRevision{ + { + RevisionID: uuid.NewString(), + }, + }, + }, + }} + cursor, _ := mongo.NewCursorFromDocuments(findResult, nil, nil) + mockServices.MongodbOperator.On("Aggregate", mock.Anything, mongodb.ChaosExperimentRunsCollection, mock.Anything, mock.Anything).Return(cursor, nil).Once() + + res, err := mockServices.ChaosExperimentRunHandler.ListExperimentRun(targetStruct.ProjectID, targetStruct.Request) + if err != nil { + t.Errorf("ListExperimentRun() error = %v", err) + return + } + if res == nil { + t.Errorf("Returned response is nil") + } + + }) +} + +func FuzzRunChaosWorkFlow(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + ProjectID string + Workflow dbChaosExperiment.ChaosExperimentRequest + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.MongodbOperator.On("StartSession").Return(mock.Anything, nil).Once() + mockServices.MongodbOperator.On("Update", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&mongo.UpdateResult{}, nil).Once() + mockServices.MongodbOperator.On("CommitTransaction", mock.Anything).Return(nil).Once() + mockServices.MongodbOperator.On("AbortTransaction", mock.Anything).Return(nil).Once() + + findResult := []interface{}{bson.D{ + {Key: "infra_id", Value: targetStruct.ProjectID}, + }} + singleResult := mongo.NewSingleResultFromDocument(findResult[0], nil, nil) + mockServices.MongodbOperator.On("Get", mock.Anything, mock.Anything, mock.Anything).Return(singleResult, nil).Once() + + res, err := mockServices.ChaosExperimentRunHandler.RunChaosWorkFlow(context.Background(), targetStruct.ProjectID, targetStruct.Workflow, nil) + if strings.Contains(err.Error(), "inactive infra") { + t.Log("Handled expected error due to inactive infrastructure: ", err) + return + } + if res == nil { + t.Errorf("Returned response is nil") + } + }) +} + +func FuzzGetExperimentRunStats(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + ProjectID string + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + targetStruct.ProjectID = uuid.New().String() + + mockServices := NewMockServices() + + findResult := []interface{}{bson.D{ + {Key: "project_id", Value: targetStruct.ProjectID}, + {Key: "infra_id", Value: "abc"}, + { + Key: "revision", Value: []dbChaosExperiment.ExperimentRevision{ + { + RevisionID: uuid.NewString(), + }, + }, + }, + }} + cursor, _ := mongo.NewCursorFromDocuments(findResult, nil, nil) + mockServices.MongodbOperator.On("Aggregate", mock.Anything, mongodb.ChaosExperimentRunsCollection, mock.Anything, mock.Anything).Return(cursor, nil).Once() + + res, err := mockServices.ChaosExperimentRunHandler.GetExperimentRunStats(context.Background(), targetStruct.ProjectID) + if err != nil { + t.Errorf("GetExperimentRunStats() error = %v", err) + return + } + if res == nil { + t.Errorf("Returned response is nil") + } + }) +} diff --git a/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/handler.go b/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/handler.go index eddb54e4fb3..166abe19973 100644 --- a/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/handler.go +++ b/chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/handler.go @@ -1222,7 +1222,7 @@ func (c *ChaosExperimentRunHandler) ChaosExperimentRunEvent(event model.Experime err = c.chaosExperimentOperator.UpdateChaosExperiment(sessionContext, filter, update) if err != nil { - logrus.Error("Failed to update experiment collection") + logrus.WithError(err).Error("Failed to update experiment collection") return err } } else if experimentRunCount > 0 { @@ -1257,7 +1257,7 @@ func (c *ChaosExperimentRunHandler) ChaosExperimentRunEvent(event model.Experime err = c.chaosExperimentOperator.UpdateChaosExperiment(sessionContext, filter, update) if err != nil { - logrus.Error("Failed to update experiment collection") + logrus.WithError(err).Error("Failed to update experiment collection") return err } } diff --git a/chaoscenter/graphql/server/pkg/chaos_infrastructure/fuzz/fuzz_test.go b/chaoscenter/graphql/server/pkg/chaos_infrastructure/fuzz/fuzz_test.go new file mode 100644 index 00000000000..b8fa0ff67b0 --- /dev/null +++ b/chaoscenter/graphql/server/pkg/chaos_infrastructure/fuzz/fuzz_test.go @@ -0,0 +1,656 @@ +package test + +import ( + "context" + "testing" + + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment/handler" + chaosExperimentMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment/model/mocks" + chaosExperimentRunMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_experiment_run/model/mocks" + chaosInfraMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks" + dbChaosExperiment "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment" + dbChaosExperimentRun "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment_run" + dbMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/mocks" + dbGitOpsMocks "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/gitops/model/mocks" + "go.mongodb.org/mongo-driver/bson" + + dbChaosInfra "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/chaos_infrastructure" + dbOperationsEnvironment "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/database/mongodb/environments" + + fuzz "github.com/AdaLogics/go-fuzz-headers" + store "github.com/litmuschaos/litmus/chaoscenter/graphql/server/pkg/data-store" +) + +type MockServices struct { + ChaosExperimentService *chaosExperimentMocks.ChaosExperimentService + ChaosExperimentRunService *chaosExperimentRunMocks.ChaosExperimentRunService + InfrastructureService *chaosInfraMocks.InfraService + GitOpsService *dbGitOpsMocks.GitOpsService + ChaosExperimentOperator *dbChaosExperiment.Operator + ChaosExperimentRunOperator *dbChaosExperimentRun.Operator + MongodbOperator *dbMocks.MongoOperator + ChaosExperimentHandler *handler.ChaosExperimentHandler +} + +func NewMockServices() *MockServices { + var ( + mongodbMockOperator = new(dbMocks.MongoOperator) + infrastructureService = new(chaosInfraMocks.InfraService) + chaosExperimentRunService = new(chaosExperimentRunMocks.ChaosExperimentRunService) + gitOpsService = new(dbGitOpsMocks.GitOpsService) + chaosExperimentOperator = dbChaosExperiment.NewChaosExperimentOperator(mongodbMockOperator) + chaosExperimentRunOperator = dbChaosExperimentRun.NewChaosExperimentRunOperator(mongodbMockOperator) + chaosExperimentService = new(chaosExperimentMocks.ChaosExperimentService) + ) + var chaosExperimentHandler = handler.NewChaosExperimentHandler(chaosExperimentService, chaosExperimentRunService, infrastructureService, gitOpsService, chaosExperimentOperator, chaosExperimentRunOperator, mongodbMockOperator) + return &MockServices{ + ChaosExperimentService: chaosExperimentService, + ChaosExperimentRunService: chaosExperimentRunService, + InfrastructureService: infrastructureService, + GitOpsService: gitOpsService, + ChaosExperimentOperator: chaosExperimentOperator, + ChaosExperimentRunOperator: chaosExperimentRunOperator, + MongodbOperator: mongodbMockOperator, + ChaosExperimentHandler: chaosExperimentHandler, + } +} + +var ( + mongodbMockOperator = new(dbMocks.MongoOperator) + environmentOperator = dbOperationsEnvironment.NewEnvironmentOperator(mongodbMockOperator) +) + +func stringPointer(v string) *string { return &v } + +func FuzzRegisterInfra(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + projectID string + request model.RegisterInfraRequest + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + ctx := context.Background() + mockServices := NewMockServices() + mockResponse := &model.RegisterInfraResponse{ + Token: "test-token", + InfraID: "test-infra-id", + Name: targetStruct.request.Name, + Manifest: "test-manifest", + } + mockServices.InfrastructureService. + On("RegisterInfra", ctx, targetStruct.projectID, targetStruct.request). + Return(mockResponse, nil) + + response, err := mockServices.InfrastructureService.RegisterInfra(ctx, targetStruct.projectID, targetStruct.request) + if response.Name != targetStruct.request.Name { + t.Errorf("Chaos Infrastructure Name is %s Return %s", response.Name, targetStruct.request.Name) + } + if err != nil { + t.Errorf("ChaosInfrastructure.RegisterInfra() error = %v", err) + return + } + if response == nil { + t.Errorf("Returned environment is nil") + } + }) + +} + +func FuzzDeleteInfra(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + projectID string + infraID string + r store.StateData + }{} + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + ctx := context.Background() + mockServices := NewMockServices() + + mockServices.InfrastructureService. + On("DeleteInfra", ctx, targetStruct.projectID, targetStruct.infraID, targetStruct.r). + Return("infra deleted successfully", nil) + + response, err := mockServices.InfrastructureService.DeleteInfra(ctx, targetStruct.projectID, targetStruct.infraID, targetStruct.r) + if err != nil { + t.Errorf("ChaosInfrastructure.RegisterInfra() error = %v", err) + return + } + if response == "" { + t.Errorf("Returned environment is nil") + } + + }) +} + +func FuzzGetInfraTest(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + projectID string + infraID string + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + ctx := context.Background() + mockServices := NewMockServices() + + mockResponse := &model.Infra{ + InfraID: targetStruct.infraID, + ProjectID: targetStruct.projectID, + Name: "TestInfraName", + Description: nil, + Tags: []string{"tag1", "tag2"}, + EnvironmentID: "test-env-id", + PlatformName: "test-platform", + IsActive: true, + IsInfraConfirmed: true, + IsRemoved: false, + UpdatedAt: "1680000000", + CreatedAt: "1670000000", + Token: "test-token", + InfraNamespace: nil, + ServiceAccount: nil, + InfraScope: "test-scope", + StartTime: "1675000000", + Version: "1.0.0", + CreatedBy: &model.UserDetails{Username: "test-user"}, + UpdatedBy: &model.UserDetails{Username: "test-user"}, + NoOfExperiments: nil, + NoOfExperimentRuns: nil, + LastExperimentTimestamp: nil, + UpdateStatus: "UpToDate", + } + + mockServices.InfrastructureService. + On("GetInfra", context.Background(), targetStruct.projectID, targetStruct.infraID). + Return(mockResponse, nil) + + infra, err := mockServices.InfrastructureService.GetInfra(ctx, targetStruct.projectID, targetStruct.infraID) + if err != nil { + t.Errorf("ChaosInfrastructure.GetInfra() error = %v", err) + return + } + if infra.InfraID != targetStruct.infraID { + t.Errorf("ProjectID mismatch: got %v, want %v", infra.InfraID, targetStruct.infraID) + } + }) +} + +func FuzzListInfras(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + projectID string + request *model.ListInfraRequest + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + + mockResponse := &model.ListInfraResponse{ + TotalNoOfInfras: 10, + Infras: []*model.Infra{ + { + InfraID: "infra1", + ProjectID: targetStruct.projectID, + Name: "Test Infra", + EnvironmentID: "env1", + Description: stringPointer("Test description"), + PlatformName: "Test Platform", + IsActive: true, + IsInfraConfirmed: true, + UpdatedAt: "1622527200", + CreatedAt: "1622523600", + Token: "test-token", + InfraNamespace: stringPointer("test-namespace"), + ServiceAccount: stringPointer("test-service-account"), + InfraScope: "test-scope", + StartTime: "1622520000", + Version: "v1.0", + Tags: []string{"tag1", "tag2"}, + IsRemoved: false, + }, + }, + } + + mockServices.InfrastructureService.On("ListInfras", targetStruct.projectID, targetStruct.request). + Return(mockResponse, nil) + + response, err := mockServices.InfrastructureService.ListInfras(targetStruct.projectID, targetStruct.request) + if err != nil { + t.Errorf("ChaosInfrastructure.DeleteInfra() error = %v", err) + return + } + + if response.TotalNoOfInfras < 0 { + t.Errorf("Invalid TotalNoOfInfras: %d", response.TotalNoOfInfras) + } + for _, infra := range response.Infras { + if infra.InfraID == "" { + t.Errorf("InfraID should not be empty") + } + if infra.ProjectID != targetStruct.projectID { + t.Errorf("ProjectID mismatch: got %v, want %v", infra.ProjectID, targetStruct.projectID) + } + } + + }) +} + +func FuzzGetInfraDetails(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + InfraID string + projectID string + request *model.ListInfraRequest + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockResponse := &model.Infra{ + InfraID: targetStruct.InfraID, + ProjectID: targetStruct.projectID, + Name: "TestInfraName", + Description: nil, + Tags: []string{"tag1", "tag2"}, + EnvironmentID: "test-env-id", + PlatformName: "test-platform", + IsActive: true, + IsInfraConfirmed: true, + IsRemoved: false, + UpdatedAt: "1680000000", + CreatedAt: "1670000000", + Token: "test-token", + InfraNamespace: nil, + ServiceAccount: nil, + InfraScope: "test-scope", + StartTime: "1675000000", + Version: "1.0.0", + CreatedBy: &model.UserDetails{Username: "test-user"}, + UpdatedBy: &model.UserDetails{Username: "test-user"}, + NoOfExperiments: nil, + NoOfExperimentRuns: nil, + LastExperimentTimestamp: nil, + UpdateStatus: "UpToDate", + } + + mockServices.InfrastructureService. + On("GetInfra", context.Background(), targetStruct.projectID, targetStruct.InfraID). + Return(mockResponse, nil) + + mockServices.InfrastructureService. + On("GetInfraDetails", context.Background(), targetStruct.InfraID, targetStruct.projectID). + Return(mockResponse, nil) + + ctx := context.Background() + response, err := mockServices.InfrastructureService.GetInfraDetails(ctx, targetStruct.InfraID, targetStruct.projectID) + if err != nil { + t.Errorf("ChaosInfrastructure.DeleteInfra() error = %v", err) + return + } + if response.InfraID != targetStruct.InfraID { + t.Errorf("InfraID mismatch: got %v, want %v", response.InfraID, targetStruct.InfraID) + } + + }) +} + +func FuzzGetInfraStats(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + projectID string + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockResponse := &model.GetInfraStatsResponse{ + TotalInfrastructures: 10, + TotalActiveInfrastructure: 7, + TotalInactiveInfrastructures: 3, + TotalConfirmedInfrastructure: 8, + TotalNonConfirmedInfrastructures: 2, + } + + mockServices.InfrastructureService. + On("GetInfraStats", context.Background(), targetStruct.projectID). + Return(mockResponse, nil) + + ctx := context.Background() + response, err := mockServices.InfrastructureService.GetInfraStats(ctx, targetStruct.projectID) + if err != nil { + t.Errorf("ChaosInfrastructure.DeleteInfra() error = %v", err) + return + } + if response.TotalInfrastructures != mockResponse.TotalInfrastructures { + t.Errorf("TotalInfrastructures mismatch: got %v, want %v", response.TotalInfrastructures, mockResponse.TotalInfrastructures) + } + if response.TotalActiveInfrastructure != mockResponse.TotalActiveInfrastructure { + t.Errorf("TotalActiveInfrastructure mismatch: got %v, want %v", response.TotalActiveInfrastructure, mockResponse.TotalActiveInfrastructure) + } + if response.TotalInactiveInfrastructures != mockResponse.TotalInactiveInfrastructures { + t.Errorf("TotalInactiveInfrastructures mismatch: got %v, want %v", response.TotalInactiveInfrastructures, mockResponse.TotalInactiveInfrastructures) + } + if response.TotalConfirmedInfrastructure != mockResponse.TotalConfirmedInfrastructure { + t.Errorf("TotalConfirmedInfrastructure mismatch: got %v, want %v", response.TotalConfirmedInfrastructure, mockResponse.TotalConfirmedInfrastructure) + } + if response.TotalNonConfirmedInfrastructures != mockResponse.TotalNonConfirmedInfrastructures { + t.Errorf("TotalNonConfirmedInfrastructures mismatch: got %v, want %v", response.TotalNonConfirmedInfrastructures, mockResponse.TotalNonConfirmedInfrastructures) + } + + }) +} + +func FuzzGetVersionDetails(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + mockServices := NewMockServices() + mockResponse := &model.InfraVersionDetails{ + LatestVersion: "testVersion1", + CompatibleVersions: []string{"compatibleVersion1", "compatibleVersion2"}, + } + + mockServices.InfrastructureService.On("GetVersionDetails").Return(mockResponse, nil) + response, err := mockServices.InfrastructureService.GetVersionDetails() + + if err != nil { + t.Errorf("infraService.GetVersionDetails() error = %v", err) + return + } + + if response == nil { + t.Errorf("Expected a non-nil response") + return + } + if response.LatestVersion == "" { + t.Errorf("Expected a valid latest version") + } + + }) +} + +func FuzzQueryServerVersion(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + ctx := context.Background() + mockResponse := &model.ServerVersionResponse{ + Key: "version", + Value: string(data), + } + + mockServices := NewMockServices() + mockServices.InfrastructureService.On("GetConfig", ctx, "version").Return(mockResponse, nil) + mockServices.InfrastructureService.On("QueryServerVersion", ctx).Return(mockResponse, nil) + response, err := mockServices.InfrastructureService.QueryServerVersion(ctx) + if err != nil { + t.Errorf("QueryServerVersion() error = %v", err) + return + } + if response == nil { + t.Errorf("Expected a non-nil response") + return + } + if response.Key != "version" { + t.Errorf("Expected Key to be 'version', got %s", response.Key) + } + if response.Value != string(data) { + t.Errorf("Expected Value to be %s, got %s", string(data), response.Value) + } + }) +} + +func FuzzPodLog(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + request model.PodLog + r store.StateData + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.InfrastructureService. + On("PodLog", targetStruct.request, targetStruct.r). + Return("LOGS SENT SUCCESSFULLY", nil) + response, err := mockServices.InfrastructureService.PodLog(targetStruct.request, targetStruct.r) + if err != nil { + t.Errorf("ChaosInfrastructure.PodLog() error = %v", err) + return + } + if response == "" { + t.Errorf("Returned environment is nil") + } + + }) +} + +func FuzzKubeObj(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + request model.KubeObjectData + r store.StateData + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.InfrastructureService. + On("KubeObj", targetStruct.request, targetStruct.r). + Return("KubeData sent successfully", nil) + + response, err := mockServices.InfrastructureService.KubeObj(targetStruct.request, targetStruct.r) + if err != nil { + t.Errorf("ChaosInfrastructure.KubeObj() error = %v", err) + return + } + if response == "" { + t.Errorf("Returned environment is nil") + } + }) +} + +func FuzzSendInfraEvent(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + EventType string + EventName string + Description string + Infra model.Infra + R store.StateData + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + targetStruct.R.InfraEventPublish = make(map[string][]chan *model.InfraEventResponse) + projectID := targetStruct.Infra.ProjectID + if projectID != "" { + targetStruct.R.InfraEventPublish[projectID] = append(targetStruct.R.InfraEventPublish[projectID], make(chan *model.InfraEventResponse, 1)) + } + + mockServices.InfrastructureService.SendInfraEvent(targetStruct.EventType, targetStruct.EventName, targetStruct.Description, targetStruct.Infra, targetStruct.R) + + if projectID != "" { + select { + case event := <-targetStruct.R.InfraEventPublish[projectID][0]: + if event == nil { + t.Errorf("Expected non-nil event") + } + if event.EventType != targetStruct.EventType { + t.Errorf("Expected EventType to be %s, got %s", targetStruct.EventType, event.EventType) + } + if event.EventName != targetStruct.EventName { + t.Errorf("Expected EventName to be %s, got %s", targetStruct.EventName, event.EventName) + } + if event.Description != targetStruct.Description { + t.Errorf("Expected Description to be %s, got %s", targetStruct.Description, event.Description) + } + if event.Infra != &targetStruct.Infra { + t.Errorf("Expected Infra to be %+v, got %+v", targetStruct.Infra, event.Infra) + } + default: + t.Errorf("Expected an event to be published") + } + } + }) +} +func FuzzConfirmInfraRegistration(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + request model.InfraIdentity + r store.StateData + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.InfrastructureService. + On("ConfirmInfraRegistration", targetStruct.request, targetStruct.r). + Return(&model.ConfirmInfraRegistrationResponse{ + IsInfraConfirmed: true, + NewAccessKey: &targetStruct.request.AccessKey, + InfraID: &targetStruct.request.InfraID, + }, nil) + + response, err := mockServices.InfrastructureService.ConfirmInfraRegistration(targetStruct.request, targetStruct.r) + if err != nil { + t.Errorf("ChaosInfrastructure.ConfirmInfraRegistration() error = %v", err) + return + } + if response == nil { + t.Errorf("Returned environment is nil") + } + + }) +} + +func FuzzVerifyInfra(f *testing.F) { + + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + request := model.InfraIdentity{} + err := fuzzConsumer.GenerateStruct(&request) + if err != nil { + return + } + + mockServices := NewMockServices() + + expectedInfra := &dbChaosInfra.ChaosInfra{ + InfraID: request.InfraID, + AccessKey: request.AccessKey, + IsRegistered: true, + Version: request.Version, + } + + mockServices.InfrastructureService. + On("VerifyInfra", request). + Return(expectedInfra, nil) + + response, err := mockServices.InfrastructureService.VerifyInfra(request) + if err != nil { + t.Errorf("ChaosInfrastructure.VerifyInfra() error = %v", err) + return + } + if response == nil { + t.Errorf("Returned environment is nil") + } + + }) +} +func FuzzUpdateInfra(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + targetStruct := &struct { + query bson.D + update bson.D + }{} + + err := fuzzConsumer.GenerateStruct(targetStruct) + if err != nil { + return + } + + mockServices := NewMockServices() + mockServices.InfrastructureService. + On("UpdateInfra", targetStruct.query, targetStruct.update). + Return(nil) + + err = mockServices.InfrastructureService.UpdateInfra(targetStruct.query, targetStruct.update) + if err != nil { + t.Errorf("ChaosInfrastructure.UpdateInfra() error = %v", err) + return + } + + }) +} +func FuzzGetDBInfra(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + var infraID string + err := fuzzConsumer.GenerateStruct(&infraID) + if err != nil { + return + } + + mockServices := NewMockServices() + expectedInfra := dbChaosInfra.ChaosInfra{ + InfraID: infraID, + } + + mockServices.InfrastructureService. + On("GetDBInfra", infraID). + Return(expectedInfra, nil) + + response, err := mockServices.InfrastructureService.GetDBInfra(infraID) + if err != nil { + t.Errorf("ChaosInfrastructure.GetDBInfra() error = %v", err) + return + } + if response.InfraID != infraID { + t.Errorf("InfraID mismatch: got %v, want %v", response.InfraID, infraID) + } + }) +} diff --git a/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks/service.go b/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks/service.go index c20b5242771..fb3ac94bf0f 100644 --- a/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks/service.go +++ b/chaoscenter/graphql/server/pkg/chaos_infrastructure/model/mocks/service.go @@ -83,6 +83,11 @@ func (s *InfraService) KubeObj(request model.KubeObjectData, r store.StateData) return args.String(0), args.Error(1) } +func (s *InfraService) KubeNamespace(request model.KubeNamespaceData, r store.StateData) (string, error) { + args := s.Called(request, r) + return args.String(0), args.Error(1) +} + func (s *InfraService) UpdateInfra(query bson.D, update bson.D) error { args := s.Called(query, update) return args.Error(0) diff --git a/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go b/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go index 4548e081615..8c9663d241f 100644 --- a/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go +++ b/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go @@ -50,6 +50,7 @@ type Service interface { GetVersionDetails() (*model.InfraVersionDetails, error) QueryServerVersion(ctx context.Context) (*model.ServerVersionResponse, error) PodLog(request model.PodLog, r store.StateData) (string, error) + KubeNamespace(request model.KubeNamespaceData, r store.StateData) (string, error) KubeObj(request model.KubeObjectData, r store.StateData) (string, error) UpdateInfra(query bson.D, update bson.D) error GetDBInfra(infraID string) (dbChaosInfra.ChaosInfra, error) @@ -988,7 +989,7 @@ func (in *infraService) KubeObj(request model.KubeObjectData, r store.StateData) return "", err } if reqChan, ok := r.KubeObjectData[request.RequestID]; ok { - var kubeObjData []*model.KubeObject + var kubeObjData *model.KubeObject err = json.Unmarshal([]byte(request.KubeObj), &kubeObjData) if err != nil { return "", fmt.Errorf("failed to unmarshal kubeObj data %w", err) @@ -1005,6 +1006,31 @@ func (in *infraService) KubeObj(request model.KubeObjectData, r store.StateData) return "KubeData sent successfully", nil } +// KubeNamespace receives Kubernetes Namespace data from subscriber +func (in *infraService) KubeNamespace(request model.KubeNamespaceData, r store.StateData) (string, error) { + _, err := in.VerifyInfra(*request.InfraID) + if err != nil { + log.Print("Error", err) + return "", err + } + if reqChan, ok := r.KubeNamespaceData[request.RequestID]; ok { + var kubeNamespaceData []*model.KubeNamespace + err = json.Unmarshal([]byte(request.KubeNamespace), &kubeNamespaceData) + if err != nil { + return "", fmt.Errorf("failed to unmarshal kubeNamespace data %w", err) + } + + resp := model.KubeNamespaceResponse{ + InfraID: request.InfraID.InfraID, + KubeNamespace: kubeNamespaceData, + } + reqChan <- &resp + close(reqChan) + return "KubeData sent successfully", nil + } + return "KubeData sent successfully", nil +} + // SendInfraEvent sends events from the infras to the appropriate users listening for the events func (in *infraService) SendInfraEvent(eventType, eventName, description string, infra model.Infra, r store.StateData) { newEvent := model.InfraEventResponse{ diff --git a/chaoscenter/graphql/server/pkg/chaos_infrastructure/types.go b/chaoscenter/graphql/server/pkg/chaos_infrastructure/types.go index 8a3d8ead071..64c90cc5328 100644 --- a/chaoscenter/graphql/server/pkg/chaos_infrastructure/types.go +++ b/chaoscenter/graphql/server/pkg/chaos_infrastructure/types.go @@ -11,6 +11,10 @@ type KubeObjData struct { Data []ObjectData `json:"data"` } +type KubeNamespace struct { + Name string `json:"Name"` +} + type ObjectData struct { Name string `json:"name"` UID types.UID `json:"uid"` diff --git a/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_fuzz_test.go b/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_fuzz_test.go new file mode 100644 index 00000000000..a505ad5a44c --- /dev/null +++ b/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_fuzz_test.go @@ -0,0 +1,246 @@ +package handler + +import ( + "archive/zip" + "encoding/json" + "os" + "path/filepath" + "strings" + "testing" + + fuzz "github.com/AdaLogics/go-fuzz-headers" + "github.com/google/uuid" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" +) + +func FuzzGetChartsPath(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + fuzzConsumer := fuzz.NewConsumer(data) + + chartsInput := model.CloningInput{} + err := fuzzConsumer.GenerateStruct(&chartsInput) + if err != nil { + return + } + projectID, _ := fuzzConsumer.GetString() + isDefault, _ := fuzzConsumer.GetBool() + + result := GetChartsPath(chartsInput, projectID, isDefault) + + if isDefault { + expected := DefaultPath + "default/" + chartsInput.Name + "/faults/" + if result != expected { + t.Errorf("Expected %s, got %s", expected, result) + } + } else { + expected := DefaultPath + projectID + "/" + chartsInput.Name + "/faults/" + if result != expected { + t.Errorf("Expected %s, got %s", expected, result) + } + } + }) +} + +func FuzzGetExperimentData(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte, filename string) { + fuzzConsumer := fuzz.NewConsumer(data) + + // Create a temporary directory + tmpDir, err := os.MkdirTemp("", "*-fuzztest") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpDir) // clean up + + // Ensure the filename is valid and unique + safeFilename := filepath.Clean(filepath.Base(filename)) + if isInvalidFilename(safeFilename) { + safeFilename = "test.yaml" + } + filePath := filepath.Join(tmpDir, safeFilename) + content := ChaosChart{} + err = fuzzConsumer.GenerateStruct(&content) + if err != nil { + return + } + + jsonContent, _ := json.Marshal(content) + err = os.WriteFile(filePath, jsonContent, 0644) + if err != nil { + t.Fatal(err) + } + + _, err = GetExperimentData(filePath) + + if err != nil && !isInvalidYAML(jsonContent) && json.Valid(jsonContent) { + t.Errorf("UnExpected error for valid YAML, got error: %v", err) + } + if err == nil && isInvalidYAML(jsonContent) { + t.Errorf("Expected error for invalid YAML, got nil") + } + + _, err = ReadExperimentFile("./not_exist_file.yaml") + if err == nil { + t.Errorf("Expected error for file does not exist, got nil") + } + }) +} + +func FuzzReadExperimentYAMLFile(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte, filename string) { + fuzzConsumer := fuzz.NewConsumer(data) + + // Create a temporary directory + tmpDir, err := os.MkdirTemp("", "*-fuzztest") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpDir) // clean up + + // Ensure the filename is valid and unique + safeFilename := filepath.Clean(filepath.Base(filename)) + if isInvalidFilename(safeFilename) { + safeFilename = "test.yaml" + } + filePath := filepath.Join(tmpDir, safeFilename) + content := ChaosChart{} + err = fuzzConsumer.GenerateStruct(&content) + if err != nil { + return + } + + jsonContent, _ := json.Marshal(content) + err = os.WriteFile(filePath, jsonContent, 0644) + if err != nil { + t.Fatal(err) + } + + _, err = ReadExperimentYAMLFile(filePath) + + if err != nil { + t.Errorf("UnExpected error for valid YAML, got error: %v", err) + } + + _, err = ReadExperimentFile("./not_exist_file.yaml") + if err == nil { + t.Errorf("Expected error for file does not exist, got nil") + } + }) +} + +func FuzzUnzipRemoteHub(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte, filename string, projectID string) { + // Create a temporary directory + tmpDir, err := os.MkdirTemp("", "*-fuzztest") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpDir) // clean up + + // Ensure the filename is valid and unique + safeFilename := filepath.Clean(filepath.Base(filename)) + if isInvalidFilename(safeFilename) { + safeFilename = "test.zip" + } + if !strings.HasSuffix(safeFilename, ".zip") { + safeFilename += ".zip" + } + if isInvalidFilename(projectID) { + projectID = uuid.New().String() + } + + filePath := filepath.Join(tmpDir, safeFilename) + // Create a valid zip file + err = createValidZipFile(filePath, data) + if err != nil { + t.Fatal(err) + } + + err = UnzipRemoteHub(filePath, projectID) + + if err != nil { + t.Errorf("UnExpected error for valid zip, got error: %v", err) + } + + // Test with non-existent file + err = UnzipRemoteHub("./not_exist_file.zip", projectID) + if err == nil { + t.Errorf("Expected error for file does not exist, got nil") + } + + // Test with non-zip file + nonZipPath := filepath.Join(tmpDir, "no_zip") + err = os.WriteFile(nonZipPath, []byte("not a zip file"), 0644) + if err != nil { + t.Fatal(err) + } + err = UnzipRemoteHub(nonZipPath, projectID) + if err == nil { + t.Errorf("Expected error for no zip, got nil") + } + }) +} + +func FuzzIsFileExisting(f *testing.F) { + f.Fuzz(func(t *testing.T, filename string) { + // Create a temporary directory + tmpDir, err := os.MkdirTemp("", "*-fuzztest") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpDir) // clean up + + // Ensure the filename is valid and unique + safeFilename := filepath.Clean(filepath.Base(filename)) + if isInvalidFilename(safeFilename) { + safeFilename = "test.yaml" + } + filePath := filepath.Join(tmpDir, safeFilename) + _, _ = os.Create(filePath) + + result, err := IsFileExisting(filePath) + if !result { + t.Errorf("Expected true for existing file, got false") + } + + result, err = IsFileExisting("./not_exist_file.yaml") + if result { + t.Errorf("Expected false for not existing file, got true") + } + }) +} + +func isInvalidFilename(filename string) bool { + return strings.IndexByte(filename, 0) != -1 || filename == "" || filename == "." || filename == ".." || filename == "/" || len(filename) > 255 +} + +func isInvalidYAML(data []byte) bool { + for _, b := range data { + if b < 32 || b == 127 { + return true + } + } + return false +} + +func createValidZipFile(filename string, data []byte) error { + zipFile, err := os.Create(filename) + if err != nil { + return err + } + defer zipFile.Close() + + zipWriter := zip.NewWriter(zipFile) + defer zipWriter.Close() + + f, err := zipWriter.Create("test.txt") + if err != nil { + return err + } + _, err = f.Write(data) + if err != nil { + return err + } + + return nil +} diff --git a/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_test.go b/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_test.go index ffcd2106ac3..1a30b1e012a 100644 --- a/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_test.go +++ b/chaoscenter/graphql/server/pkg/chaoshub/handler/handler_test.go @@ -72,11 +72,6 @@ func TestReadExperimentFile(t *testing.T) { filePath: "./temp1.yaml", isError: true, }, - { - name: "failure: file is not a yaml", - filePath: "./types.go", - isError: true, - }, } for _, tc := range testcases { // when diff --git a/chaoscenter/graphql/server/pkg/chaoshub/models_factory.go b/chaoscenter/graphql/server/pkg/chaoshub/models_factory.go index 0034aad025e..de8d3335a57 100644 --- a/chaoscenter/graphql/server/pkg/chaoshub/models_factory.go +++ b/chaoscenter/graphql/server/pkg/chaoshub/models_factory.go @@ -6,6 +6,7 @@ func NewCloningInputFrom(chaosHub model.CreateChaosHubRequest) model.CloningInpu return model.CloningInput{ RepoBranch: chaosHub.RepoBranch, RepoURL: chaosHub.RepoURL, + RemoteHub: chaosHub.RemoteHub, Name: chaosHub.Name, IsPrivate: chaosHub.IsPrivate, UserName: chaosHub.UserName, diff --git a/chaoscenter/graphql/server/pkg/chaoshub/ops/gitops.go b/chaoscenter/graphql/server/pkg/chaoshub/ops/gitops.go index 0a4950efef4..9480b144e6d 100644 --- a/chaoscenter/graphql/server/pkg/chaoshub/ops/gitops.go +++ b/chaoscenter/graphql/server/pkg/chaoshub/ops/gitops.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/litmuschaos/litmus/chaoscenter/graphql/server/graph/model" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/utils" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -284,7 +285,7 @@ func (c ChaosHubConfig) generateAuthMethod() (transport.AuthMethod, error) { var auth transport.AuthMethod if c.AuthType == model.AuthTypeToken { auth = &http.BasicAuth{ - Username: "litmus", // this can be anything except an empty string + Username: utils.Config.GitUsername, // must be a non-empty string or 'x-token-auth' for Bitbucket Password: *c.Token, } } else if c.AuthType == model.AuthTypeBasic { diff --git a/chaoscenter/graphql/server/pkg/chaoshub/service.go b/chaoscenter/graphql/server/pkg/chaoshub/service.go index 2c933363179..53f46cc975f 100644 --- a/chaoscenter/graphql/server/pkg/chaoshub/service.go +++ b/chaoscenter/graphql/server/pkg/chaoshub/service.go @@ -86,6 +86,7 @@ func (c *chaosHubService) AddChaosHub(ctx context.Context, chaosHub model.Create ProjectID: projectID, RepoURL: chaosHub.RepoURL, RepoBranch: chaosHub.RepoBranch, + RemoteHub: chaosHub.RemoteHub, ResourceDetails: mongodb.ResourceDetails{ Name: chaosHub.Name, Description: description, @@ -155,6 +156,7 @@ func (c *chaosHubService) AddRemoteChaosHub(ctx context.Context, chaosHub model. ProjectID: projectID, RepoURL: chaosHub.RepoURL, RepoBranch: "", + RemoteHub: chaosHub.RemoteHub, ResourceDetails: mongodb.ResourceDetails{ Name: chaosHub.Name, Description: description, @@ -226,6 +228,7 @@ func (c *chaosHubService) SaveChaosHub(ctx context.Context, chaosHub model.Creat ProjectID: projectID, RepoURL: chaosHub.RepoURL, RepoBranch: chaosHub.RepoBranch, + RemoteHub: chaosHub.RemoteHub, ResourceDetails: mongodb.ResourceDetails{ Name: chaosHub.Name, Description: description, @@ -273,6 +276,7 @@ func (c *chaosHubService) SyncChaosHub(ctx context.Context, hubID string, projec Name: chaosHub.Name, RepoURL: chaosHub.RepoURL, RepoBranch: chaosHub.RepoBranch, + RemoteHub: chaosHub.RemoteHub, IsPrivate: chaosHub.IsPrivate, UserName: chaosHub.UserName, Password: chaosHub.Password, @@ -311,6 +315,7 @@ func (c *chaosHubService) UpdateChaosHub(ctx context.Context, chaosHub model.Upd cloneHub := model.CloningInput{ RepoBranch: chaosHub.RepoBranch, RepoURL: chaosHub.RepoURL, + RemoteHub: chaosHub.RemoteHub, Name: chaosHub.Name, IsPrivate: chaosHub.IsPrivate, UserName: chaosHub.UserName, @@ -326,10 +331,11 @@ func (c *chaosHubService) UpdateChaosHub(ctx context.Context, chaosHub model.Upd } clonePath := DefaultPath + prevChaosHub.ProjectID + "/" + prevChaosHub.Name if prevChaosHub.HubType == string(model.HubTypeRemote) { - if prevChaosHub.Name != chaosHub.Name || prevChaosHub.RepoURL != chaosHub.RepoURL { + if prevChaosHub.Name != chaosHub.Name || prevChaosHub.RepoURL != chaosHub.RepoURL || prevChaosHub.RemoteHub != chaosHub.RemoteHub { remoteHub := model.CreateRemoteChaosHub{ - Name: chaosHub.Name, - RepoURL: chaosHub.RepoURL, + Name: chaosHub.Name, + RepoURL: chaosHub.RepoURL, + RemoteHub: chaosHub.RemoteHub, } err = os.RemoveAll(clonePath) if err != nil { @@ -342,7 +348,7 @@ func (c *chaosHubService) UpdateChaosHub(ctx context.Context, chaosHub model.Upd } } else { // Syncing/Cloning the repository at a path from ChaosHub link structure. - if prevChaosHub.Name != chaosHub.Name || prevChaosHub.RepoURL != chaosHub.RepoURL || prevChaosHub.RepoBranch != chaosHub.RepoBranch || prevChaosHub.IsPrivate != chaosHub.IsPrivate || prevChaosHub.AuthType != chaosHub.AuthType.String() { + if prevChaosHub.Name != chaosHub.Name || prevChaosHub.RepoURL != chaosHub.RepoURL || prevChaosHub.RepoBranch != chaosHub.RepoBranch || prevChaosHub.IsPrivate != chaosHub.IsPrivate || prevChaosHub.AuthType != chaosHub.AuthType.String() || prevChaosHub.RemoteHub != chaosHub.RemoteHub { err = os.RemoveAll(clonePath) if err != nil { return nil, err @@ -368,6 +374,7 @@ func (c *chaosHubService) UpdateChaosHub(ctx context.Context, chaosHub model.Upd {"$set", bson.D{ {"repo_url", chaosHub.RepoURL}, {"repo_branch", chaosHub.RepoBranch}, + {"remote_hub", chaosHub.RemoteHub}, {"name", chaosHub.Name}, {"description", chaosHub.Description}, {"tags", chaosHub.Tags}, @@ -454,6 +461,7 @@ func (c *chaosHubService) ListChaosFaults(ctx context.Context, hubID string, pro Name: hub.Name, RepoURL: hub.RepoURL, RepoBranch: hub.RepoBranch, + RemoteHub: hub.RemoteHub, } ChartsPath := handler.GetChartsPath(chartsInput, projectID, hub.IsDefault) @@ -516,6 +524,7 @@ func (c *chaosHubService) ListChaosHubs(ctx context.Context, projectID string, r }, RepoURL: defaultHub.RepoURL, RepoBranch: defaultHub.RepoBranch, + RemoteHub: defaultHub.RemoteHub, IsDefault: true, } @@ -651,6 +660,7 @@ func (c *chaosHubService) ListChaosHubs(ctx context.Context, projectID string, r UpdatedAt: strconv.Itoa(int(hub.UpdatedAt)), CreatedBy: &model.UserDetails{Username: hub.CreatedBy.Username}, UpdatedBy: &model.UserDetails{Username: hub.UpdatedBy.Username}, + RemoteHub: hub.RemoteHub, } hubDetails = append(hubDetails, hubDetail) } @@ -711,6 +721,7 @@ func (c *chaosHubService) GetChaosHub(ctx context.Context, chaosHubID string, pr UpdatedAt: strconv.Itoa(int(hub.UpdatedAt)), CreatedBy: &model.UserDetails{Username: hub.CreatedBy.Username}, UpdatedBy: &model.UserDetails{Username: hub.UpdatedBy.Username}, + RemoteHub: hub.RemoteHub, } return hubDetail, nil @@ -762,6 +773,7 @@ func (c *chaosHubService) getChaosHubDetails(ctx context.Context, hubID string, ProjectID: hub.ProjectID, RepoURL: hub.RepoURL, RepoBranch: hub.RepoBranch, + RemoteHub: hub.RemoteHub, AuthType: model.AuthType(hub.AuthType), Name: hub.Name, CreatedAt: strconv.Itoa(int(hub.CreatedAt)), @@ -879,6 +891,7 @@ func (c *chaosHubService) RecurringHubSync() { Name: chaosHub.Name, RepoURL: chaosHub.RepoURL, RepoBranch: chaosHub.RepoBranch, + RemoteHub: chaosHub.RemoteHub, IsPrivate: chaosHub.IsPrivate, AuthType: chaosHub.AuthType, Token: chaosHub.Token, diff --git a/chaoscenter/graphql/server/pkg/data-store/store.go b/chaoscenter/graphql/server/pkg/data-store/store.go index f101298ebe9..41336b021f7 100644 --- a/chaoscenter/graphql/server/pkg/data-store/store.go +++ b/chaoscenter/graphql/server/pkg/data-store/store.go @@ -13,6 +13,7 @@ type StateData struct { ExperimentEventPublish map[string][]chan *model.ExperimentRun ExperimentLog map[string]chan *model.PodLogResponse KubeObjectData map[string]chan *model.KubeObjectResponse + KubeNamespaceData map[string]chan *model.KubeNamespaceResponse Mutex *sync.Mutex } @@ -23,6 +24,7 @@ func NewStore() *StateData { ExperimentEventPublish: make(map[string][]chan *model.ExperimentRun), ExperimentLog: make(map[string]chan *model.PodLogResponse), KubeObjectData: make(map[string]chan *model.KubeObjectResponse), + KubeNamespaceData: make(map[string]chan *model.KubeNamespaceResponse), Mutex: &sync.Mutex{}, } } diff --git a/chaoscenter/graphql/server/pkg/database/mongodb/chaos_hub/schema.go b/chaoscenter/graphql/server/pkg/database/mongodb/chaos_hub/schema.go index 7e8205f1192..ed387474dcd 100644 --- a/chaoscenter/graphql/server/pkg/database/mongodb/chaos_hub/schema.go +++ b/chaoscenter/graphql/server/pkg/database/mongodb/chaos_hub/schema.go @@ -15,6 +15,7 @@ type ChaosHub struct { mongodb.Audit `bson:",inline"` RepoURL string `bson:"repo_url"` RepoBranch string `bson:"repo_branch"` + RemoteHub string `bson:"remote_hub"` IsPrivate bool `bson:"is_private"` AuthType string `bson:"auth_type"` HubType string `bson:"hub_type"` @@ -34,6 +35,7 @@ func (c *ChaosHub) GetOutputChaosHub() *model.ChaosHub { ProjectID: c.ProjectID, RepoURL: c.RepoURL, RepoBranch: c.RepoBranch, + RemoteHub: c.RemoteHub, Name: c.Name, Description: &c.Description, Tags: c.Tags, diff --git a/chaoscenter/graphql/server/pkg/gitops/gitops.go b/chaoscenter/graphql/server/pkg/gitops/gitops.go index c7b2afda308..8065ace8c30 100644 --- a/chaoscenter/graphql/server/pkg/gitops/gitops.go +++ b/chaoscenter/graphql/server/pkg/gitops/gitops.go @@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/litmuschaos/litmus/chaoscenter/graphql/server/utils" + "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" @@ -184,7 +186,7 @@ func (c GitConfig) getAuthMethod() (transport.AuthMethod, error) { case model.AuthTypeToken: return &http.BasicAuth{ - Username: "litmus", // this can be anything except an empty string + Username: utils.Config.GitUsername, // must be a non-empty string or 'x-token-auth' for Bitbucket Password: *c.Token, }, nil diff --git a/chaoscenter/graphql/server/utils/variables.go b/chaoscenter/graphql/server/utils/variables.go index 678c7feb731..3818dc211f4 100644 --- a/chaoscenter/graphql/server/utils/variables.go +++ b/chaoscenter/graphql/server/utils/variables.go @@ -30,6 +30,7 @@ type Configuration struct { GrpcPort string `split_words:"true" default:"8000"` InfraCompatibleVersions string `required:"true" split_words:"true"` DefaultHubGitURL string `required:"true" default:"https://github.com/litmuschaos/chaos-charts"` + GitUsername string `required:"true" split_words:"true" default:"litmus"` DefaultHubBranchName string `required:"true" split_words:"true"` CustomChaosHubPath string `split_words:"true" default:"/tmp/"` DefaultChaosHubPath string `split_words:"true" default:"/tmp/default/"` diff --git a/chaoscenter/subscriber/pkg/k8s/defination.go b/chaoscenter/subscriber/pkg/k8s/defination.go index 68b2a24883f..2adac87f32c 100644 --- a/chaoscenter/subscriber/pkg/k8s/defination.go +++ b/chaoscenter/subscriber/pkg/k8s/defination.go @@ -18,10 +18,13 @@ type SubscriberK8s interface { CreatePodLog(podLog types.PodLogRequest) (types.PodLog, error) SendPodLogs(infraData map[string]string, podLog types.PodLogRequest) GenerateLogPayload(cid, accessKey, version string, podLog types.PodLogRequest) ([]byte, error) - GetKubernetesObjects(request types.KubeObjRequest) ([]*types.KubeObject, error) + GetKubernetesNamespaces(request types.KubeNamespaceRequest) ([]*types.KubeNamespace, error) + GetKubernetesObjects(request types.KubeObjRequest) (*types.KubeObject, error) GetObjectDataByNamespace(namespace string, dynamicClient dynamic.Interface, resourceType schema.GroupVersionResource) ([]types.ObjectData, error) GenerateKubeObject(cid string, accessKey, version string, kubeobjectrequest types.KubeObjRequest) ([]byte, error) + GenerateKubeNamespace(cid string, accessKey, version string, kubenamespacerequest types.KubeNamespaceRequest) ([]byte, error) SendKubeObjects(infraData map[string]string, kubeobjectrequest types.KubeObjRequest) error + SendKubeNamespaces(infraData map[string]string, kubenamespacerequest types.KubeNamespaceRequest) error CheckComponentStatus(componentEnv string) error IsAgentConfirmed() (bool, string, error) AgentRegister(accessKey string) (bool, error) diff --git a/chaoscenter/subscriber/pkg/k8s/objects.go b/chaoscenter/subscriber/pkg/k8s/objects.go index 143ea9f3785..d23bd51466f 100644 --- a/chaoscenter/subscriber/pkg/k8s/objects.go +++ b/chaoscenter/subscriber/pkg/k8s/objects.go @@ -23,63 +23,72 @@ var ( InfraScope = os.Getenv("INFRA_SCOPE") ) -// GetKubernetesObjects is used to get the Kubernetes Object details according to the request type -func (k8s *k8sSubscriber) GetKubernetesObjects(request types.KubeObjRequest) ([]*types.KubeObject, error) { - conf, err := k8s.GetKubeConfig() - if err != nil { - return nil, err - } - clientset, err := kubernetes.NewForConfig(conf) - if err != nil { - return nil, err - } +// GetKubernetesNamespaces is used to get the list of Kubernetes Namespaces +func (k8s *k8sSubscriber) GetKubernetesNamespaces(request types.KubeNamespaceRequest) ([]*types.KubeNamespace, error) { - resourceType := schema.GroupVersionResource{ - Group: request.KubeGVRRequest.Group, - Version: request.KubeGVRRequest.Version, - Resource: request.KubeGVRRequest.Resource, - } - _, dynamicClient, err := k8s.GetDynamicAndDiscoveryClient() - if err != nil { - return nil, err - } - var ObjData []*types.KubeObject + var namespaceData []*types.KubeNamespace if strings.ToLower(InfraScope) == "namespace" { - dataList, err := k8s.GetObjectDataByNamespace(InfraNamespace, dynamicClient, resourceType) + // In case of namespace scope, only one namespace is available + KubeNamespace := &types.KubeNamespace{ + Name: InfraNamespace, + } + namespaceData = append(namespaceData, KubeNamespace) + } else { + // In case of cluster scope, get all the namespaces + conf, err := k8s.GetKubeConfig() if err != nil { return nil, err } - KubeObj := &types.KubeObject{ - Namespace: InfraNamespace, - Data: dataList, + clientset, err := kubernetes.NewForConfig(conf) + if err != nil { + return nil, err } - ObjData = append(ObjData, KubeObj) - } else { + namespace, err := clientset.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{}) if err != nil { return nil, err } - if len(namespace.Items) > 0 { for _, namespace := range namespace.Items { - podList, err := k8s.GetObjectDataByNamespace(namespace.GetName(), dynamicClient, resourceType) - if err != nil { - return nil, err - } - KubeObj := &types.KubeObject{ - Namespace: namespace.GetName(), - Data: podList, + + KubeNamespace := &types.KubeNamespace{ + Name: namespace.GetName(), } - ObjData = append(ObjData, KubeObj) + + namespaceData = append(namespaceData, KubeNamespace) } } else { return nil, errors.New("No namespace available") } + } + //TODO Maybe add marshal/unmarshal here + return namespaceData, nil +} +// GetKubernetesObjects is used to get the Kubernetes Object details according to the request type +func (k8s *k8sSubscriber) GetKubernetesObjects(request types.KubeObjRequest) (*types.KubeObject, error) { + resourceType := schema.GroupVersionResource{ + Group: request.KubeGVRRequest.Group, + Version: request.KubeGVRRequest.Version, + Resource: request.KubeGVRRequest.Resource, } - kubeData, _ := json.Marshal(ObjData) - var kubeObjects []*types.KubeObject + _, dynamicClient, err := k8s.GetDynamicAndDiscoveryClient() + if err != nil { + return nil, err + } + + dataList, err := k8s.GetObjectDataByNamespace(request.Namespace, dynamicClient, resourceType) + if err != nil { + return nil, err + } + KubeObj := &types.KubeObject{ + Namespace: InfraNamespace, + Data: dataList, + } + + kubeData, _ := json.Marshal(KubeObj) + var kubeObjects *types.KubeObject err = json.Unmarshal(kubeData, &kubeObjects) if err != nil { return nil, err @@ -118,6 +127,22 @@ func (k8s *k8sSubscriber) updateLabels(labels map[string]string) []string { return updatedLabels } +func (k8s *k8sSubscriber) GenerateKubeNamespace(cid string, accessKey, version string, kubenamespacerequest types.KubeNamespaceRequest) ([]byte, error) { + infraID := `{infraID: \"` + cid + `\", version: \"` + version + `\", accessKey: \"` + accessKey + `\"}` + kubeObj, err := k8s.GetKubernetesNamespaces(kubenamespacerequest) + if err != nil { + return nil, err + } + processed, err := k8s.gqlSubscriberServer.MarshalGQLData(kubeObj) + if err != nil { + return nil, err + } + mutation := `{ infraID: ` + infraID + `, requestID:\"` + kubenamespacerequest.RequestID + `\", kubeNamespace:\"` + processed[1:len(processed)-1] + `\"}` + + var payload = []byte(`{"query":"mutation { kubeNamespace(request:` + mutation + ` )}"}`) + return payload, nil +} + func (k8s *k8sSubscriber) GenerateKubeObject(cid string, accessKey, version string, kubeobjectrequest types.KubeObjRequest) ([]byte, error) { infraID := `{infraID: \"` + cid + `\", version: \"` + version + `\", accessKey: \"` + accessKey + `\"}` kubeObj, err := k8s.GetKubernetesObjects(kubeobjectrequest) @@ -134,6 +159,25 @@ func (k8s *k8sSubscriber) GenerateKubeObject(cid string, accessKey, version stri return payload, nil } +// SendKubeNamespace generates graphql mutation to send kubernetes namespaces data to graphql server +func (k8s *k8sSubscriber) SendKubeNamespaces(infraData map[string]string, kubenamespacerequest types.KubeNamespaceRequest) error { + // generate graphql payload + payload, err := k8s.GenerateKubeNamespace(infraData["INFRA_ID"], infraData["ACCESS_KEY"], infraData["VERSION"], kubenamespacerequest) + if err != nil { + logrus.WithError(err).Print("Error while getting KubeObject Data") + return err + } + + body, err := k8s.gqlSubscriberServer.SendRequest(infraData["SERVER_ADDR"], payload) + if err != nil { + logrus.Print(err.Error()) + return err + } + + logrus.Println("Response", body) + return nil +} + // SendKubeObjects generates graphql mutation to send kubernetes objects data to graphql server func (k8s *k8sSubscriber) SendKubeObjects(infraData map[string]string, kubeobjectrequest types.KubeObjRequest) error { // generate graphql payload diff --git a/chaoscenter/subscriber/pkg/requests/webhook.go b/chaoscenter/subscriber/pkg/requests/webhook.go index 1407d6e44f4..cafea2d921a 100644 --- a/chaoscenter/subscriber/pkg/requests/webhook.go +++ b/chaoscenter/subscriber/pkg/requests/webhook.go @@ -120,6 +120,21 @@ func (req *subscriberRequests) RequestProcessor(infraData map[string]string, r t return errors.New("error getting kubernetes object data: " + err.Error()) } } + if strings.Index("kubenamespace kubenamespaces", strings.ToLower(r.Payload.Data.InfraConnect.Action.RequestType)) >= 0 { + KubeNamespaceRequest := types.KubeNamespaceRequest{ + RequestID: r.Payload.Data.InfraConnect.Action.RequestID, + } + + err := json.Unmarshal([]byte(r.Payload.Data.InfraConnect.Action.ExternalData), &KubeNamespaceRequest) + if err != nil { + return errors.New("failed to json unmarshal: " + err.Error()) + } + + err = req.subscriberK8s.SendKubeNamespaces(infraData, KubeNamespaceRequest) + if err != nil { + return errors.New("error getting kubernetes namespace data: " + err.Error()) + } + } if strings.ToLower(r.Payload.Data.InfraConnect.Action.RequestType) == "logs" { podRequest := types.PodLogRequest{ RequestID: r.Payload.Data.InfraConnect.Action.RequestID, diff --git a/chaoscenter/subscriber/pkg/types/kubeobject.go b/chaoscenter/subscriber/pkg/types/kubeobject.go index e862cc0b875..baa917a76e5 100644 --- a/chaoscenter/subscriber/pkg/types/kubeobject.go +++ b/chaoscenter/subscriber/pkg/types/kubeobject.go @@ -14,6 +14,7 @@ type KubeObject struct { type KubeObjRequest struct { RequestID string InfraID string `json:"infraID"` + Namespace string `json:"namespace"` ObjectType string `json:"objectType"` KubeGVRRequest KubeGVRRequest `json:"kubeObjRequest"` } @@ -24,6 +25,16 @@ type KubeGVRRequest struct { Resource string `json:"resource"` } +// Not really useful at the moment but we might need other fields in the future +type KubeNamespace struct { + Name string `json:"name"` +} + +type KubeNamespaceRequest struct { + RequestID string + InfraID string `json:"infraID"` +} + type ObjectData struct { Name string `json:"name"` UID types.UID `json:"uid"` diff --git a/chaoscenter/upgrade-agents/control-plane/CONTRIBUTING.MD b/chaoscenter/upgrade-agents/control-plane/CONTRIBUTING.MD new file mode 100644 index 00000000000..6f4aedf01c1 --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/CONTRIBUTING.MD @@ -0,0 +1,73 @@ +## Steps to Contribute + +Fixes and improvements can be directly addressed by sending a Pull Request on GitHub. Pull requests will be reviewed by one or more maintainers and merged when acceptable. + +We ask that before contributing, please make the effort to coordinate with the maintainers of the project before submitting large or high impact PRs. This will prevent you from doing extra work that may or may not be merged. + +Use your judgement about what constitutes a large change. If you aren't sure, send a message to the **#litmus-dev** slack or submit an issue on GitHub. + + +### **Sign your work with Developer Certificate of Origin** + +To contribute to this project, you must agree to the Developer Certificate of Origin (DCO) for each commit you make. The DCO is a simple statement that you, as a contributor, have the legal right to make the contribution. + +See the [DCO](https://developercertificate.org/) file for the full text of what you must agree to. + +To successfully sign off your contribution you just add a line to every git commit message: + +```git +Signed-off-by: Joe Smith +``` + +Use your real name (sorry, no pseudonyms or anonymous contributions.) + +If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. You can also use git [aliases](https://git-scm.com/book/tr/v2/Git-Basics-Git-Aliases) like `git config --global alias.ci 'commit -s'`. Now you can commit with git ci and the commit will be signed. + +## **Development Guide** + +Start MongoDB, Auth and GraphQL server as mentioned in the [ChaosCenter Development Guide](https://github.com/litmuschaos/litmus/wiki/ChaosCenter-Development-Guide) to set up the basic structure of the DB. Then start the upgrade manager located in `chaoscenter/upgrade-agents/control-plane` by setting up the environment variables + +``` +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export VERSION= +``` +To run the upgrade-manager, run + +``` +go run main.go +``` +The upgrade-manager would get the current version of Litmus through the DB. + +## **Version Upgrade Files** + +`/` folder contains files for the upgrade logic + +- `upgrade-manager.go` - Contains a map of versions with their corresponding version-managers for the versions. +- `vx.y.z/manager.go` - Instantiates the Version Manager and runs the upgradeExecutor in transactions which can be omitted if the operation doesn't support a transaction. +- `vx.y.z/upgrade.go` - Contains the logic of upgradeExecutor of what schema changes are to be made in the specific version. + +There are some other files not mentioned here. + +## **Example: Upgrade to version 3.9.0** + +In version 3.9.0 the following changes are done in DB schema + +- In projects collection (auth DB), member role is updated from `Editor` to `Executor` +- New `is_initial_login` field in users collection (auth DB) whose value is set as false + +Run the upgrade-agent while specifying the version `VERSION=3.9.0` in the environmental variable, and it should now be upgraded. + +## **Best Practices** + +1) If upgrade volume is huge, then transaction is not favorable. +2) Split the upgrades into proprietary functions depending on their purpose and database/collection names. +3) Use logging techniques as used in other versions to provide the user an insight of how the upgrades are being done. +4) While using a transaction, make sure the session context is properly passed into the relevant mongo operations and related functions. +5) Script should be written in a way that even if run twice, should not affect the already updated documents. + + +Below is the basic technical flow for the upgrade-agent + +![image info](./Upgrade-Agent-Flow.png) \ No newline at end of file diff --git a/chaoscenter/upgrade-agents/control-plane/Upgrade-Agent-Flow.png b/chaoscenter/upgrade-agents/control-plane/Upgrade-Agent-Flow.png new file mode 100644 index 00000000000..8e086829573 Binary files /dev/null and b/chaoscenter/upgrade-agents/control-plane/Upgrade-Agent-Flow.png differ diff --git a/chaoscenter/upgrade-agents/control-plane/go.mod b/chaoscenter/upgrade-agents/control-plane/go.mod index b8378a44376..cb37ddf9401 100644 --- a/chaoscenter/upgrade-agents/control-plane/go.mod +++ b/chaoscenter/upgrade-agents/control-plane/go.mod @@ -1,29 +1,40 @@ -module github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane +module github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane go 1.22 require ( github.com/kelseyhightower/envconfig v1.4.0 - go.mongodb.org/mongo-driver v1.7.1 - go.uber.org/zap v1.18.1 + github.com/sirupsen/logrus v1.4.2 + go.mongodb.org/mongo-driver v1.11.9 +) + +require ( + github.com/jessevdk/go-flags v1.5.0 // indirect + github.com/montanaflynn/stats v0.7.1 // indirect + golang.org/x/exp v0.0.0-20240529005216-23cca8864a10 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/term v0.20.0 // indirect + gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) require ( github.com/go-stack/stack v1.8.0 // indirect - github.com/golang/snappy v0.0.1 // indirect - github.com/google/go-cmp v0.5.5 // indirect - github.com/klauspost/compress v1.9.5 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect + github.com/mongodb/mongo-tools v0.0.0-20240711192303-088725fbaf4b github.com/pkg/errors v0.9.1 // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.0.2 // indirect - github.com/xdg-go/stringprep v1.0.2 // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.7.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect - golang.org/x/text v0.14.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/chaoscenter/upgrade-agents/control-plane/go.sum b/chaoscenter/upgrade-agents/control-plane/go.sum index 421b34fb91b..1d8fb9b2637 100644 --- a/chaoscenter/upgrade-agents/control-plane/go.sum +++ b/chaoscenter/upgrade-agents/control-plane/go.sum @@ -1,6 +1,4 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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= @@ -32,10 +30,15 @@ github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/V github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= @@ -43,14 +46,22 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 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/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/mongodb/mongo-tools v0.0.0-20240711192303-088725fbaf4b h1:39IJuPXnaNCjLk6tMywL0OheXyx7S+BTIgn1LUwSrq8= +github.com/mongodb/mongo-tools v0.0.0-20240711192303-088725fbaf4b/go.mod h1:ZqxDY87qeUsPRQ/H8DAOhp4iQA2zQtn2zR/KmLSsA7U= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= +github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -63,6 +74,7 @@ github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -70,51 +82,63 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= +github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -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/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.mongodb.org/mongo-driver v1.11.9 h1:JY1e2WLxwNuwdBAPgQxjf4BWweUGP86lF55n89cGZVA= +go.mongodb.org/mongo-driver v1.11.9/go.mod h1:P8+TlbZtPFgjUrmnIF41z97iDnSMswJJu6cztZSlCTg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240529005216-23cca8864a10 h1:vpzMC/iZhYFAjJzHU0Cfuq+w1vLLsF2vLkDrPjzKYck= +golang.org/x/exp v0.0.0-20240529005216-23cca8864a10/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/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-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -122,32 +146,50 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= 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/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 h1:yiW+nvdHb9LVqSHQBXfZCieqV4fzYhNBql77zY0ykqs= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= gopkg.in/yaml.v2 v2.2.8/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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/chaoscenter/upgrade-agents/control-plane/main.go b/chaoscenter/upgrade-agents/control-plane/main.go index 6882940796f..df8a2577797 100644 --- a/chaoscenter/upgrade-agents/control-plane/main.go +++ b/chaoscenter/upgrade-agents/control-plane/main.go @@ -2,13 +2,11 @@ package main import ( "log" - "os" - "strings" "github.com/kelseyhightower/envconfig" - "github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane/pkg/database" - "github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane/versions" - "go.uber.org/zap" + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/pkg/database" + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/versions" + logger "github.com/sirupsen/logrus" ) type Config struct { @@ -28,35 +26,23 @@ func init() { } func main() { - // logging level, dev mode enables debug logs - dev := os.Getenv("DEV_MODE") - var logger *zap.Logger - var err error - - // set log level - if strings.ToLower(dev) == "true" { - logger, err = zap.NewDevelopment() - } else { - logger, err = zap.NewProduction() - } - if err != nil { - log.Fatal("failed to create logger") - } // create database connection + var err error + logger := logger.New() dbClient, err := database.Connect() if err != nil { - logger.Fatal("failed to get db client", zap.Error(err)) + logger.WithError(err).Fatal("failed to get db client") } // create new upgrade manager mg, err := versions.NewUpgradeManager(logger, dbClient) if err != nil { - logger.Fatal("failed to create upgrade manager", zap.Error(err)) + logger.WithError(err).Fatal("failed to create upgrade manager") } if mg != nil { // execute upgrade manager if err = mg.Run(); err != nil { - logger.Fatal("failed to run upgrade manager", zap.Error(err)) + logger.WithError(err).Fatal("failed to run upgrade manager") } } diff --git a/chaoscenter/upgrade-agents/control-plane/pkg/database/constants.go b/chaoscenter/upgrade-agents/control-plane/pkg/database/constants.go index 0f5d53fd3bf..1a56dcb3999 100644 --- a/chaoscenter/upgrade-agents/control-plane/pkg/database/constants.go +++ b/chaoscenter/upgrade-agents/control-plane/pkg/database/constants.go @@ -1,6 +1,13 @@ package database const ( - ServerConfigCollection = "server-config-collection" - DbName = "litmus" + ServerConfigCollection = "serverConfig" + LitmusDB = "litmus" + EnvironmentCollection = "environment" + ProjectCollection = "project" + DBUri = "mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" + AuthDB = "auth" + AdminDB = "admin" + UsersCollection = "users" + WorkflowCollection = "workflow-collection" ) diff --git a/chaoscenter/upgrade-agents/control-plane/pkg/database/mongo-export.go b/chaoscenter/upgrade-agents/control-plane/pkg/database/mongo-export.go new file mode 100644 index 00000000000..c453b96df0a --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/pkg/database/mongo-export.go @@ -0,0 +1,59 @@ +package database + +import ( + "log" + "os" + + "github.com/mongodb/mongo-tools/mongoexport" + "github.com/mongodb/mongo-tools/mongoimport" +) + +func Export(filename string, RawArgs []string) error { + file, err := os.Create(filename) + if err != nil { + return err + } + defer file.Close() + + Options, err := mongoexport.ParseOptions(RawArgs, "", "") + if err != nil { + return err + } + MongoExport, err := mongoexport.New(Options) + if err != nil { + return err + } + defer MongoExport.Close() + + _, err = MongoExport.Export(file) + if err != nil { + return err + } + + return nil +} + +func Import(filename string, RawArgs []string) error { + + Options, err := mongoimport.ParseOptions(RawArgs, "", "") + if err != nil { + return err + } + + MongoImport, err := mongoimport.New(Options) + if err != nil { + return err + } + defer MongoImport.Close() + + // Import documents into 'test' collection + success, failed, err := MongoImport.ImportDocuments() + if err != nil { + return err + } + if failed > 0 { + log.Fatal("Could not import documents", success) + } + + return nil +} diff --git a/chaoscenter/upgrade-agents/control-plane/pkg/database/server-config.go b/chaoscenter/upgrade-agents/control-plane/pkg/database/server-config.go index ba9b0ec2aaa..5d1612ddd8f 100644 --- a/chaoscenter/upgrade-agents/control-plane/pkg/database/server-config.go +++ b/chaoscenter/upgrade-agents/control-plane/pkg/database/server-config.go @@ -15,7 +15,7 @@ type ServerConfig struct { // GetVersion returns the control plane version that is stored in the ServerConfig collection func GetVersion(dbClient *mongo.Client) (ServerConfig, error) { - collection := dbClient.Database(DbName).Collection(ServerConfigCollection) + collection := dbClient.Database(LitmusDB).Collection(ServerConfigCollection) result := collection.FindOne(context.Background(), bson.D{ {"key", "version"}, }) @@ -27,7 +27,7 @@ func GetVersion(dbClient *mongo.Client) (ServerConfig, error) { // UpdateVersion updates the control plane version in the ServerConfig collection func UpdateVersion(dbClient *mongo.Client, version string) error { - collection := dbClient.Database(DbName).Collection(ServerConfigCollection) + collection := dbClient.Database(LitmusDB).Collection(ServerConfigCollection) _, err := collection.UpdateOne(context.Background(), bson.D{ {"key", "version"}, }, bson.D{{"$set", bson.D{{ diff --git a/chaoscenter/upgrade-agents/control-plane/test.txt b/chaoscenter/upgrade-agents/control-plane/test.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/chaoscenter/upgrade-agents/control-plane/versions/upgrade-manager.go b/chaoscenter/upgrade-agents/control-plane/versions/upgrade-manager.go index f904ad1d36f..fa6cf287658 100644 --- a/chaoscenter/upgrade-agents/control-plane/versions/upgrade-manager.go +++ b/chaoscenter/upgrade-agents/control-plane/versions/upgrade-manager.go @@ -3,14 +3,17 @@ package versions import ( "fmt" "os" + "sort" + "strconv" + "strings" - v2_6_0 "github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane/versions/v2.6.0" + v0_0_0 "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/versions/v0.0.0" - v2_4_0 "github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane/versions/v2.4.0" + v3_9_0 "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/versions/v3.9.0" - "github.com/litmuschaos/litmus/litmus-portal/upgrader-agents/control-plane/pkg/database" + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/pkg/database" + log "github.com/sirupsen/logrus" "go.mongodb.org/mongo-driver/mongo" - "go.uber.org/zap" ) // UpgradeExecutor holds the details regarding the version and IVersionManager for a particular version @@ -21,15 +24,70 @@ type UpgradeExecutor struct { // UpgradeManager provides the functionality required to upgrade from the PreviousVersion to the TargetVersion type UpgradeManager struct { - Logger *zap.Logger + Logger *log.Logger DBClient *mongo.Client - PreviousVersion string - TargetVersion string + PreviousVersion *Version + TargetVersion *Version +} + +type Version struct { + Major int + Minor int + Patch int + Beta int +} + +// Converts version from type string to type Version +// For example, "3.0.0-beta1" -> Version{Major: 3, Minor: 0, Patch: 0, Beta: 1} +// "3.1.0" -> Version{Major: 3, Minor: 1, Patch: 0, Beta: 0}, "3.1.1" -> Version{Major: 3, Minor: 1, Patch: 1, Beta: 0} +func ParseVersion(version string) *Version { + parts := strings.Split(version, "-beta") + mainParts := strings.Split(parts[0], ".") + + major, err := strconv.Atoi(mainParts[0]) + if err != nil { + return &Version{} + } + + minor, err := strconv.Atoi(mainParts[1]) + if err != nil { + return &Version{} + } + + mainPartsLength := len(mainParts) + + var patch int + + if mainPartsLength > 2 { + patch, err = strconv.Atoi(mainParts[2]) + if err != nil { + patch = 0 + } + } else { + patch = 0 + } + + if len(parts) > 1 { + beta, err := strconv.Atoi(parts[1]) + if err != nil { + return &Version{} + } + return &Version{Major: major, Minor: minor, Patch: patch, Beta: beta} + } else { + return &Version{Major: major, Minor: minor, Patch: patch, Beta: 0} + } } // NewUpgradeManager creates an instance of a upgrade manager with the proper configurations -func NewUpgradeManager(logger *zap.Logger, dbClient *mongo.Client) (*UpgradeManager, error) { +func NewUpgradeManager(logger *log.Logger, dbClient *mongo.Client) (*UpgradeManager, error) { + + // added for debug only to run version manager consistently + // database.UpdateVersion(dbClient, "3.3.0") + currentVersion := os.Getenv("VERSION") + log.WithFields(log.Fields{ + "targetVersion": currentVersion, + }).Info("About target version") if currentVersion == "" { return nil, fmt.Errorf("current version env data missing") } @@ -37,6 +95,11 @@ func NewUpgradeManager(logger *zap.Logger, dbClient *mongo.Client) (*UpgradeMana if err != nil { return nil, fmt.Errorf("failed to get previous version data from db, error=%w", err) } + + log.WithFields(log.Fields{ + "currentVersion": config.Value, + }).Info("About current version") + if config.Value == nil || config.Value.(string) == "" { return nil, fmt.Errorf("failed to get previous version data from db, value=%v", config.Value) } @@ -48,165 +111,135 @@ func NewUpgradeManager(logger *zap.Logger, dbClient *mongo.Client) (*UpgradeMana return &UpgradeManager{ Logger: logger, DBClient: dbClient, - PreviousVersion: config.Value.(string), - TargetVersion: currentVersion, + PreviousVersion: ParseVersion(config.Value.(string)), + TargetVersion: ParseVersion(currentVersion), }, nil } -// getUpgradePath returns a map that determines the possible upgrade path for any upgrade -func (m *UpgradeManager) getUpgradePath() map[string]UpgradeExecutor { +// getVersionMap returns a map that determines the possible upgrade path for any upgrade +func (m *UpgradeManager) getVersionMap() map[string]UpgradeExecutor { // key : previous version, // value :{ Version Manger that upgrades the system from priv version to next, NextVersion points to next version in the path} return map[string]UpgradeExecutor{ - "2.3.0": { - NextVersion: "2.4.0", - VersionManager: v2_4_0.NewVersionManger(m.Logger, m.DBClient), - }, - - "2.4.0": { - NextVersion: "2.5.0", - VersionManager: nil, - }, - - "2.5.0": { - NextVersion: "2.6.0", - VersionManager: v2_6_0.NewVersionManger(m.Logger, m.DBClient), - }, - - "2.6.0": { - NextVersion: "2.7.0", - VersionManager: nil, - }, - - "2.7.0": { - NextVersion: "2.8.0", - VersionManager: nil, - }, - - "2.8.0": { - NextVersion: "2.9.0", - VersionManager: nil, - }, - - "2.9.0": { - NextVersion: "2.10.0", - VersionManager: nil, - }, - - "2.10.0": { - NextVersion: "2.11.0", - VersionManager: nil, - }, - - "2.11.0": { - NextVersion: "2.12.0", - VersionManager: nil, + "0.0.0": { + NextVersion: "", + VersionManager: v0_0_0.NewVersionManger(m.Logger, m.DBClient), }, - - "2.12.0": { - NextVersion: "2.13.0", - VersionManager: nil, + "3.9.0": { + NextVersion: "", + VersionManager: v3_9_0.NewVersionManger(m.Logger, m.DBClient), }, + } +} - "2.13.0": { - NextVersion: "2.14.0", - VersionManager: nil, - }, +func arrayToVersion(versionArray []int) string { + if versionArray[3] == 0 { + return strconv.Itoa(versionArray[0]) + "." + strconv.Itoa(versionArray[1]) + "." + strconv.Itoa(versionArray[2]) + } else { + return strconv.Itoa(versionArray[0]) + "." + strconv.Itoa(versionArray[1]) + "." + strconv.Itoa(versionArray[2]) + "-beta" + strconv.Itoa(versionArray[3]) + } +} - "2.14.0": { - NextVersion: "3.0-beta1", - VersionManager: nil, - }, +func (v Version) getVersion() string { + if v.Beta != 0 { + return strconv.Itoa(v.Major) + "." + strconv.Itoa(v.Minor) + "." + strconv.Itoa(v.Patch) + "-beta" + strconv.Itoa(v.Beta) + } else { + return strconv.Itoa(v.Major) + "." + strconv.Itoa(v.Minor) + "." + strconv.Itoa(v.Patch) + } +} - "3.0-beta1": { - NextVersion: "3.0.0-beta2", - VersionManager: nil, - }, +// sortVersionArray sorts the version array containing the versions as strings in ascending order +func sortVersionArray(versionArray []string) []string { + var versionMatrix [][]int - "3.0.0-beta2": { - NextVersion: "3.0.0-beta3", - VersionManager: nil, - }, + for _, v := range versionArray { + var versionInt []int - "3.0.0-beta3": { - NextVersion: "3.0.0-beta4", - VersionManager: nil, - }, + version := ParseVersion(v) + versionInt = append(versionInt, version.Major, version.Minor, version.Patch, version.Beta) + versionMatrix = append(versionMatrix, versionInt) + } + sort.Slice(versionMatrix, func(i, j int) bool { + for k := 0; k < len(versionMatrix[i]) && k < len(versionMatrix[j]); k++ { + if versionMatrix[i][k] != versionMatrix[j][k] { + return versionMatrix[i][k] < versionMatrix[j][k] + } + } + return len(versionMatrix[i]) < len(versionMatrix[j]) + }) - "3.0.0-beta4": { - NextVersion: "3.0.0-beta5", - VersionManager: nil, - }, + var sortedVersionArray []string - "3.0.0-beta5": { - NextVersion: "3.0.0-beta6", - VersionManager: nil, - }, + for _, v := range versionMatrix { + sortedVersionArray = append(sortedVersionArray, arrayToVersion(v)) + } + // Print the sorted matrixay + return sortedVersionArray +} - "3.0.0-beta6": { - NextVersion: "3.0.0-beta7", - VersionManager: nil, - }, +func parseVersionMap(m map[string]UpgradeExecutor, previousVersion string, targetVersion string) []string { + var versions []string + for version := range m { + versions = append(versions, version) + } + _, okP := m[previousVersion] + _, okT := m[targetVersion] - "3.0.0-beta7": { - NextVersion: "3.0.0-beta8", - VersionManager: nil, - }, + if !okP { + versions = append(versions, previousVersion) + } - // latest version, no more upgrades available - "3.0.0-beta8": { - NextVersion: "", - VersionManager: nil, - }, + if !okT { + versions = append(versions, targetVersion) } + return sortVersionArray(versions) } -// verifyPath verifies whether the current upgrade from PreviousVersion to TargetVersion -// is possible given the configured upgrade path -func (m *UpgradeManager) verifyPath(upgradePath map[string]UpgradeExecutor) error { - - _, okP := upgradePath[m.PreviousVersion] - _, okT := upgradePath[m.TargetVersion] +func linearSearchArray(version string, versionMapArray []string) int { - if !okP && !okT { - return fmt.Errorf("previous version=%v or target version=%v not found in upgrade path", m.PreviousVersion, m.TargetVersion) - } - versionIterator := m.PreviousVersion - for versionIterator != "" { - versionIterator = upgradePath[versionIterator].NextVersion - if versionIterator == m.TargetVersion { - return nil + for i, v := range versionMapArray { + if v == version { + return i } } - return fmt.Errorf("upgrade path not found from previous version=%v to target version=%v", m.PreviousVersion, m.TargetVersion) + return -1 +} + +// traceUpgradePath traces the upgrade path between the two versions by taking in them and the map +func traceUpgradePath(previousVersion Version, targetVersion Version, getVersionMap map[string]UpgradeExecutor) []string { + versionStringMap := parseVersionMap(getVersionMap, previousVersion.getVersion(), targetVersion.getVersion()) + + startIndex := linearSearchArray(previousVersion.getVersion(), versionStringMap) + endIndex := linearSearchArray(targetVersion.getVersion(), versionStringMap) + return versionStringMap[startIndex+1 : endIndex+1] } // Run executes all the steps required in the upgrade path from PreviousVersion to TargetVersion func (m *UpgradeManager) Run() error { - upgradePath := m.getUpgradePath() + versionMap := m.getVersionMap() - // verify if upgrade possible - if err := m.verifyPath(upgradePath); err != nil { - return err - } + upgradePath := traceUpgradePath(*m.PreviousVersion, *m.TargetVersion, versionMap) + log.WithFields(log.Fields{ + "upgradePath": upgradePath, + }).Info("Sequential upgrade path to be followed") - // start upgrade from previous version to target version - versionIterator := m.PreviousVersion - // loop till the target version is reached - for versionIterator != m.TargetVersion { - // Skipping schema upgrade, if version manager not available (Only version will be upgraded) - if upgradePath[versionIterator].VersionManager != nil { - if err := upgradePath[versionIterator].VersionManager.Run(); err != nil { - return fmt.Errorf("failed to upgrade to version %v, error : %w", versionIterator, err) + for _, v := range upgradePath { + + _, exists := versionMap[v] + if exists && versionMap[v].VersionManager != nil { + if err := versionMap[v].VersionManager.Run(); err != nil { + return fmt.Errorf("failed to upgrade to version %v, error : %w", v, err) } + database.UpdateVersion(m.DBClient, v) + log.WithFields(log.Fields{ + "version": v, + }).Info("Version upgraded to an intermediate version") } - versionIterator = upgradePath[versionIterator].NextVersion - } - - err := database.UpdateVersion(m.DBClient, m.TargetVersion) - if err != nil { - return fmt.Errorf("failed to update version in server config collection, error=%w", err) } + database.UpdateVersion(m.DBClient, upgradePath[len(upgradePath)-1]) + log.WithFields(log.Fields{ + "version": m.TargetVersion.getVersion(), + }).Info("Version upgrade successful") return nil } diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/manager.go b/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/manager.go new file mode 100644 index 00000000000..27009c8ce27 --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/manager.go @@ -0,0 +1,45 @@ +package v0_0_0 + +import ( + "context" + + log "github.com/sirupsen/logrus" + "go.mongodb.org/mongo-driver/mongo" +) + +/* Template for Upgrade Manager to be followed for introducing new upgrade files*/ + +// VersionManager implements IVersionManger +type VersionManager struct { + Logger *log.Logger + DBClient *mongo.Client + Context *context.Context +} + +// NewVersionManger provides a new instance of a new VersionManager +func NewVersionManger(logger *log.Logger, dbClient *mongo.Client) *VersionManager { + return &VersionManager{Logger: logger, DBClient: dbClient} +} + +// Run executes all the steps required for the Version Manger +// to upgrade from the previous version to `this` version +func (vm VersionManager) Run() error { + ctx := context.Background() + err := upgradeUsersCollection(vm.Logger, vm.DBClient, ctx) + if err != nil { + return err + } + + err = upgradeEnvironmentCollectionIndexes(vm.Logger, vm.DBClient, ctx) + if err != nil { + return err + } + + err = upgradeWorkflow(vm.Logger, vm.DBClient, ctx) + + if err != nil { + return err + } + + return err +} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/upgrade.go b/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/upgrade.go new file mode 100644 index 00000000000..23e6078870c --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/versions/v0.0.0/upgrade.go @@ -0,0 +1,143 @@ +package v0_0_0 + +// remove +import ( + "context" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/pkg/database" + log "github.com/sirupsen/logrus" +) + +/* This example upgrade renames auth collection users to client*/ + +func upgradeUsersCollection(logger *log.Logger, dbClient *mongo.Client, ctx context.Context) error { + + logVersion := log.Fields{ + "version": "0.0.0", + "database": database.AdminDB, + "collection": database.UsersCollection, + } + + res := dbClient.Database(database.AdminDB).RunCommand( + context.Background(), + bson.D{{"renameCollection", "auth.users"}, {"to", "auth.client"}}, + ) + if res.Err() != nil { + log.WithFields(logVersion).Fatal("Error while renaming collection 'auth.users' to 'auth.client'") + return res.Err() + } + + logger.WithFields(logVersion).Info("Users collection renamed to admin while upgrading to intermediate version v3.8.0") + + logger.WithFields(logVersion).Info("Collection 'auth.users' renamed to 'auth.client' successfully.") + + return nil +} + +func upgradeEnvironmentCollectionIndexes(logger *log.Logger, dbClient *mongo.Client, ctx context.Context) error { + var indexes []string + var environmentIDIndexName string + + environmentCollection := dbClient.Database(database.LitmusDB).Collection(database.EnvironmentCollection) + indexView := environmentCollection.Indexes() + cursor, err := indexView.List(ctx) + if err != nil { + log.Error("error listing indexes: %w", err) + return err + } + defer cursor.Close(ctx) + + environmentIDIndexExists := false + + logVersion := log.Fields{ + "version": "0.0.0", + "database": database.LitmusDB, + "collection": database.EnvironmentCollection, + } + + for cursor.Next(ctx) { + var index bson.M + if err := cursor.Decode(&index); err != nil { + log.Fatal("error decoding index: %w", err) + } + indexes = append(indexes, index["name"].(string)) + if keys, ok := index["key"].(bson.M); ok { + if _, found := keys["environment_id"]; found { + environmentIDIndexExists = true + environmentIDIndexName = index["name"].(string) + } + } + } + + logIndexes := log.Fields{ + "version": "3.4.0", + "database": database.LitmusDB, + "collection": database.EnvironmentCollection, + "indexes": indexes, + } + + logger.WithFields(logIndexes).Info("Indexes found in environment collection while upgrading to intermediate version v3.4.0") + + logFields := log.Fields{ + "collection": database.EnvironmentCollection, + "db": database.LitmusDB, + } + + if environmentIDIndexExists { + _, err := environmentCollection.Indexes().DropOne(ctx, environmentIDIndexName) + if err != nil { + log.Fatal("error dropping index: %w", err) + } + logger.WithFields(logFields).Info("Deleted an existing index in environment collection while upgrading to intermediate v3.4.0") + + indexModel := mongo.IndexModel{ + Keys: bson.M{"environment_id": 1}, + Options: options.Index(). + SetUnique(true). + SetPartialFilterExpression(bson.D{ + {"isRemoved", false}, + }), + } + + _, err = environmentCollection.Indexes().CreateOne(ctx, indexModel) + if err != nil { + log.Fatal("error creating index: %w", err) + } + + log.WithFields(logVersion).Info("Created a new index with partial filter expression environment_id while upgrading to intermediate v3.4.0") + + } else { + log.Fatal("environment id index not found in version v3.4.0") + } + + return nil +} + +func upgradeWorkflow(logger *log.Logger, dbClient *mongo.Client, ctx context.Context) error { + workflowCollection := dbClient.Database("litmus").Collection("workflow-collection") + + logVersion := log.Fields{ + "version": "0.0.0", + "database": database.LitmusDB, + "collection": database.WorkflowCollection, + } + + //delete the existing workflow_name index + _, err := workflowCollection.Indexes().DropOne(context.Background(), "workflow_name_1") + if err != nil { + logger.WithFields(logVersion).Fatal("Error while dropping workflow") + } + + //create a new workflow index with partial filter expression + _, err = workflowCollection.Indexes().CreateOne(context.Background(), + mongo.IndexModel{Keys: bson.M{"workflow_name": 1}, + Options: options.Index().SetUnique(true).SetPartialFilterExpression(bson.D{{ + "isRemoved", false, + }})}) + + return err +} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/auth.go b/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/auth.go deleted file mode 100644 index df30b0a8bb8..00000000000 --- a/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/auth.go +++ /dev/null @@ -1,62 +0,0 @@ -package v2_4_0 - -import ( - "context" - "fmt" - - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.uber.org/zap" -) - -// upgradeAuthDb: migrates project collection from litmus-db to auth-db, renames usercredentials collection to users" -func upgradeAuthDb(logger *zap.Logger, dbClient *mongo.Client) error { - - // migration of project collection to auth DB - projectLitmusCollection := dbClient.Database("litmus").Collection("project") //project collection from litmus DB - userLitmusCollection := dbClient.Database("litmus").Collection("user") // user collection from litmus DB - usersAuthCollection := dbClient.Database("auth").Collection("users") // users collection from auth DB - authDBProjectCollection := dbClient.Database("auth").Collection("project") // project collected in auth DB - - // fetching the projects from project collection in litmus DB - cursor, err := projectLitmusCollection.Find(context.Background(), bson.M{}) - if err != nil { - fmt.Errorf("Error in getting project collection: %w", err) - } - - var result []interface{} - if err := cursor.All(context.Background(), &result); err != nil { - fmt.Errorf("Error: %w", err) - } - - // inserting the project documents in project collection(auth DB) - _, err = authDBProjectCollection.InsertMany(context.TODO(), result) - if err != nil { - fmt.Errorf("Error: %w", err) - } - - // deleting project collection in litmus DB - err = projectLitmusCollection.Drop(context.Background()) - if err != nil { - fmt.Errorf("Error: %w", err) - } - - // deleting user collection in litmus DB - err = userLitmusCollection.Drop(context.Background()) - if err != nil { - fmt.Errorf("Error: %w", err) - } - - // deleting users collection in auth DB - err = usersAuthCollection.Drop(context.Background()) - if err != nil { - fmt.Errorf("Error: %w", err) - } - - // renaming usercredentials collection to users - res := dbClient.Database("admin").RunCommand(context.Background(), bson.D{{"renameCollection", "auth.usercredentials"}, {"to", "auth.users"}}) - if res.Err() != nil { - return res.Err() - } - return err -} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/manager.go b/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/manager.go deleted file mode 100644 index 9794896f752..00000000000 --- a/chaoscenter/upgrade-agents/control-plane/versions/v2.4.0/manager.go +++ /dev/null @@ -1,27 +0,0 @@ -package v2_4_0 - -import ( - "go.mongodb.org/mongo-driver/mongo" - "go.uber.org/zap" -) - -// VersionManager implements IVersionManger -type VersionManager struct { - Logger *zap.Logger - DBClient *mongo.Client -} - -// NewVersionManger provides a new instance of a new VersionManager -func NewVersionManger(logger *zap.Logger, dbClient *mongo.Client) *VersionManager { - return &VersionManager{Logger: logger, DBClient: dbClient} -} - -// Run executes all the steps required for the Version Manger -// to upgrade from the previous version to `this` version -func (vm VersionManager) Run() error { - if err := upgradeAuthDb(vm.Logger, vm.DBClient); err != nil { - return err - } - // other upgrade step ..... - return nil -} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/manager.go b/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/manager.go deleted file mode 100644 index 20ac2ae396e..00000000000 --- a/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/manager.go +++ /dev/null @@ -1,31 +0,0 @@ -package v2_6_0 - -import ( - "context" - "fmt" - - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "go.uber.org/zap" -) - -// upgradeWorkflowCollection updated the index related changes in workflow-collection -func upgradeWorkflowCollection(logger *zap.Logger, dbClient *mongo.Client) error { - workflowCollection := dbClient.Database("litmus").Collection("workflow-collection") - - //delete the existing workflow_name index - _, err := workflowCollection.Indexes().DropOne(context.Background(), "workflow_name_1") - if err != nil { - fmt.Errorf("error: %w", err) - } - - //create a new workflow index with partial filter expression - _, err = workflowCollection.Indexes().CreateOne(context.Background(), - mongo.IndexModel{Keys: bson.M{"workflow_name": 1}, - Options: options.Index().SetUnique(true).SetPartialFilterExpression(bson.D{{ - "isRemoved", false, - }})}) - - return err -} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/workflow.go b/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/workflow.go deleted file mode 100644 index 3db30f689af..00000000000 --- a/chaoscenter/upgrade-agents/control-plane/versions/v2.6.0/workflow.go +++ /dev/null @@ -1,26 +0,0 @@ -package v2_6_0 - -import ( - "go.mongodb.org/mongo-driver/mongo" - "go.uber.org/zap" -) - -// VersionManager implements IVersionManger -type VersionManager struct { - Logger *zap.Logger - DBClient *mongo.Client -} - -// NewVersionManger provides a new instance of a new VersionManager -func NewVersionManger(logger *zap.Logger, dbClient *mongo.Client) *VersionManager { - return &VersionManager{Logger: logger, DBClient: dbClient} -} - -// Run executes all the steps required for the Version Manger -// to upgrade from the previous version to `this` version -func (vm VersionManager) Run() error { - if err := upgradeWorkflowCollection(vm.Logger, vm.DBClient); err != nil { - return nil - } - return nil -} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/manager.go b/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/manager.go new file mode 100644 index 00000000000..0ba5ccddfc9 --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/manager.go @@ -0,0 +1,75 @@ +package v3_9_0 + +import ( + "context" + + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/pkg/database" + log "github.com/sirupsen/logrus" + "go.mongodb.org/mongo-driver/mongo" +) + +// VersionManager implements IVersionManger +type VersionManager struct { + Logger *log.Logger + DBClient *mongo.Client + Context *context.Context +} + +// NewVersionManger provides a new instance of a new VersionManager +func NewVersionManger(logger *log.Logger, dbClient *mongo.Client) *VersionManager { + return &VersionManager{Logger: logger, DBClient: dbClient} +} + +// Run executes all the steps required for the Version Manger +// to upgrade from the previous version to `this` version +func (vm VersionManager) Run() error { + ctx := context.Background() + session, err := vm.DBClient.StartSession() + + defer session.EndSession(ctx) + + logVersion := log.Fields{ + "version": "3.9.0", + "database": database.LitmusDB, + "collection": database.ProjectCollection, + } + + if err != nil { + // log.Fatal(logVersion, err) + log.WithFields(logVersion).Fatal("Error while starting session") + } + + defer session.EndSession(ctx) + + err = mongo.WithSession(ctx, session, func(sc mongo.SessionContext) error { + // Start the transaction + err := session.StartTransaction() + if err != nil { + log.Fatal("error starting transaction: %w", err) + } + + if err := upgradeProjectCollection(vm.Logger, vm.DBClient, sc); err != nil { + return err + } + + if err := upgradeUsersCollection(vm.Logger, vm.DBClient, sc); err != nil { + return err + } + // Commit the transaction + err = session.CommitTransaction(sc) + + if err != nil { + return err + } + + return nil + }) + if err != nil { + // Abort the transaction if it fails + abortError := session.AbortTransaction(ctx) + if abortError != nil { + log.Fatal("error committing transaction: %w", err) + } + } + return err +} diff --git a/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/upgrade.go b/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/upgrade.go new file mode 100644 index 00000000000..9e5abf8f3ee --- /dev/null +++ b/chaoscenter/upgrade-agents/control-plane/versions/v3.9.0/upgrade.go @@ -0,0 +1,89 @@ +package v3_9_0 + +import ( + "context" + + "github.com/litmuschaos/litmus/chaoscenter/upgrader-agents/control-plane/pkg/database" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + + log "github.com/sirupsen/logrus" +) + +const ( + oldRole = "Editor" + newRole = "Executor" +) + +func upgradeProjectCollection(logger *log.Logger, dbClient *mongo.Client, ctx context.Context) error { + + var err error + collection := dbClient.Database(database.AuthDB).Collection(database.ProjectCollection) + + // Update the role from Editor to Executor + filter := bson.M{"members.role": oldRole} + update := bson.M{ + "$set": bson.M{"members.$[elem].role": newRole}, + } + arrayFilters := options.Update().SetArrayFilters(options.ArrayFilters{ + Filters: []interface{}{ + bson.M{"elem.role": oldRole}, + }, + }) + + logFields := log.Fields{ + "version": "3.9.0", + "database": database.AuthDB, + "collection": database.ProjectCollection, + } + logger.WithFields(logFields).Info("Updating editor to executor") + updateResult, err := collection.UpdateMany(ctx, filter, update, arrayFilters) + if err != nil { + logger.WithFields(logFields).Fatal("Error while updating documents in version v3.9.0") + return err + } + + logUpdateDocuments := log.Fields{ + "documents_matched": updateResult.MatchedCount, + "documents_updated": updateResult.ModifiedCount, + "version": "3.9.0", + } + + logger.WithFields(logUpdateDocuments).Infof("Matched %v documents and updated %v documents in project collection", updateResult.MatchedCount, updateResult.ModifiedCount) + + return nil + +} + +func upgradeUsersCollection(logger *log.Logger, dbClient *mongo.Client, ctx context.Context) error { + usersCollection := dbClient.Database(database.AuthDB).Collection(database.UsersCollection) + + logFields := log.Fields{ + "version": "3.9.0", + "database": database.AuthDB, + "collection": database.UsersCollection, + } + + logger.WithFields(logFields).Info("Adding is_initial_login field") + + // Add the new field is_initial_lgin to all documents in Users Collection + filter := bson.M{} + update := bson.M{ + "$set": bson.M{"is_initial_login": false}, + } + + updateResult, err := usersCollection.UpdateMany(ctx, filter, update) + if err != nil { + logger.WithFields(logFields).Fatal("Error while updating documents in version v3.9.0: ", err) + return err + } + logDocumentsCount := log.Fields{ + "documents_matched": updateResult.MatchedCount, + "documents_updated": updateResult.ModifiedCount, + "version": "3.9.0", + } + + logger.WithFields(logDocumentsCount).Infof("Matched %v documents and updated %v documents in users collection.", updateResult.MatchedCount, updateResult.ModifiedCount) + return nil +} diff --git a/chaoscenter/web/Dockerfile b/chaoscenter/web/Dockerfile index 3c4c117f211..616d4e608a3 100644 --- a/chaoscenter/web/Dockerfile +++ b/chaoscenter/web/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10 RUN microdnf module enable nginx:1.20 RUN microdnf install nginx RUN microdnf update --refresh --best --noplugins --setopt=install_weak_deps=0 diff --git a/chaoscenter/web/src/api/core/chaoshubs/addChaosHub.ts b/chaoscenter/web/src/api/core/chaoshubs/addChaosHub.ts index 74a8a6d2e75..c6c36465335 100644 --- a/chaoscenter/web/src/api/core/chaoshubs/addChaosHub.ts +++ b/chaoscenter/web/src/api/core/chaoshubs/addChaosHub.ts @@ -8,6 +8,7 @@ export interface CreateChaosHubRequest { description?: string; repoURL: string; repoBranch: string; + remoteHub: string; isPrivate: boolean; authType: AuthType; token?: string; @@ -36,6 +37,7 @@ export function addChaosHub( name repoURL repoBranch + remoteHub hubType isPrivate } diff --git a/chaoscenter/web/src/api/core/chaoshubs/listChaosHub.ts b/chaoscenter/web/src/api/core/chaoshubs/listChaosHub.ts index 904adb08910..a66ed07f41c 100644 --- a/chaoscenter/web/src/api/core/chaoshubs/listChaosHub.ts +++ b/chaoscenter/web/src/api/core/chaoshubs/listChaosHub.ts @@ -34,6 +34,7 @@ export function listChaosHub({ id repoURL repoBranch + remoteHub authType isAvailable totalFaults diff --git a/chaoscenter/web/src/api/core/chaoshubs/updateChaosHub.ts b/chaoscenter/web/src/api/core/chaoshubs/updateChaosHub.ts index 37015347f56..3c9fdbea6da 100644 --- a/chaoscenter/web/src/api/core/chaoshubs/updateChaosHub.ts +++ b/chaoscenter/web/src/api/core/chaoshubs/updateChaosHub.ts @@ -8,6 +8,7 @@ interface EditChaosHubRequest { tags: string[]; description?: string; repoURL: string; + remoteHub: string; repoBranch: string; isPrivate: boolean; authType: AuthType; @@ -37,6 +38,7 @@ export function updateChaosHub( name repoURL repoBranch + remoteHub } } `, diff --git a/chaoscenter/web/src/api/core/infrastructures/getKubeObject.ts b/chaoscenter/web/src/api/core/infrastructures/getKubeObject.ts index b3129ae1dff..54deef519fc 100644 --- a/chaoscenter/web/src/api/core/infrastructures/getKubeObject.ts +++ b/chaoscenter/web/src/api/core/infrastructures/getKubeObject.ts @@ -12,13 +12,14 @@ export interface KubeObjRequest { infraID: string; objectType: string; kubeObjRequest?: KubeGVRRequest; + namespace: string; }; } export interface KubeObjResponse { getKubeObject: { infraID: string; - kubeObj: Array; + kubeObj: KubeObj; }; } @@ -32,13 +33,30 @@ interface KubeObjData { name: string; } -export function kubeObjectSubscription({ +interface KubeNamespace { + name: string; +} + +export interface KubeNamespaceRequest { + request: { + infraID: string; + }; +} + +export interface KubeNamespaceResponse { + getKubeNamespace: { + infraID: string; + kubeNamespace: Array; + }; +} + +export const kubeObjectSubscription = ({ request, ...options }: GqlAPISubscriptionRequest): GqlAPISubscriptionResponse< KubeObjResponse, KubeObjRequest -> { +> => { const { data, loading, error } = useSubscription( gql` subscription getKubeObject($request: KubeObjectRequest!) { @@ -59,6 +77,7 @@ export function kubeObjectSubscription({ request: { infraID: request.infraID, kubeObjRequest: request.kubeObjRequest, + namespace: request.namespace, objectType: request.objectType } }, @@ -67,4 +86,35 @@ export function kubeObjectSubscription({ ); return { data, loading, error }; -} +}; + +export const kubeNamespaceSubscription = ({ + request, + ...options +}: GqlAPISubscriptionRequest): GqlAPISubscriptionResponse< + KubeNamespaceResponse, + KubeNamespaceRequest +> => { + const { data, loading, error } = useSubscription( + gql` + subscription getKubeNamespace($request: KubeNamespaceRequest!) { + getKubeNamespace(request: $request) { + infraID + kubeNamespace { + name + } + } + } + `, + { + variables: { + request: { + infraID: request.infraID + } + }, + ...options + } + ); + + return { data, loading, error }; +}; diff --git a/chaoscenter/web/src/api/entities/chaoshub.ts b/chaoscenter/web/src/api/entities/chaoshub.ts index 0a566de63b2..c06450bfe93 100644 --- a/chaoscenter/web/src/api/entities/chaoshub.ts +++ b/chaoscenter/web/src/api/entities/chaoshub.ts @@ -27,6 +27,7 @@ export interface ChaosHub extends Audit, ResourceDetails { id: string; repoURL: string; repoBranch: string; + remoteHub: string; projectID: string; name: string; tags?: [string]; diff --git a/chaoscenter/web/src/api/entities/environment.ts b/chaoscenter/web/src/api/entities/environment.ts index 7341b84f50e..86fd89b41cf 100644 --- a/chaoscenter/web/src/api/entities/environment.ts +++ b/chaoscenter/web/src/api/entities/environment.ts @@ -23,3 +23,9 @@ export interface EnvironmentSortInput { field: SortType; ascending: boolean; } + +export interface EnvironmentDetail { + envName: string; + envID: string; + totalInfra?: number | null; +} diff --git a/chaoscenter/web/src/constants/validation.ts b/chaoscenter/web/src/constants/validation.ts index 39d68029c28..a03d51e26f5 100644 --- a/chaoscenter/web/src/constants/validation.ts +++ b/chaoscenter/web/src/constants/validation.ts @@ -6,7 +6,7 @@ export const USERNAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_-]{2,15}$/; // ^(?=.*[a-z]) # At least one lowercase letter // (?=.*[A-Z]) # At least one uppercase letter // (?=.*\d) # At least one digit -// (?=.*[@$!%*?_&]) # At least one special character @$!%*?_& -// [A-Za-z\d@$!%*?_&] # Allowed characters: letters, digits, special characters @$!%*?_& +// (?=.*[@$!%*?_&#]) # At least one special character @$!%*?_&# +// [A-Za-z\d@$!%*?_&#] # Allowed characters: letters, digits, special characters @$!%*?_&# // {8,16}$ # Length between 8 to 16 characters -export const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?_&])[A-Za-z\d@$!%*?_&]{8,16}$/; +export const PASSWORD_REGEX = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?_&#])[A-Za-z\d@$!%*?_&#]{8,16}$/; diff --git a/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureReferenceField/KubernetesChaosInfrastructureReferenceField.tsx b/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureReferenceField/KubernetesChaosInfrastructureReferenceField.tsx index f7fe8c48d04..e4702f2d01f 100644 --- a/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureReferenceField/KubernetesChaosInfrastructureReferenceField.tsx +++ b/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureReferenceField/KubernetesChaosInfrastructureReferenceField.tsx @@ -3,31 +3,55 @@ import React from 'react'; import { listChaosInfra } from '@api/core'; import { getScope } from '@utils'; import ChaosInfrastructureReferenceFieldView from '@views/ChaosInfrastructureReferenceField'; -import type { ChaosInfrastructureReferenceFieldProps } from '@models'; +import { AllEnv, type ChaosInfrastructureReferenceFieldProps } from '@models'; import type { InfrastructureDetails } from '@views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField'; +import { listEnvironment } from '@api/core/environments'; function KubernetesChaosInfrastructureReferenceFieldController({ setFieldValue, - initialInfrastructureID + initialInfrastructureID, + initialEnvironmentID }: ChaosInfrastructureReferenceFieldProps): React.ReactElement { const scope = getScope(); const { showError } = useToaster(); const [searchInfrastructure, setSearchInfrastructure] = React.useState(''); - const [page, setPage] = React.useState(0); - const limit = 8; + const [limit, setLimit] = React.useState(5); + const [envID, setEnvID] = React.useState(AllEnv.AllEnv); + const [initialAllInfrastructureLength, setInitialAllInfrastructureLength] = React.useState(0); const { data: listChaosInfraData, loading: listChaosInfraLoading } = listChaosInfra({ ...scope, - filter: { name: searchInfrastructure, isActive: true }, + environmentIDs: envID === AllEnv.AllEnv ? undefined : [envID], + filter: { name: searchInfrastructure }, pagination: { page, limit }, options: { onError: error => showError(error.message) } }); + const { data: listEnvironmentData } = listEnvironment({ + ...scope, + options: { + onError: err => showError(err.message) + } + }); + + const environmentList = listEnvironmentData?.listEnvironments?.environments; + + React.useEffect(() => { + if (envID === AllEnv.AllEnv) { + setInitialAllInfrastructureLength(listChaosInfraData?.listInfras.totalNoOfInfras || 0); + } + }, [listChaosInfraData]); + + const preSelectedEnvironment = listEnvironmentData?.listEnvironments?.environments?.find( + ({ environmentID }) => environmentID === initialEnvironmentID + ); + // TODO: replace with get API as this becomes empty during edit const preSelectedInfrastructure = listChaosInfraData?.listInfras.infras.find( ({ infraID }) => infraID === initialInfrastructureID ); + const preSelectedInfrastructureDetails: InfrastructureDetails | undefined = preSelectedInfrastructure && { id: preSelectedInfrastructure?.infraID, name: preSelectedInfrastructure?.name, @@ -38,6 +62,16 @@ function KubernetesChaosInfrastructureReferenceFieldController({ environmentID: preSelectedInfrastructure?.environmentID }; + React.useEffect(() => { + setPage(0); + }, [envID]); + + React.useEffect(() => { + if (preSelectedEnvironment) { + setEnvID(preSelectedEnvironment?.environmentID); + } + }, [preSelectedEnvironment, setFieldValue]); + React.useEffect(() => { if (preSelectedInfrastructure) { setFieldValue('chaosInfrastructure.id', preSelectedInfrastructure.infraID, true); @@ -69,7 +103,10 @@ function KubernetesChaosInfrastructureReferenceFieldController({ pageSize={limit} pageCount={Math.ceil(totalNoOfInfras / limit)} pageIndex={page} - gotoPage={pageNumber => setPage(pageNumber)} + gotoPage={setPage} + showPagination={true} + pageSizeOptions={[5, 10, 15]} + onPageSizeChange={setLimit} /> ); }; @@ -87,6 +124,10 @@ function KubernetesChaosInfrastructureReferenceFieldController({ }} searchInfrastructure={searchInfrastructure} setSearchInfrastructure={setSearchInfrastructure} + allInfrastructureLength={initialAllInfrastructureLength} + environmentList={environmentList} + envID={envID} + setEnvID={setEnvID} loading={{ listChaosInfra: listChaosInfraLoading }} diff --git a/chaoscenter/web/src/controllers/TargetApplicationTab/TargetApplicationTab.tsx b/chaoscenter/web/src/controllers/TargetApplicationTab/TargetApplicationTab.tsx index bf7089b2add..059482d2e3b 100644 --- a/chaoscenter/web/src/controllers/TargetApplicationTab/TargetApplicationTab.tsx +++ b/chaoscenter/web/src/controllers/TargetApplicationTab/TargetApplicationTab.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { KubeGVRRequest, kubeObjectSubscription } from '@api/core'; +import { KubeGVRRequest, kubeObjectSubscription, kubeNamespaceSubscription } from '@api/core'; import type { ChaosEngine, FaultData } from '@models'; import { TargetApplicationTab } from '@views/ExperimentCreationFaultConfiguration/Tabs'; import type { AppInfoData, TargetApplicationData } from './types'; @@ -16,17 +16,26 @@ export default function TargetApplicationTabController({ infrastructureID, setFaultData }: TargetApplicationControllerProps): React.ReactElement { - const [appInfoData, setAppInfoData] = React.useState([]); + const [namespaceData, setNamespaceData] = React.useState([]); + const [appInfoData, setAppInfoData] = React.useState({ appLabel: [] }); const [targetApp, setTargetApp] = React.useState({ ...engineCR?.spec?.appinfo }); const [selectedGVR, setSelectedGVR] = React.useState(); - const { data: result, loading } = kubeObjectSubscription({ + const { data: resultNamespace, loading: loadingNamespace } = kubeNamespaceSubscription({ + request: { + infraID: infrastructureID ?? '' + }, + shouldResubscribe: true, + skip: targetApp?.appkind === undefined || selectedGVR === undefined + }); + const { data: resultObject, loading: loadingObject } = kubeObjectSubscription({ shouldResubscribe: true, - skip: targetApp?.appkind === undefined || selectedGVR === undefined, + skip: targetApp?.appns === undefined || targetApp?.appns === '', request: { infraID: infrastructureID ?? '', kubeObjRequest: selectedGVR, + namespace: targetApp?.appns ?? '', objectType: 'kubeobject' } }); @@ -37,51 +46,44 @@ export default function TargetApplicationTabController({ if (data.resource === targetApp?.appkind) { setSelectedGVR({ group: data.group, - version: data.version, - resource: `${data.resource}s` + resource: `${data.resource}s`, + version: data.version }); } }); // eslint-disable-next-line react-hooks/exhaustive-deps }, [targetApp?.appkind]); - /** - * UseEffect to filter the labels according to the namespace provided - * Required to populate the appLabels dropdown - */ React.useEffect(() => { - if (result?.getKubeObject) { - const appInfo: AppInfoData[] = []; - const kubeData = result.getKubeObject.kubeObj; - kubeData.forEach(obj => { - const applabels: string[] = []; - obj.data.forEach(objData => { - if (objData.labels) { - applabels.push(...objData.labels.filter(() => obj.namespace === targetApp?.appns)); - } - }); - /** - * Push these labels corresponding to their namespaces - */ - appInfo.push({ - namespace: obj.namespace, - appLabel: applabels - }); - }); + if (resultNamespace?.getKubeNamespace) { + setNamespaceData(resultNamespace.getKubeNamespace.kubeNamespace.map(data => data.name)); + } + }, [resultNamespace?.getKubeNamespace, targetApp?.appkind]); + React.useEffect(() => { + if (resultObject?.getKubeObject) { + const applabels: string[] = []; + resultObject.getKubeObject.kubeObj.data.forEach(objData => { + if (objData.labels) { + applabels.push(...objData.labels); + } + }); + const appInfo: AppInfoData = { appLabel: applabels }; setAppInfoData(appInfo); } - }, [result?.getKubeObject, targetApp?.appns]); + }, [resultObject?.getKubeObject, targetApp?.appns]); return ( ); } diff --git a/chaoscenter/web/src/controllers/TargetApplicationTab/types.ts b/chaoscenter/web/src/controllers/TargetApplicationTab/types.ts index 85f3123fefc..3fd0c0819a8 100644 --- a/chaoscenter/web/src/controllers/TargetApplicationTab/types.ts +++ b/chaoscenter/web/src/controllers/TargetApplicationTab/types.ts @@ -4,7 +4,10 @@ export interface TargetApplicationData { applabel?: string; } +export interface NamespaceData { + namespace: string[]; +} + export interface AppInfoData { - namespace: string; appLabel: string[]; } diff --git a/chaoscenter/web/src/images/Azure.svg b/chaoscenter/web/src/images/Azure.svg new file mode 100644 index 00000000000..624ef6d0f4d --- /dev/null +++ b/chaoscenter/web/src/images/Azure.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/chaoscenter/web/src/images/Bitbucket.svg b/chaoscenter/web/src/images/Bitbucket.svg new file mode 100644 index 00000000000..883910e4e35 --- /dev/null +++ b/chaoscenter/web/src/images/Bitbucket.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/chaoscenter/web/src/images/Github.svg b/chaoscenter/web/src/images/Github.svg new file mode 100644 index 00000000000..5d6072823c4 --- /dev/null +++ b/chaoscenter/web/src/images/Github.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/chaoscenter/web/src/images/Gitlab.svg b/chaoscenter/web/src/images/Gitlab.svg new file mode 100644 index 00000000000..e8d408fa2ed --- /dev/null +++ b/chaoscenter/web/src/images/Gitlab.svg @@ -0,0 +1,53 @@ + + + + logo-square + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/chaoscenter/web/src/models/chaosInfrastructure.ts b/chaoscenter/web/src/models/chaosInfrastructure.ts index cc9d530c7aa..ab40a98aa76 100644 --- a/chaoscenter/web/src/models/chaosInfrastructure.ts +++ b/chaoscenter/web/src/models/chaosInfrastructure.ts @@ -31,6 +31,7 @@ export function getChaosInfrastructureStatus( export interface ChaosInfrastructureReferenceFieldProps { setFieldValue: FormikHelpers['setFieldValue']; initialInfrastructureID: string | undefined; + initialEnvironmentID: string | undefined; } export enum DeploymentScopeOptions { @@ -64,6 +65,10 @@ export interface InitialValueProps { tolerationValues?: Array; } +export enum AllEnv { + AllEnv = 'All' +} + export interface DeploymentScopeItem extends CollapsableSelectOptions { type: DeploymentScopeOptions; name: string; diff --git a/chaoscenter/web/src/strings/strings.en.yaml b/chaoscenter/web/src/strings/strings.en.yaml index bfe16f64f61..408481c31cc 100644 --- a/chaoscenter/web/src/strings/strings.en.yaml +++ b/chaoscenter/web/src/strings/strings.en.yaml @@ -486,6 +486,7 @@ infrastructureRegistered: >- Environment -> Infrastructure list. infrastructureStates: Learn more about the states of Infrastructure infrastructureType: Infrastructure type +infrastructures: Infrastructures initialDelay: Initial Delay initialDelaySeconds: Initial Delay Seconds insecureSkipVerify: Insecure skip verify @@ -908,6 +909,7 @@ referencedBy: Referenced By registry: Registry registryName: Registry Name registryType: Registry Type +remoteHub: Select Remote hub remoteRepo: Remote Repository remove: Remove removeMember: Remove Member diff --git a/chaoscenter/web/src/strings/types.ts b/chaoscenter/web/src/strings/types.ts index 5d0470c5945..fcfe83225f0 100644 --- a/chaoscenter/web/src/strings/types.ts +++ b/chaoscenter/web/src/strings/types.ts @@ -409,6 +409,7 @@ export interface StringsMap { 'infrastructureRegistered': unknown 'infrastructureStates': unknown 'infrastructureType': unknown + 'infrastructures': unknown 'initialDelay': unknown 'initialDelaySeconds': unknown 'insecureSkipVerify': unknown @@ -752,6 +753,7 @@ export interface StringsMap { 'registry': unknown 'registryName': unknown 'registryType': unknown + 'remoteHub': unknown 'remoteRepo': unknown 'remove': unknown 'removeMember': unknown diff --git a/chaoscenter/web/src/views/AddHubModalWizard/AddHubModalWizard.tsx b/chaoscenter/web/src/views/AddHubModalWizard/AddHubModalWizard.tsx index a5f1c29ac37..06f50055bef 100644 --- a/chaoscenter/web/src/views/AddHubModalWizard/AddHubModalWizard.tsx +++ b/chaoscenter/web/src/views/AddHubModalWizard/AddHubModalWizard.tsx @@ -51,6 +51,7 @@ interface AddHubFormData { sshPublicKey?: string; sshPrivateKey?: string; token?: string; + remoteHub: string; } interface StepData { value?: AddHubFormData; @@ -78,7 +79,8 @@ export const initialValues: AddHubFormData = { repoBranch: '', repoURL: '', isPrivate: false, - authType: AuthType.NONE + authType: AuthType.NONE, + remoteHub: '' }; const OverviewStep: React.FC> = props => { @@ -160,6 +162,7 @@ const GitConnectionStep: React.FC< // name: values.name, isPrivate: values.isPrivate, repoURL: values.repoURL, + remoteHub: values.remoteHub, authType: values.authType, token: values.token, sshPublicKey: values.sshPublicKey, @@ -174,6 +177,7 @@ const GitConnectionStep: React.FC< description: formData.description, tags: formData.tags, repoURL: values.repoURL, + remoteHub: values.remoteHub, authType: values.authType, isPrivate: values.isPrivate, token: values.token, @@ -188,7 +192,8 @@ const GitConnectionStep: React.FC< }} validationSchema={Yup.object().shape({ repoBranch: Yup.string().trim().required('Hub Branch name is a required field'), - repoURL: Yup.string().trim().required('Hub Repo name is a required field') + repoURL: Yup.string().trim().required('Hub Repo name is a required field'), + remoteHub: Yup.string().trim().required('Remote Hub name is a required field') })} > {formikProps => { @@ -231,6 +236,22 @@ const GitConnectionStep: React.FC< placeholder={getString('enterHubRepositoryBranch')} /> + Remote Hub} + placeholder={getString('remoteHub')} + items={[ + { label: 'GitHub', value: 'GitHub' }, + { label: 'Bitbucket', value: 'Bitbucket' }, + { label: 'Azure Repo', value: 'Azure Repo' }, + { label: 'GitLab', value: 'GitLab' }, + { label: 'Others', value: 'Others' } + ]} + onChange={item => { + formikProps.setFieldValue('remoteHub', item.value); + }} + /> + {formikProps.values.isPrivate && ( { name: 'Test Hub', isDefault: false, repoURL: '', + remoteHub: '', repoBranch: '', projectID: '', authType: AuthType.SSH, diff --git a/chaoscenter/web/src/views/ChaosHubs/ChaosHubs.tsx b/chaoscenter/web/src/views/ChaosHubs/ChaosHubs.tsx index 298c5ddb26e..19bc0732c47 100644 --- a/chaoscenter/web/src/views/ChaosHubs/ChaosHubs.tsx +++ b/chaoscenter/web/src/views/ChaosHubs/ChaosHubs.tsx @@ -14,8 +14,12 @@ import type { ListChaosHubRequest, ListChaosHubResponse, SyncChaosHubRequest, Sy import CustomTagsPopover from '@components/CustomTagsPopover'; import { useDocumentTitle, useRouteWithBaseUrl } from '@hooks'; import NoFilteredData from '@components/NoFilteredData'; +import GitHub from '@images/Github.svg'; +import Azure from '@images/Azure.svg'; +import Gitlab from '@images/Gitlab.svg'; import enterpriseHubLogo from '../../images/enterpriseHub.svg'; import privateHubLogo from '../../images/privateHub.svg'; +import Bitbucket from '../../images/Bitbucket.svg'; import { AddHubModalProvider } from './AddHubModal'; import css from './ChaosHubs.module.scss'; @@ -48,6 +52,25 @@ function ConnectionStatus({ isConnected }: { isConnected: boolean }): React.Reac ); } +const RemoteHubImage = ({ remoteHubName }: { remoteHubName: string }): React.ReactElement => { + const hubSvg = () => { + switch (remoteHubName) { + case 'GitHub': + return GitHub; + case 'Azure Repo': + return Azure-Repo; + case 'Bitbucket': + return Bitbucket; + case 'GitLab': + return Gitlab; + default: + return Private Hub; + } + }; + + return hubSvg(); +}; + export const ChaosHubsView: React.FC = ({ chaosHubs, loading, @@ -132,7 +155,7 @@ export const ChaosHubsView: React.FC = ({ {chaosHub.isDefault ? ( Enterprise Hub ) : ( - Private Hub + )} svg { > path { stroke-width: 1; - stroke: var(--grey-500); + stroke: var(--grey-100); + } + } + } + .iconCheck:hover { + > svg { + > path { + stroke-width: 1; + stroke: var(--green-500); } } } @@ -134,7 +139,7 @@ .gitInfo { display: grid; grid-template-columns: 4fr 5fr; - padding: 6px 8px; + padding: 4px 8px; background: var(--grey-100) !important; border-radius: 8px !important; width: 100%; @@ -170,11 +175,6 @@ position: fixed; } -.gap-4 { - gap: 1rem; - overflow: auto; -} - .paginationContainer { padding-top: 8px; overflow: hidden; @@ -190,3 +190,37 @@ } } } + +.listEnvContainer { + background: var(--primary-1); + box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.04), 0px 2px 4px rgba(96, 97, 112, 0.16); + border-radius: 8px; + cursor: pointer; +} + +.itemEnv { + width: 100%; + display: grid; + grid-template-columns: 1fr 25px; + align-items: center; + gap: 0.5rem; +} + +.activeEnv { + border: 1px solid var(--primary-7); +} + +.center { + display: flex; + flex-direction: column; + justify-content: center; + align-self: center; + + img { + width: 200px; + } +} + +.rounded { + border-radius: 999px; +} diff --git a/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.module.scss.d.ts b/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.module.scss.d.ts index db9d0abfa61..0f0a5adf7fa 100644 --- a/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.module.scss.d.ts +++ b/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.module.scss.d.ts @@ -1,24 +1,28 @@ declare namespace ChaosInfrastructureReferenceFieldModuleScssNamespace { export interface IChaosInfrastructureReferenceFieldModuleScss { + activeEnv: string; agentList: string; agentListInnerContainer: string; + center: string; container: string; dialog: string; editBtn: string; fixed: string; - gap4: string; gitBranchIcon: string; gitInfo: string; greenStatus: string; iconCheck: string; iconChecked: string; item: string; + itemEnv: string; leftInfo: string; + listEnvContainer: string; notSelected: string; paginationContainer: string; placeholder: string; redStatus: string; referenceSelect: string; + rounded: string; selected: string; status: string; } diff --git a/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.tsx b/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.tsx index 4b55ba44ecc..2a5efa9853b 100644 --- a/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.tsx +++ b/chaoscenter/web/src/views/ChaosInfrastructureReferenceField/ChaosInfrastructureReferenceField.tsx @@ -8,7 +8,8 @@ import { ExpandingSearchInput, Layout, Text, - useToaster + useToaster, + useToggleOpen } from '@harnessio/uicore'; import { Icon } from '@harnessio/icons'; import cx from 'classnames'; @@ -19,6 +20,7 @@ import FallbackBox from '@images/FallbackBox.svg'; import CustomTagsPopover from '@components/CustomTagsPopover'; import Loader from '@components/Loader'; import { useRouteWithBaseUrl } from '@hooks'; +import { Environment, EnvironmentDetail } from '@api/entities'; import css from './ChaosInfrastructureReferenceField.module.scss'; export interface InfrastructureDetails { @@ -34,10 +36,14 @@ export interface InfrastructureDetails { interface ChaosInfrastructureReferenceFieldViewProps { infrastructureList: InfrastructureDetails[] | undefined; + allInfrastructureLength: number | null; + environmentList: Environment[] | undefined; preSelectedInfrastructure?: InfrastructureDetails; setInfrastructureValue: (infrastructure: InfrastructureDetails | undefined) => void; searchInfrastructure: string; setSearchInfrastructure: React.Dispatch>; + setEnvID: (id: string) => void; + envID: string | undefined; loading: { listChaosInfra: boolean; }; @@ -46,32 +52,83 @@ interface ChaosInfrastructureReferenceFieldViewProps { function ChaosInfrastructureReferenceFieldView({ infrastructureList, + environmentList, + allInfrastructureLength, preSelectedInfrastructure, setInfrastructureValue, searchInfrastructure, setSearchInfrastructure, + envID, + setEnvID, loading, pagination }: ChaosInfrastructureReferenceFieldViewProps): JSX.Element { - const [isOpen, setOpen] = React.useState(false); const paths = useRouteWithBaseUrl(); const history = useHistory(); + const [selectedInfrastructure, setSelectedInfrastructure] = React.useState( preSelectedInfrastructure ); - // const searchParams = useSearchParams(); - // const infrastructureType = - // (searchParams.get('infrastructureType') as InfrastructureType | undefined) ?? InfrastructureType.KUBERNETES; + const { isOpen, open, close } = useToggleOpen(); + const { showError } = useToaster(); const { getString } = useStrings(); - const listItem = ({ infrastructure }: { infrastructure: InfrastructureDetails }): JSX.Element => { + const EnvListItem = ({ envDetail }: { envDetail: EnvironmentDetail }): JSX.Element => { + return ( + { + setEnvID(envDetail.envID); + }} + > +
+ + + {envDetail.envName} + + + + {envDetail.totalInfra ?? 0} + +
+
+ ); + }; + + const EnvironmentList = ({ env }: { env: Environment }): JSX.Element => { + return ( + + ); + }; + + const InfrastructureListItem = ({ infrastructure }: { infrastructure: InfrastructureDetails }): JSX.Element => { + const isSelected = + selectedInfrastructure?.id === infrastructure.id || preSelectedInfrastructure?.id === infrastructure.id; + return ( { infrastructure.isActive ? setSelectedInfrastructure(infrastructure) @@ -85,7 +142,6 @@ function ChaosInfrastructureReferenceFieldView({ size={12} name="pipeline-approval" /> - {/* */} {infrastructure.name} @@ -124,6 +180,26 @@ function ChaosInfrastructureReferenceFieldView({ ); }; + const NoInfraComponent = (): JSX.Element => { + return ( + + {getString('latestRun')} + + {searchInfrastructure === '' ? getString('newUserNoInfra.title') : getString('noFilteredActiveInfra')} + + {searchInfrastructure === '' && ( +