From 7365323b05e4fd2316d46bdcd7bc54dca8989e2e Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Mon, 29 Apr 2024 23:04:52 +0530 Subject: [PATCH 1/4] feat(iam): adds ACTION: clone-environment longer description --- apps/iam/internal/app/action-role-binding.go | 1 + apps/iam/types/types.go | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/iam/internal/app/action-role-binding.go b/apps/iam/internal/app/action-role-binding.go index a848df4cd..19902b302 100644 --- a/apps/iam/internal/app/action-role-binding.go +++ b/apps/iam/internal/app/action-role-binding.go @@ -98,6 +98,7 @@ var roleBindings RoleBindingMap = RoleBindingMap{ t.ListEnvironments: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, t.GetEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, t.CreateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, + t.CloneEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, t.UpdateEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleResourceOwner}, t.DeleteEnvironment: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleResourceOwner}, diff --git a/apps/iam/types/types.go b/apps/iam/types/types.go index 244ed37cb..e40ed934f 100644 --- a/apps/iam/types/types.go +++ b/apps/iam/types/types.go @@ -120,6 +120,7 @@ const ( RemoveProjectMembership Action = "remove-project-membership" CreateEnvironment Action = "create-environment" + CloneEnvironment Action = "clone-environment" UpdateEnvironment Action = "update-environment" DeleteEnvironment Action = "delete-environment" GetEnvironment Action = "get-environment" From 875b0e7a19b43dececd812c09ec5fdfb252ad63b Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Mon, 29 Apr 2024 23:06:27 +0530 Subject: [PATCH 2/4] WIP: removing projects, and making environments unique across an account --- .dockerignore | 1 + .../__http__/console/environments.graphql.yml | 7 +- apps/console/Taskfile.yml | 8 +- .../app/adapter-resource-update-publish.go | 11 +- apps/console/internal/app/app.go | 4 +- .../internal/app/graph/generated/generated.go | 10045 +++------------- .../internal/app/graph/model/models_gen.go | 66 - .../internal/app/graph/project.resolvers.go | 76 - .../graph/projectmanagedservice.resolvers.go | 80 - .../internal/app/graph/resolver-utils.go | 8 +- .../internal/app/graph/schema.graphqls | 29 +- .../internal/app/graph/schema.resolvers.go | 282 +- .../app/graph/struct-to-graphql/app.graphqls | 1 - .../struct-to-graphql/common-types.graphqls | 44 - .../graph/struct-to-graphql/config.graphqls | 1 - .../struct-to-graphql/environment.graphqls | 3 +- .../imagepullsecret.graphqls | 1 - .../managedresource.graphqls | 1 - .../graph/struct-to-graphql/project.graphqls | 39 - .../projectmanagedservice.graphqls | 38 - .../graph/struct-to-graphql/router.graphqls | 1 - .../graph/struct-to-graphql/secret.graphqls | 1 - .../internal/app/process-error-on-apply.go | 69 +- .../internal/app/process-resource-updates.go | 91 +- apps/console/internal/domain/api.go | 78 +- apps/console/internal/domain/app.go | 11 +- apps/console/internal/domain/config.go | 21 +- apps/console/internal/domain/domain.go | 70 +- apps/console/internal/domain/environment.go | 180 +- .../internal/domain/image-pull-secret.go | 13 +- apps/console/internal/domain/mres.go | 15 +- apps/console/internal/domain/names.go | 42 +- .../domain/project-managed-service.go | 632 +- apps/console/internal/domain/project.go | 888 +- .../internal/domain/resource-mapping.go | 54 +- apps/console/internal/domain/router.go | 13 +- apps/console/internal/domain/secret.go | 15 +- apps/console/internal/domain/vpn-device.go | 52 +- apps/console/internal/entities/app.go | 1 - apps/console/internal/entities/config.go | 2 - apps/console/internal/entities/environment.go | 19 +- .../field-constants/generated_constants.go | 24 - .../internal/entities/image-pull-secret.go | 2 - apps/console/internal/entities/mres.go | 2 - .../entities/project-managed-service.go | 94 +- apps/console/internal/entities/project.go | 126 +- .../internal/entities/resource-mapping.go | 4 +- apps/console/internal/entities/router.go | 2 - apps/console/internal/entities/secret.go | 2 - apps/gateway/Dockerfile | 2 +- 50 files changed, 2979 insertions(+), 10292 deletions(-) delete mode 100644 apps/console/internal/app/graph/project.resolvers.go delete mode 100644 apps/console/internal/app/graph/projectmanagedservice.resolvers.go delete mode 100644 apps/console/internal/app/graph/struct-to-graphql/project.graphqls delete mode 100644 apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls diff --git a/.dockerignore b/.dockerignore index e1e88af13..10c21991b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,6 +5,7 @@ !common !constants !*.go +!flake.* !grpc-interfaces apps/**/.task apps/**/node_modules diff --git a/.tools/nvim/__http__/console/environments.graphql.yml b/.tools/nvim/__http__/console/environments.graphql.yml index 5a39b7745..b9fa84ebc 100644 --- a/.tools/nvim/__http__/console/environments.graphql.yml +++ b/.tools/nvim/__http__/console/environments.graphql.yml @@ -1,6 +1,7 @@ --- global: envTargetNamespace: "nxtcoder17" + envName: "test-env" --- label: List Environments @@ -63,7 +64,6 @@ query: |+ #graphql apiVersion kind spec { - projectName targetNamespace } syncStatus { @@ -79,10 +79,11 @@ variables: projectName: "{{.projectName}}" env: displayName: Display Name of a sample environment + clusterName: "{{.gcpClusterName}}" metadata: name: "{{.envName}}" - spec: - projectName: "{{.projectName}}" + # spec: + # projectName: "{{.projectName}}" --- label: resync environment diff --git a/apps/console/Taskfile.yml b/apps/console/Taskfile.yml index b05e40467..00ba950c5 100644 --- a/apps/console/Taskfile.yml +++ b/apps/console/Taskfile.yml @@ -17,7 +17,6 @@ tasks: cmds: - mkdir -p "./internal/app/_struct-to-graphql" - go run ../../cmd/struct-to-graphql - --struct github.com/kloudlite/api/apps/console/internal/entities.Project --struct github.com/kloudlite/api/apps/console/internal/entities.Environment --struct github.com/kloudlite/api/apps/console/internal/entities.App --struct github.com/kloudlite/api/apps/console/internal/entities.Secret @@ -33,13 +32,12 @@ tasks: --struct github.com/kloudlite/api/apps/console/internal/entities.Router --struct github.com/kloudlite/api/apps/console/internal/entities.ManagedResource --struct github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret - --struct github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService --struct github.com/kloudlite/api/pkg/repos.MatchFilter --struct github.com/kloudlite/api/pkg/repos.CursorPagination > ./internal/app/_struct-to-graphql/main.go - |+ pushd ./internal/app/_struct-to-graphql - go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Project,Environment,App,Secret,Config,Router,ManagedResource,ProjectManagedService,ImagePullSecret,ConsoleVPNDevice + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Environment,App,Secret,Config,Router,ManagedResource,ImagePullSecret,ConsoleVPNDevice popd - rm -rf ./internal/app/_struct-to-graphql @@ -58,8 +56,8 @@ tasks: build: cmds: - task: gen:constants - - task: go:build - vars: + - task: go:build + vars: Out: ./bin/{{.app}} local:build-and-push: diff --git a/apps/console/internal/app/adapter-resource-update-publish.go b/apps/console/internal/app/adapter-resource-update-publish.go index 6698971d7..118cab3b0 100644 --- a/apps/console/internal/app/adapter-resource-update-publish.go +++ b/apps/console/internal/app/adapter-resource-update-publish.go @@ -14,8 +14,8 @@ type ResourceEventPublisherImpl struct { logger logging.Logger } -func (r *ResourceEventPublisherImpl) PublishProjectResourceEvent(ctx domain.ConsoleContext, projectName string, resourceType entities.ResourceType, name string, update domain.PublishMsg) { - subject := fmt.Sprintf("res-updates.account.%s.project.%s.%s.%s", ctx.AccountName, projectName, resourceType, name) +func (r *ResourceEventPublisherImpl) PublishEnvironmentResourceEvent(ctx domain.ConsoleContext, envName string, resourceType entities.ResourceType, name string, update domain.PublishMsg) { + subject := fmt.Sprintf("res-updates.account.%s.environment.%s.%s.%s", ctx.AccountName, envName, resourceType, name) r.publish(subject, update) } @@ -25,7 +25,7 @@ func (r *ResourceEventPublisherImpl) PublishConsoleEvent(ctx domain.ConsoleConte } func (r *ResourceEventPublisherImpl) PublishResourceEvent(ctx domain.ResourceContext, resourceType entities.ResourceType, name string, update domain.PublishMsg) { - subject := fmt.Sprintf("res-updates.account.%s.project.%s.environment.%s.%s.%s", ctx.AccountName, ctx.ProjectName, ctx.EnvironmentName, resourceType, name) + subject := fmt.Sprintf("res-updates.account.%s.environment.%s.%s.%s", ctx.AccountName, ctx.EnvironmentName, resourceType, name) r.publish(subject, update) } @@ -36,8 +36,5 @@ func (r *ResourceEventPublisherImpl) publish(subject string, msg domain.PublishM } func NewResourceEventPublisher(cli *nats.Client, logger logging.Logger) domain.ResourceEventPublisher { - return &ResourceEventPublisherImpl{ - cli, - logger, - } + return &ResourceEventPublisherImpl{cli, logger} } diff --git a/apps/console/internal/app/app.go b/apps/console/internal/app/app.go index a2cb85b9e..89f83a8c2 100644 --- a/apps/console/internal/app/app.go +++ b/apps/console/internal/app/app.go @@ -47,8 +47,8 @@ func toConsoleContext(requestCtx context.Context, accountCookieName string) (dom } var Module = fx.Module("app", - repos.NewFxMongoRepo[*entities.Project]("projects", "prj", entities.ProjectIndexes), - repos.NewFxMongoRepo[*entities.ProjectManagedService]("project_managed_service", "pmsvc", entities.ProjectManagedServiceIndices), + // repos.NewFxMongoRepo[*entities.Project]("projects", "prj", entities.ProjectIndexes), + // repos.NewFxMongoRepo[*entities.ProjectManagedService]("project_managed_service", "pmsvc", entities.ProjectManagedServiceIndices), repos.NewFxMongoRepo[*entities.Environment]("environments", "env", entities.EnvironmentIndexes), repos.NewFxMongoRepo[*entities.App]("apps", "app", entities.AppIndexes), repos.NewFxMongoRepo[*entities.Config]("configs", "cfg", entities.ConfigIndexes), diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index 94047f2d8..003de27ea 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -62,8 +62,6 @@ type ResolverRoot interface { ManagedResource() ManagedResourceResolver Metadata() MetadataResolver Mutation() MutationResolver - Project() ProjectResolver - ProjectManagedService() ProjectManagedServiceResolver Query() QueryResolver Router() RouterResolver Secret() SecretResolver @@ -74,8 +72,6 @@ type ResolverRoot interface { ImagePullSecretIn() ImagePullSecretInResolver ManagedResourceIn() ManagedResourceInResolver MetadataIn() MetadataInResolver - ProjectIn() ProjectInResolver - ProjectManagedServiceIn() ProjectManagedServiceInResolver RouterIn() RouterInResolver SecretIn() SecretInResolver } @@ -102,7 +98,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -140,7 +135,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int SyncStatus func(childComplexity int) int UpdateTime func(childComplexity int) int @@ -223,6 +217,7 @@ type ComplexityRoot struct { Environment struct { APIVersion func(childComplexity int) int AccountName func(childComplexity int) int + ClusterName func(childComplexity int) int CreatedBy func(childComplexity int) int CreationTime func(childComplexity int) int DisplayName func(childComplexity int) int @@ -231,7 +226,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -357,7 +351,6 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec struct { - ProjectName func(childComplexity int) int Routing func(childComplexity int) int TargetNamespace func(childComplexity int) int } @@ -392,12 +385,6 @@ type ComplexityRoot struct { ResourceTemplate func(childComplexity int) int } - Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec struct { - NodeSelector func(childComplexity int) int - ServiceTemplate func(childComplexity int) int - Tolerations func(childComplexity int) int - } - Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate struct { APIVersion func(childComplexity int) int Kind func(childComplexity int) int @@ -422,15 +409,6 @@ type ComplexityRoot struct { Type func(childComplexity int) int } - Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec struct { - MsvcSpec func(childComplexity int) int - TargetNamespace func(childComplexity int) int - } - - Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec struct { - TargetNamespace func(childComplexity int) int - } - Github__com___kloudlite___operator___apis___crds___v1__RateLimit struct { Connections func(childComplexity int) int Enabled func(childComplexity int) int @@ -457,12 +435,6 @@ type ComplexityRoot struct { Routes func(childComplexity int) int } - Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate struct { - APIVersion func(childComplexity int) int - Kind func(childComplexity int) int - Spec func(childComplexity int) int - } - Github__com___kloudlite___operator___apis___crds___v1__ShellProbe struct { Command func(childComplexity int) int } @@ -541,7 +513,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int RegistryPassword func(childComplexity int) int RegistryURL func(childComplexity int) int @@ -614,7 +585,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -663,41 +633,35 @@ type ComplexityRoot struct { } Mutation struct { - CoreCloneEnvironment func(childComplexity int, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) int - CoreCreateApp func(childComplexity int, projectName string, envName string, app entities.App) int - CoreCreateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int - CoreCreateEnvironment func(childComplexity int, projectName string, env entities.Environment) int - CoreCreateImagePullSecret func(childComplexity int, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) int - CoreCreateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int - CoreCreateProject func(childComplexity int, project entities.Project) int - CoreCreateProjectManagedService func(childComplexity int, projectName string, pmsvc entities.ProjectManagedService) int - CoreCreateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int - CoreCreateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int - CoreCreateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int - CoreDeleteApp func(childComplexity int, projectName string, envName string, appName string) int - CoreDeleteConfig func(childComplexity int, projectName string, envName string, configName string) int - CoreDeleteEnvironment func(childComplexity int, projectName string, envName string) int - CoreDeleteImagePullSecret func(childComplexity int, projectName string, envName string, secretName string) int - CoreDeleteManagedResource func(childComplexity int, projectName string, envName string, mresName string) int - CoreDeleteProject func(childComplexity int, name string) int - CoreDeleteProjectManagedService func(childComplexity int, projectName string, pmsvcName string) int - CoreDeleteRouter func(childComplexity int, projectName string, envName string, routerName string) int - CoreDeleteSecret func(childComplexity int, projectName string, envName string, secretName string) int - CoreDeleteVPNDevice func(childComplexity int, deviceName string) int - CoreInterceptApp func(childComplexity int, projectName string, envName string, appname string, deviceName string, intercept bool) int - CoreUpdateApp func(childComplexity int, projectName string, envName string, app entities.App) int - CoreUpdateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int - CoreUpdateEnvironment func(childComplexity int, projectName string, env entities.Environment) int - CoreUpdateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int - CoreUpdateProject func(childComplexity int, project entities.Project) int - CoreUpdateProjectManagedService func(childComplexity int, projectName string, pmsvc entities.ProjectManagedService) int - CoreUpdateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int - CoreUpdateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int - CoreUpdateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int - CoreUpdateVPNDeviceEnv func(childComplexity int, deviceName string, projectName string, envName string) int - CoreUpdateVPNDevicePorts func(childComplexity int, deviceName string, ports []*v11.Port) int - CoreUpdateVpnClusterName func(childComplexity int, deviceName string, clusterName string) int - CoreUpdateVpnDeviceNs func(childComplexity int, deviceName string, ns string) int + CoreCloneEnvironment func(childComplexity int, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) int + CoreCreateApp func(childComplexity int, projectName string, envName string, app entities.App) int + CoreCreateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int + CoreCreateEnvironment func(childComplexity int, projectName string, env entities.Environment) int + CoreCreateImagePullSecret func(childComplexity int, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) int + CoreCreateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int + CoreCreateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int + CoreCreateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreCreateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int + CoreDeleteApp func(childComplexity int, projectName string, envName string, appName string) int + CoreDeleteConfig func(childComplexity int, projectName string, envName string, configName string) int + CoreDeleteEnvironment func(childComplexity int, projectName string, envName string) int + CoreDeleteImagePullSecret func(childComplexity int, projectName string, envName string, secretName string) int + CoreDeleteManagedResource func(childComplexity int, projectName string, envName string, mresName string) int + CoreDeleteRouter func(childComplexity int, projectName string, envName string, routerName string) int + CoreDeleteSecret func(childComplexity int, projectName string, envName string, secretName string) int + CoreDeleteVPNDevice func(childComplexity int, deviceName string) int + CoreInterceptApp func(childComplexity int, projectName string, envName string, appname string, deviceName string, intercept bool) int + CoreUpdateApp func(childComplexity int, projectName string, envName string, app entities.App) int + CoreUpdateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int + CoreUpdateEnvironment func(childComplexity int, projectName string, env entities.Environment) int + CoreUpdateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int + CoreUpdateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int + CoreUpdateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreUpdateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int + CoreUpdateVPNDeviceEnv func(childComplexity int, deviceName string, projectName string, envName string) int + CoreUpdateVPNDevicePorts func(childComplexity int, deviceName string, ports []*v11.Port) int + CoreUpdateVpnClusterName func(childComplexity int, deviceName string, clusterName string) int + CoreUpdateVpnDeviceNs func(childComplexity int, deviceName string, ns string) int } PageInfo struct { @@ -712,66 +676,6 @@ type ComplexityRoot struct { TargetPort func(childComplexity int) int } - Project struct { - APIVersion func(childComplexity int) int - AccountName func(childComplexity int) int - ClusterName func(childComplexity int) int - CreatedBy func(childComplexity int) int - CreationTime func(childComplexity int) int - DisplayName func(childComplexity int) int - Id func(childComplexity int) int - Kind func(childComplexity int) int - LastUpdatedBy func(childComplexity int) int - MarkedForDeletion func(childComplexity int) int - ObjectMeta func(childComplexity int) int - RecordVersion func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - UpdateTime func(childComplexity int) int - } - - ProjectEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int - } - - ProjectManagedService struct { - APIVersion func(childComplexity int) int - AccountName func(childComplexity int) int - CreatedBy func(childComplexity int) int - CreationTime func(childComplexity int) int - DisplayName func(childComplexity int) int - Id func(childComplexity int) int - Kind func(childComplexity int) int - LastUpdatedBy func(childComplexity int) int - MarkedForDeletion func(childComplexity int) int - ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int - RecordVersion func(childComplexity int) int - Spec func(childComplexity int) int - Status func(childComplexity int) int - SyncStatus func(childComplexity int) int - UpdateTime func(childComplexity int) int - } - - ProjectManagedServiceEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int - } - - ProjectManagedServicePaginatedRecords struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - TotalCount func(childComplexity int) int - } - - ProjectPaginatedRecords struct { - Edges func(childComplexity int) int - PageInfo func(childComplexity int) int - TotalCount func(childComplexity int) int - } - Query struct { CoreCheckNameAvailability func(childComplexity int, projectName *string, envName *string, resType entities.ResourceType, name string) int CoreGetApp func(childComplexity int, projectName string, envName string, name string) int @@ -782,8 +686,6 @@ type ComplexityRoot struct { CoreGetManagedResouceOutputKeyValues func(childComplexity int, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) int CoreGetManagedResouceOutputKeys func(childComplexity int, projectName string, envName string, name string) int CoreGetManagedResource func(childComplexity int, projectName string, envName string, name string) int - CoreGetProject func(childComplexity int, name string) int - CoreGetProjectManagedService func(childComplexity int, projectName string, name string) int CoreGetRouter func(childComplexity int, projectName string, envName string, name string) int CoreGetSecret func(childComplexity int, projectName string, envName string, name string) int CoreGetSecretValues func(childComplexity int, projectName string, envName string, queries []*domain.SecretKeyRef) int @@ -793,21 +695,16 @@ type ComplexityRoot struct { CoreListEnvironments func(childComplexity int, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) int CoreListImagePullSecrets func(childComplexity int, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) int CoreListManagedResources func(childComplexity int, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) int - CoreListProjectManagedServices func(childComplexity int, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) int - CoreListProjects func(childComplexity int, search *model.SearchProjects, pq *repos.CursorPagination) int CoreListRouters func(childComplexity int, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) int CoreListSecrets func(childComplexity int, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) int CoreListVPNDevices func(childComplexity int, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) int CoreListVPNDevicesForUser func(childComplexity int) int CoreRestartApp func(childComplexity int, projectName string, envName string, appName string) int - CoreRestartProjectManagedService func(childComplexity int, projectName string, name string) int CoreResyncApp func(childComplexity int, projectName string, envName string, name string) int CoreResyncConfig func(childComplexity int, projectName string, envName string, name string) int CoreResyncEnvironment func(childComplexity int, projectName string, name string) int CoreResyncImagePullSecret func(childComplexity int, projectName string, envName string, name string) int CoreResyncManagedResource func(childComplexity int, projectName string, envName string, name string) int - CoreResyncProject func(childComplexity int, name string) int - CoreResyncProjectManagedService func(childComplexity int, projectName string, name string) int CoreResyncRouter func(childComplexity int, projectName string, envName string, name string) int CoreResyncSecret func(childComplexity int, projectName string, envName string, name string) int __resolve__service func(childComplexity int) int @@ -827,7 +724,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -861,7 +757,6 @@ type ComplexityRoot struct { LastUpdatedBy func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int StringData func(childComplexity int) int SyncStatus func(childComplexity int) int @@ -974,9 +869,6 @@ type MetadataResolver interface { Labels(ctx context.Context, obj *v13.ObjectMeta) (map[string]interface{}, error) } type MutationResolver interface { - CoreCreateProject(ctx context.Context, project entities.Project) (*entities.Project, error) - CoreUpdateProject(ctx context.Context, project entities.Project) (*entities.Project, error) - CoreDeleteProject(ctx context.Context, name string) (bool, error) CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) CoreUpdateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) CoreDeleteEnvironment(ctx context.Context, projectName string, envName string) (bool, error) @@ -999,9 +891,6 @@ type MutationResolver interface { CoreCreateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) CoreUpdateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) CoreDeleteManagedResource(ctx context.Context, projectName string, envName string, mresName string) (bool, error) - CoreCreateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) - CoreUpdateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) - CoreDeleteProjectManagedService(ctx context.Context, projectName string, pmsvcName string) (bool, error) CoreCreateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) CoreUpdateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) CoreUpdateVPNDevicePorts(ctx context.Context, deviceName string, ports []*v11.Port) (bool, error) @@ -1010,25 +899,8 @@ type MutationResolver interface { CoreUpdateVpnClusterName(ctx context.Context, deviceName string, clusterName string) (bool, error) CoreDeleteVPNDevice(ctx context.Context, deviceName string) (bool, error) } -type ProjectResolver interface { - CreationTime(ctx context.Context, obj *entities.Project) (string, error) - - Spec(ctx context.Context, obj *entities.Project) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec, error) - - UpdateTime(ctx context.Context, obj *entities.Project) (string, error) -} -type ProjectManagedServiceResolver interface { - CreationTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) - - Spec(ctx context.Context, obj *entities.ProjectManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec, error) - - UpdateTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) -} type QueryResolver interface { CoreCheckNameAvailability(ctx context.Context, projectName *string, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) - CoreListProjects(ctx context.Context, search *model.SearchProjects, pq *repos.CursorPagination) (*model.ProjectPaginatedRecords, error) - CoreGetProject(ctx context.Context, name string) (*entities.Project, error) - CoreResyncProject(ctx context.Context, name string) (bool, error) CoreListEnvironments(ctx context.Context, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) CoreGetEnvironment(ctx context.Context, projectName string, name string) (*entities.Environment, error) CoreResyncEnvironment(ctx context.Context, projectName string, name string) (bool, error) @@ -1055,10 +927,6 @@ type QueryResolver interface { CoreListManagedResources(ctx context.Context, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) CoreGetManagedResource(ctx context.Context, projectName string, envName string, name string) (*entities.ManagedResource, error) CoreResyncManagedResource(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreListProjectManagedServices(ctx context.Context, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) (*model.ProjectManagedServicePaginatedRecords, error) - CoreGetProjectManagedService(ctx context.Context, projectName string, name string) (*entities.ProjectManagedService, error) - CoreResyncProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) - CoreRestartProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) CoreListVPNDevices(ctx context.Context, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) (*model.ConsoleVPNDevicePaginatedRecords, error) CoreListVPNDevicesForUser(ctx context.Context) ([]*entities.ConsoleVPNDevice, error) CoreGetVPNDevice(ctx context.Context, name string) (*entities.ConsoleVPNDevice, error) @@ -1113,14 +981,6 @@ type MetadataInResolver interface { Annotations(ctx context.Context, obj *v13.ObjectMeta, data map[string]interface{}) error Labels(ctx context.Context, obj *v13.ObjectMeta, data map[string]interface{}) error } -type ProjectInResolver interface { - Metadata(ctx context.Context, obj *entities.Project, data *v13.ObjectMeta) error - Spec(ctx context.Context, obj *entities.Project, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn) error -} -type ProjectManagedServiceInResolver interface { - Metadata(ctx context.Context, obj *entities.ProjectManagedService, data *v13.ObjectMeta) error - Spec(ctx context.Context, obj *entities.ProjectManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn) error -} type RouterInResolver interface { Metadata(ctx context.Context, obj *entities.Router, data *v13.ObjectMeta) error Spec(ctx context.Context, obj *entities.Router, data *model.GithubComKloudliteOperatorApisCrdsV1RouterSpecIn) error @@ -1250,13 +1110,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.App.ObjectMeta(childComplexity), true - case "App.projectName": - if e.complexity.App.ProjectName == nil { - break - } - - return e.complexity.App.ProjectName(childComplexity), true - case "App.recordVersion": if e.complexity.App.RecordVersion == nil { break @@ -1432,13 +1285,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Config.ObjectMeta(childComplexity), true - case "Config.projectName": - if e.complexity.Config.ProjectName == nil { - break - } - - return e.complexity.Config.ProjectName(childComplexity), true - case "Config.recordVersion": if e.complexity.Config.RecordVersion == nil { break @@ -1787,6 +1633,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Environment.AccountName(childComplexity), true + case "Environment.clusterName": + if e.complexity.Environment.ClusterName == nil { + break + } + + return e.complexity.Environment.ClusterName(childComplexity), true + case "Environment.createdBy": if e.complexity.Environment.CreatedBy == nil { break @@ -1843,13 +1696,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Environment.ObjectMeta(childComplexity), true - case "Environment.projectName": - if e.complexity.Environment.ProjectName == nil { - break - } - - return e.complexity.Environment.ProjectName(childComplexity), true - case "Environment.recordVersion": if e.complexity.Environment.RecordVersion == nil { break @@ -2368,13 +2214,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting.PublicIngressClass(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.projectName": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.ProjectName == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.ProjectName(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.routing": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec.Routing == nil { break @@ -2494,27 +2333,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec.ResourceTemplate(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.nodeSelector": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.NodeSelector == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.NodeSelector(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.serviceTemplate": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.ServiceTemplate(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.tolerations": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.Tolerations == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec.Tolerations(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.apiVersion": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate.APIVersion == nil { break @@ -2620,27 +2438,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Probe.Type(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.msvcSpec": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.MsvcSpec == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.MsvcSpec(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.targetNamespace": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.TargetNamespace == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec.TargetNamespace(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.targetNamespace": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.TargetNamespace == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec.TargetNamespace(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__RateLimit.connections": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RateLimit.Connections == nil { break @@ -2760,27 +2557,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__RouterSpec.Routes(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.apiVersion": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.APIVersion(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.kind": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Kind(childComplexity), true - - case "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.spec": - if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec == nil { - break - } - - return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec(childComplexity), true - case "Github__com___kloudlite___operator___apis___crds___v1__ShellProbe.command": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ShellProbe.Command == nil { break @@ -3110,13 +2886,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ImagePullSecret.ObjectMeta(childComplexity), true - case "ImagePullSecret.projectName": - if e.complexity.ImagePullSecret.ProjectName == nil { - break - } - - return e.complexity.ImagePullSecret.ProjectName(childComplexity), true - case "ImagePullSecret.recordVersion": if e.complexity.ImagePullSecret.RecordVersion == nil { break @@ -3453,13 +3222,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ManagedResource.ObjectMeta(childComplexity), true - case "ManagedResource.projectName": - if e.complexity.ManagedResource.ProjectName == nil { - break - } - - return e.complexity.ManagedResource.ProjectName(childComplexity), true - case "ManagedResource.recordVersion": if e.complexity.ManagedResource.RecordVersion == nil { break @@ -3721,30 +3483,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true - case "Mutation.core_createProject": - if e.complexity.Mutation.CoreCreateProject == nil { - break - } - - args, err := ec.field_Mutation_core_createProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreCreateProject(childComplexity, args["project"].(entities.Project)), true - - case "Mutation.core_createProjectManagedService": - if e.complexity.Mutation.CoreCreateProjectManagedService == nil { - break - } - - args, err := ec.field_Mutation_core_createProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreCreateProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvc"].(entities.ProjectManagedService)), true - case "Mutation.core_createRouter": if e.complexity.Mutation.CoreCreateRouter == nil { break @@ -3841,30 +3579,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mresName"].(string)), true - case "Mutation.core_deleteProject": - if e.complexity.Mutation.CoreDeleteProject == nil { - break - } - - args, err := ec.field_Mutation_core_deleteProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreDeleteProject(childComplexity, args["name"].(string)), true - - case "Mutation.core_deleteProjectManagedService": - if e.complexity.Mutation.CoreDeleteProjectManagedService == nil { - break - } - - args, err := ec.field_Mutation_core_deleteProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreDeleteProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvcName"].(string)), true - case "Mutation.core_deleteRouter": if e.complexity.Mutation.CoreDeleteRouter == nil { break @@ -3961,30 +3675,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true - case "Mutation.core_updateProject": - if e.complexity.Mutation.CoreUpdateProject == nil { - break - } - - args, err := ec.field_Mutation_core_updateProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreUpdateProject(childComplexity, args["project"].(entities.Project)), true - - case "Mutation.core_updateProjectManagedService": - if e.complexity.Mutation.CoreUpdateProjectManagedService == nil { - break - } - - args, err := ec.field_Mutation_core_updateProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Mutation.CoreUpdateProjectManagedService(childComplexity, args["projectName"].(string), args["pmsvc"].(entities.ProjectManagedService)), true - case "Mutation.core_updateRouter": if e.complexity.Mutation.CoreUpdateRouter == nil { break @@ -4111,300 +3801,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Port.TargetPort(childComplexity), true - case "Project.apiVersion": - if e.complexity.Project.APIVersion == nil { - break - } - - return e.complexity.Project.APIVersion(childComplexity), true - - case "Project.accountName": - if e.complexity.Project.AccountName == nil { - break - } - - return e.complexity.Project.AccountName(childComplexity), true - - case "Project.clusterName": - if e.complexity.Project.ClusterName == nil { - break - } - - return e.complexity.Project.ClusterName(childComplexity), true - - case "Project.createdBy": - if e.complexity.Project.CreatedBy == nil { - break - } - - return e.complexity.Project.CreatedBy(childComplexity), true - - case "Project.creationTime": - if e.complexity.Project.CreationTime == nil { - break - } - - return e.complexity.Project.CreationTime(childComplexity), true - - case "Project.displayName": - if e.complexity.Project.DisplayName == nil { - break - } - - return e.complexity.Project.DisplayName(childComplexity), true - - case "Project.id": - if e.complexity.Project.Id == nil { - break - } - - return e.complexity.Project.Id(childComplexity), true - - case "Project.kind": - if e.complexity.Project.Kind == nil { - break - } - - return e.complexity.Project.Kind(childComplexity), true - - case "Project.lastUpdatedBy": - if e.complexity.Project.LastUpdatedBy == nil { - break - } - - return e.complexity.Project.LastUpdatedBy(childComplexity), true - - case "Project.markedForDeletion": - if e.complexity.Project.MarkedForDeletion == nil { - break - } - - return e.complexity.Project.MarkedForDeletion(childComplexity), true - - case "Project.metadata": - if e.complexity.Project.ObjectMeta == nil { - break - } - - return e.complexity.Project.ObjectMeta(childComplexity), true - - case "Project.recordVersion": - if e.complexity.Project.RecordVersion == nil { - break - } - - return e.complexity.Project.RecordVersion(childComplexity), true - - case "Project.spec": - if e.complexity.Project.Spec == nil { - break - } - - return e.complexity.Project.Spec(childComplexity), true - - case "Project.status": - if e.complexity.Project.Status == nil { - break - } - - return e.complexity.Project.Status(childComplexity), true - - case "Project.syncStatus": - if e.complexity.Project.SyncStatus == nil { - break - } - - return e.complexity.Project.SyncStatus(childComplexity), true - - case "Project.updateTime": - if e.complexity.Project.UpdateTime == nil { - break - } - - return e.complexity.Project.UpdateTime(childComplexity), true - - case "ProjectEdge.cursor": - if e.complexity.ProjectEdge.Cursor == nil { - break - } - - return e.complexity.ProjectEdge.Cursor(childComplexity), true - - case "ProjectEdge.node": - if e.complexity.ProjectEdge.Node == nil { - break - } - - return e.complexity.ProjectEdge.Node(childComplexity), true - - case "ProjectManagedService.apiVersion": - if e.complexity.ProjectManagedService.APIVersion == nil { - break - } - - return e.complexity.ProjectManagedService.APIVersion(childComplexity), true - - case "ProjectManagedService.accountName": - if e.complexity.ProjectManagedService.AccountName == nil { - break - } - - return e.complexity.ProjectManagedService.AccountName(childComplexity), true - - case "ProjectManagedService.createdBy": - if e.complexity.ProjectManagedService.CreatedBy == nil { - break - } - - return e.complexity.ProjectManagedService.CreatedBy(childComplexity), true - - case "ProjectManagedService.creationTime": - if e.complexity.ProjectManagedService.CreationTime == nil { - break - } - - return e.complexity.ProjectManagedService.CreationTime(childComplexity), true - - case "ProjectManagedService.displayName": - if e.complexity.ProjectManagedService.DisplayName == nil { - break - } - - return e.complexity.ProjectManagedService.DisplayName(childComplexity), true - - case "ProjectManagedService.id": - if e.complexity.ProjectManagedService.Id == nil { - break - } - - return e.complexity.ProjectManagedService.Id(childComplexity), true - - case "ProjectManagedService.kind": - if e.complexity.ProjectManagedService.Kind == nil { - break - } - - return e.complexity.ProjectManagedService.Kind(childComplexity), true - - case "ProjectManagedService.lastUpdatedBy": - if e.complexity.ProjectManagedService.LastUpdatedBy == nil { - break - } - - return e.complexity.ProjectManagedService.LastUpdatedBy(childComplexity), true - - case "ProjectManagedService.markedForDeletion": - if e.complexity.ProjectManagedService.MarkedForDeletion == nil { - break - } - - return e.complexity.ProjectManagedService.MarkedForDeletion(childComplexity), true - - case "ProjectManagedService.metadata": - if e.complexity.ProjectManagedService.ObjectMeta == nil { - break - } - - return e.complexity.ProjectManagedService.ObjectMeta(childComplexity), true - - case "ProjectManagedService.projectName": - if e.complexity.ProjectManagedService.ProjectName == nil { - break - } - - return e.complexity.ProjectManagedService.ProjectName(childComplexity), true - - case "ProjectManagedService.recordVersion": - if e.complexity.ProjectManagedService.RecordVersion == nil { - break - } - - return e.complexity.ProjectManagedService.RecordVersion(childComplexity), true - - case "ProjectManagedService.spec": - if e.complexity.ProjectManagedService.Spec == nil { - break - } - - return e.complexity.ProjectManagedService.Spec(childComplexity), true - - case "ProjectManagedService.status": - if e.complexity.ProjectManagedService.Status == nil { - break - } - - return e.complexity.ProjectManagedService.Status(childComplexity), true - - case "ProjectManagedService.syncStatus": - if e.complexity.ProjectManagedService.SyncStatus == nil { - break - } - - return e.complexity.ProjectManagedService.SyncStatus(childComplexity), true - - case "ProjectManagedService.updateTime": - if e.complexity.ProjectManagedService.UpdateTime == nil { - break - } - - return e.complexity.ProjectManagedService.UpdateTime(childComplexity), true - - case "ProjectManagedServiceEdge.cursor": - if e.complexity.ProjectManagedServiceEdge.Cursor == nil { - break - } - - return e.complexity.ProjectManagedServiceEdge.Cursor(childComplexity), true - - case "ProjectManagedServiceEdge.node": - if e.complexity.ProjectManagedServiceEdge.Node == nil { - break - } - - return e.complexity.ProjectManagedServiceEdge.Node(childComplexity), true - - case "ProjectManagedServicePaginatedRecords.edges": - if e.complexity.ProjectManagedServicePaginatedRecords.Edges == nil { - break - } - - return e.complexity.ProjectManagedServicePaginatedRecords.Edges(childComplexity), true - - case "ProjectManagedServicePaginatedRecords.pageInfo": - if e.complexity.ProjectManagedServicePaginatedRecords.PageInfo == nil { - break - } - - return e.complexity.ProjectManagedServicePaginatedRecords.PageInfo(childComplexity), true - - case "ProjectManagedServicePaginatedRecords.totalCount": - if e.complexity.ProjectManagedServicePaginatedRecords.TotalCount == nil { - break - } - - return e.complexity.ProjectManagedServicePaginatedRecords.TotalCount(childComplexity), true - - case "ProjectPaginatedRecords.edges": - if e.complexity.ProjectPaginatedRecords.Edges == nil { - break - } - - return e.complexity.ProjectPaginatedRecords.Edges(childComplexity), true - - case "ProjectPaginatedRecords.pageInfo": - if e.complexity.ProjectPaginatedRecords.PageInfo == nil { - break - } - - return e.complexity.ProjectPaginatedRecords.PageInfo(childComplexity), true - - case "ProjectPaginatedRecords.totalCount": - if e.complexity.ProjectPaginatedRecords.TotalCount == nil { - break - } - - return e.complexity.ProjectPaginatedRecords.TotalCount(childComplexity), true - case "Query.core_checkNameAvailability": if e.complexity.Query.CoreCheckNameAvailability == nil { break @@ -4513,30 +3909,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreGetManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true - case "Query.core_getProject": - if e.complexity.Query.CoreGetProject == nil { - break - } - - args, err := ec.field_Query_core_getProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreGetProject(childComplexity, args["name"].(string)), true - - case "Query.core_getProjectManagedService": - if e.complexity.Query.CoreGetProjectManagedService == nil { - break - } - - args, err := ec.field_Query_core_getProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreGetProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true - case "Query.core_getRouter": if e.complexity.Query.CoreGetRouter == nil { break @@ -4645,30 +4017,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreListManagedResources(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchManagedResources), args["pq"].(*repos.CursorPagination)), true - case "Query.core_listProjectManagedServices": - if e.complexity.Query.CoreListProjectManagedServices == nil { - break - } - - args, err := ec.field_Query_core_listProjectManagedServices_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreListProjectManagedServices(childComplexity, args["projectName"].(string), args["search"].(*model.SearchProjectManagedService), args["pq"].(*repos.CursorPagination)), true - - case "Query.core_listProjects": - if e.complexity.Query.CoreListProjects == nil { - break - } - - args, err := ec.field_Query_core_listProjects_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreListProjects(childComplexity, args["search"].(*model.SearchProjects), args["pq"].(*repos.CursorPagination)), true - case "Query.core_listRouters": if e.complexity.Query.CoreListRouters == nil { break @@ -4724,18 +4072,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreRestartApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appName"].(string)), true - case "Query.core_restartProjectManagedService": - if e.complexity.Query.CoreRestartProjectManagedService == nil { - break - } - - args, err := ec.field_Query_core_restartProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreRestartProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true - case "Query.core_resyncApp": if e.complexity.Query.CoreResyncApp == nil { break @@ -4796,30 +4132,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true - case "Query.core_resyncProject": - if e.complexity.Query.CoreResyncProject == nil { - break - } - - args, err := ec.field_Query_core_resyncProject_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreResyncProject(childComplexity, args["name"].(string)), true - - case "Query.core_resyncProjectManagedService": - if e.complexity.Query.CoreResyncProjectManagedService == nil { - break - } - - args, err := ec.field_Query_core_resyncProjectManagedService_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CoreResyncProjectManagedService(childComplexity, args["projectName"].(string), args["name"].(string)), true - case "Query.core_resyncRouter": if e.complexity.Query.CoreResyncRouter == nil { break @@ -4947,13 +4259,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Router.ObjectMeta(childComplexity), true - case "Router.projectName": - if e.complexity.Router.ProjectName == nil { - break - } - - return e.complexity.Router.ProjectName(childComplexity), true - case "Router.recordVersion": if e.complexity.Router.RecordVersion == nil { break @@ -5122,13 +4427,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Secret.ObjectMeta(childComplexity), true - case "Secret.projectName": - if e.complexity.Secret.ProjectName == nil { - break - } - - return e.complexity.Secret.ProjectName(childComplexity), true - case "Secret.recordVersion": if e.complexity.Secret.RecordVersion == nil { break @@ -5274,16 +4572,12 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__HttpsIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__InterceptIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn, - ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProbeIn, - ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn, - ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouteIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RouterSpecIn, - ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__TcpProbeIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecordIn, @@ -5300,8 +4594,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputMatchFilterIn, ec.unmarshalInputMetadataIn, ec.unmarshalInputPortIn, - ec.unmarshalInputProjectIn, - ec.unmarshalInputProjectManagedServiceIn, ec.unmarshalInputRouterIn, ec.unmarshalInputSearchApps, ec.unmarshalInputSearchConfigs, @@ -5417,7 +4709,7 @@ directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION enum ConsoleResType { - project + # project app config secret @@ -5500,9 +4792,9 @@ input CoreSearchVPNDevices { type Query { core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount - core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount - core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount + # core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount @@ -5538,10 +4830,10 @@ type Query { core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount - core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount @@ -5549,9 +4841,9 @@ type Query { } type Mutation { - core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount - core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount - core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + # core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + # core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount @@ -5583,9 +4875,10 @@ type Mutation { core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount @@ -5620,7 +4913,6 @@ extend type App { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpec! status: Github__com___kloudlite___operator___pkg___operator__Status @@ -5757,7 +5049,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting @ } type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec @shareable { - projectName: String! routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting targetNamespace: String } @@ -5792,12 +5083,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate! } -type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { - nodeSelector: Map - serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! - tolerations: [K8s__io___api___core___v1__Toleration!] -} - type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate @shareable { apiVersion: String! kind: String! @@ -5822,15 +5107,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__Probe @shareable { type: String! } -type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec @shareable { - msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! - targetNamespace: String! -} - -type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec @shareable { - targetNamespace: String! -} - type Github__com___kloudlite___operator___apis___crds___v1__RateLimit @shareable { connections: Int enabled: Boolean @@ -5857,12 +5133,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec @shareabl routes: [Github__com___kloudlite___operator___apis___crds___v1__Route!] } -type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { - apiVersion: String! - kind: String! - spec: Map! -} - type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe @shareable { command: [String!] } @@ -6071,7 +5341,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingI } input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn { - projectName: String! routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn targetNamespace: String } @@ -6106,12 +5375,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn! } -input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { - nodeSelector: Map - serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! - tolerations: [K8s__io___api___core___v1__TolerationIn!] -} - input Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn { apiVersion: String! kind: String! @@ -6136,15 +5399,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__ProbeIn { type: String! } -input Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn { - msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! - targetNamespace: String! -} - -input Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn { - targetNamespace: String! -} - input Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn { connections: Int enabled: Boolean @@ -6171,12 +5425,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn { routes: [Github__com___kloudlite___operator___apis___crds___v1__RouteIn!] } -input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { - apiVersion: String! - kind: String! - spec: Map! -} - input Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn { command: [String!] } @@ -6326,7 +5574,6 @@ enum K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorOperator { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! @@ -6458,6 +5705,7 @@ directive @goField( {Name: "../struct-to-graphql/environment.graphqls", Input: `type Environment @shareable { accountName: String! apiVersion: String + clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! @@ -6466,7 +5714,6 @@ directive @goField( lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec status: Github__com___kloudlite___operator___pkg___operator__Status @@ -6487,6 +5734,7 @@ type EnvironmentPaginatedRecords @shareable { input EnvironmentIn { apiVersion: String + clusterName: String! displayName: String! kind: String metadata: MetadataIn @@ -6506,7 +5754,6 @@ input EnvironmentIn { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! @goField(name: "objectMeta") - projectName: String! recordVersion: Int! registryPassword: String registryURL: String @@ -6550,7 +5797,6 @@ input ImagePullSecretIn { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec! status: Github__com___kloudlite___operator___pkg___operator__Status @@ -6635,85 +5881,6 @@ input PortIn { targetPort: Int } -`, BuiltIn: false}, - {Name: "../struct-to-graphql/project.graphqls", Input: `type Project @shareable { - accountName: String! - apiVersion: String - clusterName: String - createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - creationTime: Date! - displayName: String! - id: ID! - kind: String - lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - markedForDeletion: Boolean - metadata: Metadata @goField(name: "objectMeta") - recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec! - status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! - updateTime: Date! -} - -type ProjectEdge @shareable { - cursor: String! - node: Project! -} - -type ProjectPaginatedRecords @shareable { - edges: [ProjectEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -input ProjectIn { - apiVersion: String - clusterName: String - displayName: String! - kind: String - metadata: MetadataIn - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn! -} - -`, BuiltIn: false}, - {Name: "../struct-to-graphql/projectmanagedservice.graphqls", Input: `type ProjectManagedService @shareable { - accountName: String! - apiVersion: String - createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - creationTime: Date! - displayName: String! - id: ID! - kind: String - lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - markedForDeletion: Boolean - metadata: Metadata @goField(name: "objectMeta") - projectName: String! - recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec - status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! - updateTime: Date! -} - -type ProjectManagedServiceEdge @shareable { - cursor: String! - node: ProjectManagedService! -} - -type ProjectManagedServicePaginatedRecords @shareable { - edges: [ProjectManagedServiceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -input ProjectManagedServiceIn { - apiVersion: String - displayName: String! - kind: String - metadata: MetadataIn - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn -} - `, BuiltIn: false}, {Name: "../struct-to-graphql/router.graphqls", Input: `type Router @shareable { accountName: String! @@ -6728,7 +5895,6 @@ input ProjectManagedServiceIn { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status @@ -6777,7 +5943,6 @@ scalar Date lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! stringData: Map syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! @@ -7124,45 +6289,6 @@ func (ec *executionContext) field_Mutation_core_createManagedResource_args(ctx c return args, nil } -func (ec *executionContext) field_Mutation_core_createProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 entities.ProjectManagedService - if tmp, ok := rawArgs["pmsvc"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvc")) - arg1, err = ec.unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pmsvc"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Mutation_core_createProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Project - if tmp, ok := rawArgs["project"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) - arg0, err = ec.unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, tmp) - if err != nil { - return nil, err - } - } - args["project"] = arg0 - return args, nil -} - func (ec *executionContext) field_Mutation_core_createRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -7400,45 +6526,6 @@ func (ec *executionContext) field_Mutation_core_deleteManagedResource_args(ctx c return args, nil } -func (ec *executionContext) field_Mutation_core_deleteProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["pmsvcName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvcName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pmsvcName"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Mutation_core_deleteProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - func (ec *executionContext) field_Mutation_core_deleteRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -7694,45 +6781,6 @@ func (ec *executionContext) field_Mutation_core_updateManagedResource_args(ctx c return args, nil } -func (ec *executionContext) field_Mutation_core_updateProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 entities.ProjectManagedService - if tmp, ok := rawArgs["pmsvc"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvc")) - arg1, err = ec.unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pmsvc"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Mutation_core_updateProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 entities.Project - if tmp, ok := rawArgs["project"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("project")) - arg0, err = ec.unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, tmp) - if err != nil { - return nil, err - } - } - args["project"] = arg0 - return args, nil -} - func (ec *executionContext) field_Mutation_core_updateRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -8246,7 +7294,7 @@ func (ec *executionContext) field_Query_core_getManagedResource_args(ctx context return args, nil } -func (ec *executionContext) field_Query_core_getProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_getRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -8259,66 +7307,27 @@ func (ec *executionContext) field_Query_core_getProjectManagedService_args(ctx c } args["projectName"] = arg0 var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_core_getProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + args["envName"] = arg1 + var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg0 + args["name"] = arg2 return args, nil } -func (ec *executionContext) field_Query_core_getRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_core_getSecretValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_getSecretValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -8600,63 +7609,6 @@ func (ec *executionContext) field_Query_core_listManagedResources_args(ctx conte return args, nil } -func (ec *executionContext) field_Query_core_listProjectManagedServices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 *model.SearchProjectManagedService - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg1, err = ec.unmarshalOSearchProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjectManagedService(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg1 - var arg2 *repos.CursorPagination - if tmp, ok := rawArgs["pq"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pq"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_core_listProjects_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.SearchProjects - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg0, err = ec.unmarshalOSearchProjects2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjects(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg0 - var arg1 *repos.CursorPagination - if tmp, ok := rawArgs["pq"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pq"] = arg1 - return args, nil -} - func (ec *executionContext) field_Query_core_listRouters_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -8798,30 +7750,6 @@ func (ec *executionContext) field_Query_core_restartApp_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Query_core_restartProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg1 - return args, nil -} - func (ec *executionContext) field_Query_core_resyncApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -8978,45 +7906,6 @@ func (ec *executionContext) field_Query_core_resyncManagedResource_args(ctx cont return args, nil } -func (ec *executionContext) field_Query_core_resyncProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg1 - return args, nil -} - -func (ec *executionContext) field_Query_core_resyncProject_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - func (ec *executionContext) field_Query_core_resyncRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -9707,50 +8596,6 @@ func (ec *executionContext) fieldContext_App_metadata(ctx context.Context, field return fc, nil } -func (ec *executionContext) _App_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_App_projectName(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.ProjectName, 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_App_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "App", - 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) _App_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.App) (ret graphql.Marshaler) { fc, err := ec.fieldContext_App_recordVersion(ctx, field) if err != nil { @@ -10178,8 +9023,6 @@ func (ec *executionContext) fieldContext_AppEdge_node(ctx context.Context, field return ec.fieldContext_App_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_App_metadata(ctx, field) - case "projectName": - return ec.fieldContext_App_projectName(ctx, field) case "recordVersion": return ec.fieldContext_App_recordVersion(ctx, field) case "spec": @@ -11044,50 +9887,6 @@ func (ec *executionContext) fieldContext_Config_metadata(ctx context.Context, fi return fc, nil } -func (ec *executionContext) _Config_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Config_projectName(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.ProjectName, 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_Config_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Config", - 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) _Config_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Config) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Config_recordVersion(ctx, field) if err != nil { @@ -11345,8 +10144,6 @@ func (ec *executionContext) fieldContext_ConfigEdge_node(ctx context.Context, fi return ec.fieldContext_Config_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Config_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Config_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Config_recordVersion(ctx, field) case "syncStatus": @@ -13410,6 +12207,50 @@ func (ec *executionContext) fieldContext_Environment_apiVersion(ctx context.Cont return fc, nil } +func (ec *executionContext) _Environment_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Environment_clusterName(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.ClusterName, 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_Environment_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Environment", + 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) _Environment_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Environment_createdBy(ctx, field) if err != nil { @@ -13785,50 +12626,6 @@ func (ec *executionContext) fieldContext_Environment_metadata(ctx context.Contex return fc, nil } -func (ec *executionContext) _Environment_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Environment_projectName(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.ProjectName, 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_Environment_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Environment", - 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) _Environment_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Environment) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Environment_recordVersion(ctx, field) if err != nil { @@ -13909,8 +12706,6 @@ func (ec *executionContext) fieldContext_Environment_spec(ctx context.Context, f IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "projectName": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx, field) case "routing": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field) case "targetNamespace": @@ -14168,6 +12963,8 @@ func (ec *executionContext) fieldContext_EnvironmentEdge_node(ctx context.Contex return ec.fieldContext_Environment_accountName(ctx, field) case "apiVersion": return ec.fieldContext_Environment_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Environment_clusterName(ctx, field) case "createdBy": return ec.fieldContext_Environment_createdBy(ctx, field) case "creationTime": @@ -14184,8 +12981,6 @@ func (ec *executionContext) fieldContext_EnvironmentEdge_node(ctx context.Contex return ec.fieldContext_Environment_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Environment_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Environment_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Environment_recordVersion(ctx, field) case "spec": @@ -17199,50 +15994,6 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(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.ProjectName, 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_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec", - 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) _Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field) if err != nil { @@ -17979,152 +16730,6 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_nodeSelector(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.NodeSelector, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(map[string]interface{}) - fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_nodeSelector(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(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.ServiceTemplate, 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.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "apiVersion": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field) - case "spec": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_tolerations(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_tolerations(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.Tolerations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*model.K8sIoAPICoreV1Toleration) - fc.Result = res - return ec.marshalOK8s__io___api___core___v1__Toleration2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1Tolerationᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_tolerations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "effect": - return ec.fieldContext_K8s__io___api___core___v1__Toleration_effect(ctx, field) - case "key": - return ec.fieldContext_K8s__io___api___core___v1__Toleration_key(ctx, field) - case "operator": - return ec.fieldContext_K8s__io___api___core___v1__Toleration_operator(ctx, field) - case "tolerationSeconds": - return ec.fieldContext_K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field) - case "value": - return ec.fieldContext_K8s__io___api___core___v1__Toleration_value(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Toleration", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field) if err != nil { @@ -18793,146 +17398,6 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(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.MsvcSpec, 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.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "nodeSelector": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_nodeSelector(ctx, field) - case "serviceTemplate": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field) - case "tolerations": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_tolerations(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(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.TargetNamespace, 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_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", - 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) _Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(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.TargetNamespace, 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_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec", - 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) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RateLimit_connections(ctx, field) if err != nil { @@ -19686,138 +18151,6 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(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.APIVersion, 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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", - 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) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(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.Kind, 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_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", - 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) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(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.Spec, 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.(map[string]interface{}) - fc.Result = res - return ec.marshalNMap2map(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Map does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ShellProbe_command(ctx, field) if err != nil { @@ -21867,50 +20200,6 @@ func (ec *executionContext) fieldContext_ImagePullSecret_metadata(ctx context.Co return fc, nil } -func (ec *executionContext) _ImagePullSecret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ImagePullSecret_projectName(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.ProjectName, 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_ImagePullSecret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ImagePullSecret", - 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) _ImagePullSecret_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ImagePullSecret) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) if err != nil { @@ -22285,8 +20574,6 @@ func (ec *executionContext) fieldContext_ImagePullSecretEdge_node(ctx context.Co return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ImagePullSecret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ImagePullSecret_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) case "registryPassword": @@ -24069,50 +22356,6 @@ func (ec *executionContext) fieldContext_ManagedResource_metadata(ctx context.Co return fc, nil } -func (ec *executionContext) _ManagedResource_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ManagedResource_projectName(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.ProjectName, 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_ManagedResource_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ManagedResource", - 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) _ManagedResource_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ManagedResource) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ManagedResource_recordVersion(ctx, field) if err != nil { @@ -24530,8 +22773,6 @@ func (ec *executionContext) fieldContext_ManagedResourceEdge_node(ctx context.Co return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ManagedResource_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ManagedResource_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ManagedResource_recordVersion(ctx, field) case "spec": @@ -25382,8 +23623,8 @@ func (ec *executionContext) fieldContext_Metadata_namespace(ctx context.Context, return fc, nil } -func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createProject(ctx, field) +func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -25397,7 +23638,7 @@ func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, fi resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateProject(rctx, fc.Args["project"].(entities.Project)) + return ec.resolvers.Mutation().CoreCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25419,10 +23660,10 @@ func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, fi if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Project); ok { + if data, ok := tmp.(*entities.Environment); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -25431,12 +23672,12 @@ func (ec *executionContext) _Mutation_core_createProject(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(*entities.Environment) fc.Result = res - return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25445,39 +23686,39 @@ func (ec *executionContext) fieldContext_Mutation_core_createProject(ctx context Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Project_accountName(ctx, field) + return ec.fieldContext_Environment_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) + return ec.fieldContext_Environment_apiVersion(ctx, field) case "clusterName": - return ec.fieldContext_Project_clusterName(ctx, field) + return ec.fieldContext_Environment_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_Project_createdBy(ctx, field) + return ec.fieldContext_Environment_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Project_creationTime(ctx, field) + return ec.fieldContext_Environment_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Project_displayName(ctx, field) + return ec.fieldContext_Environment_displayName(ctx, field) case "id": - return ec.fieldContext_Project_id(ctx, field) + return ec.fieldContext_Environment_id(ctx, field) case "kind": - return ec.fieldContext_Project_kind(ctx, field) + return ec.fieldContext_Environment_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Project_markedForDeletion(ctx, field) + return ec.fieldContext_Environment_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) + return ec.fieldContext_Environment_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Project_recordVersion(ctx, field) + return ec.fieldContext_Environment_recordVersion(ctx, field) case "spec": - return ec.fieldContext_Project_spec(ctx, field) + return ec.fieldContext_Environment_spec(ctx, field) case "status": - return ec.fieldContext_Project_status(ctx, field) + return ec.fieldContext_Environment_status(ctx, field) case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) + return ec.fieldContext_Environment_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Project_updateTime(ctx, field) + return ec.fieldContext_Environment_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) }, } defer func() { @@ -25487,15 +23728,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createProject(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateProject(ctx, field) +func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -25509,7 +23750,7 @@ func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, fi resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateProject(rctx, fc.Args["project"].(entities.Project)) + return ec.resolvers.Mutation().CoreUpdateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25531,10 +23772,10 @@ func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, fi if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Project); ok { + if data, ok := tmp.(*entities.Environment); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -25543,12 +23784,12 @@ func (ec *executionContext) _Mutation_core_updateProject(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(*entities.Environment) fc.Result = res - return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25557,39 +23798,39 @@ func (ec *executionContext) fieldContext_Mutation_core_updateProject(ctx context Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Project_accountName(ctx, field) + return ec.fieldContext_Environment_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) + return ec.fieldContext_Environment_apiVersion(ctx, field) case "clusterName": - return ec.fieldContext_Project_clusterName(ctx, field) + return ec.fieldContext_Environment_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_Project_createdBy(ctx, field) + return ec.fieldContext_Environment_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Project_creationTime(ctx, field) + return ec.fieldContext_Environment_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Project_displayName(ctx, field) + return ec.fieldContext_Environment_displayName(ctx, field) case "id": - return ec.fieldContext_Project_id(ctx, field) + return ec.fieldContext_Environment_id(ctx, field) case "kind": - return ec.fieldContext_Project_kind(ctx, field) + return ec.fieldContext_Environment_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Project_lastUpdatedBy(ctx, field) + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Project_markedForDeletion(ctx, field) + return ec.fieldContext_Environment_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) + return ec.fieldContext_Environment_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Project_recordVersion(ctx, field) + return ec.fieldContext_Environment_recordVersion(ctx, field) case "spec": - return ec.fieldContext_Project_spec(ctx, field) + return ec.fieldContext_Environment_spec(ctx, field) case "status": - return ec.fieldContext_Project_status(ctx, field) + return ec.fieldContext_Environment_status(ctx, field) case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) + return ec.fieldContext_Environment_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Project_updateTime(ctx, field) + return ec.fieldContext_Environment_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) }, } defer func() { @@ -25599,15 +23840,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateProject(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteProject(ctx, field) +func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -25621,7 +23862,7 @@ func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, fi resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteProject(rctx, fc.Args["name"].(string)) + return ec.resolvers.Mutation().CoreDeleteEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25663,7 +23904,7 @@ func (ec *executionContext) _Mutation_core_deleteProject(ctx context.Context, fi return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25680,15 +23921,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteProject(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createEnvironment(ctx, field) +func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_cloneEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -25702,7 +23943,7 @@ func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + return ec.resolvers.Mutation().CoreCloneEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["sourceEnvName"].(string), fc.Args["destinationEnvName"].(string), fc.Args["displayName"].(string), fc.Args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25741,7 +23982,7 @@ func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25753,6 +23994,8 @@ func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(ctx con return ec.fieldContext_Environment_accountName(ctx, field) case "apiVersion": return ec.fieldContext_Environment_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Environment_clusterName(ctx, field) case "createdBy": return ec.fieldContext_Environment_createdBy(ctx, field) case "creationTime": @@ -25769,8 +24012,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(ctx con return ec.fieldContext_Environment_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Environment_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Environment_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Environment_recordVersion(ctx, field) case "spec": @@ -25792,15 +24033,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createEnvironment(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_cloneEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateEnvironment(ctx, field) +func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createImagePullSecret(ctx, field) if err != nil { return graphql.Null } @@ -25814,7 +24055,7 @@ func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + return ec.resolvers.Mutation().CoreCreateImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["imagePullSecretIn"].(entities.ImagePullSecret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25836,10 +24077,10 @@ func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Environment); ok { + if data, ok := tmp.(*entities.ImagePullSecret); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -25848,12 +24089,12 @@ func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Environment) + res := resTmp.(*entities.ImagePullSecret) fc.Result = res - return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) + return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25862,39 +24103,41 @@ func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(ctx con Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Environment_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Environment_apiVersion(ctx, field) + return ec.fieldContext_ImagePullSecret_accountName(ctx, field) case "createdBy": - return ec.fieldContext_Environment_createdBy(ctx, field) + return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Environment_creationTime(ctx, field) + return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Environment_displayName(ctx, field) + return ec.fieldContext_ImagePullSecret_displayName(ctx, field) + case "dockerConfigJson": + return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + case "environmentName": + return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + case "format": + return ec.fieldContext_ImagePullSecret_format(ctx, field) case "id": - return ec.fieldContext_Environment_id(ctx, field) - case "kind": - return ec.fieldContext_Environment_kind(ctx, field) + return ec.fieldContext_ImagePullSecret_id(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Environment_markedForDeletion(ctx, field) + return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Environment_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Environment_projectName(ctx, field) + return ec.fieldContext_ImagePullSecret_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Environment_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_Environment_spec(ctx, field) - case "status": - return ec.fieldContext_Environment_status(ctx, field) + return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + case "registryPassword": + return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + case "registryURL": + return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + case "registryUsername": + return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) case "syncStatus": - return ec.fieldContext_Environment_syncStatus(ctx, field) + return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Environment_updateTime(ctx, field) + return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) }, } defer func() { @@ -25904,15 +24147,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteEnvironment(ctx, field) +func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteImagePullSecret(ctx, field) if err != nil { return graphql.Null } @@ -25926,7 +24169,7 @@ func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string)) + return ec.resolvers.Mutation().CoreDeleteImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25968,7 +24211,7 @@ func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -25985,15 +24228,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteEnvironment(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_cloneEnvironment(ctx, field) +func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createApp(ctx, field) if err != nil { return graphql.Null } @@ -26007,7 +24250,7 @@ func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCloneEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["sourceEnvName"].(string), fc.Args["destinationEnvName"].(string), fc.Args["displayName"].(string), fc.Args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)) + return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26029,10 +24272,10 @@ func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Environment); ok { + if data, ok := tmp.(*entities.App); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Environment`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -26041,12 +24284,12 @@ func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Environment) + res := resTmp.(*entities.App) fc.Result = res - return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26055,39 +24298,45 @@ func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx cont Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Environment_accountName(ctx, field) + return ec.fieldContext_App_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Environment_apiVersion(ctx, field) + return ec.fieldContext_App_apiVersion(ctx, field) + case "ciBuildId": + return ec.fieldContext_App_ciBuildId(ctx, field) case "createdBy": - return ec.fieldContext_Environment_createdBy(ctx, field) + return ec.fieldContext_App_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Environment_creationTime(ctx, field) + return ec.fieldContext_App_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Environment_displayName(ctx, field) + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) case "id": - return ec.fieldContext_Environment_id(ctx, field) + return ec.fieldContext_App_id(ctx, field) case "kind": - return ec.fieldContext_Environment_kind(ctx, field) + return ec.fieldContext_App_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + return ec.fieldContext_App_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Environment_markedForDeletion(ctx, field) + return ec.fieldContext_App_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Environment_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Environment_projectName(ctx, field) + return ec.fieldContext_App_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Environment_recordVersion(ctx, field) + return ec.fieldContext_App_recordVersion(ctx, field) case "spec": - return ec.fieldContext_Environment_spec(ctx, field) + return ec.fieldContext_App_spec(ctx, field) case "status": - return ec.fieldContext_Environment_status(ctx, field) + return ec.fieldContext_App_status(ctx, field) case "syncStatus": - return ec.fieldContext_Environment_syncStatus(ctx, field) + return ec.fieldContext_App_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Environment_updateTime(ctx, field) + return ec.fieldContext_App_updateTime(ctx, field) + case "build": + return ec.fieldContext_App_build(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Environment", field.Name) + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) }, } defer func() { @@ -26097,15 +24346,15 @@ func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_cloneEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createImagePullSecret(ctx, field) +func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateApp(ctx, field) if err != nil { return graphql.Null } @@ -26119,7 +24368,7 @@ func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["imagePullSecretIn"].(entities.ImagePullSecret)) + return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26141,10 +24390,10 @@ func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Con if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ImagePullSecret); ok { + if data, ok := tmp.(*entities.App); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -26153,12 +24402,12 @@ func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Con if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ImagePullSecret) + res := resTmp.(*entities.App) fc.Result = res - return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26167,43 +24416,45 @@ func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(ctx Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ImagePullSecret_accountName(ctx, field) + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "ciBuildId": + return ec.fieldContext_App_ciBuildId(ctx, field) case "createdBy": - return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + return ec.fieldContext_App_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + return ec.fieldContext_App_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ImagePullSecret_displayName(ctx, field) - case "dockerConfigJson": - return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) case "environmentName": - return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) - case "format": - return ec.fieldContext_ImagePullSecret_format(ctx, field) + return ec.fieldContext_App_environmentName(ctx, field) case "id": - return ec.fieldContext_ImagePullSecret_id(ctx, field) + return ec.fieldContext_App_id(ctx, field) + case "kind": + return ec.fieldContext_App_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + return ec.fieldContext_App_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + return ec.fieldContext_App_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ImagePullSecret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ImagePullSecret_projectName(ctx, field) + return ec.fieldContext_App_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) - case "registryPassword": - return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) - case "registryURL": - return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) - case "registryUsername": - return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + return ec.fieldContext_App_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_App_spec(ctx, field) + case "status": + return ec.fieldContext_App_status(ctx, field) case "syncStatus": - return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + return ec.fieldContext_App_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + return ec.fieldContext_App_updateTime(ctx, field) + case "build": + return ec.fieldContext_App_build(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) }, } defer func() { @@ -26213,15 +24464,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteImagePullSecret(ctx, field) +func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteApp(ctx, field) if err != nil { return graphql.Null } @@ -26235,7 +24486,7 @@ func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26277,7 +24528,7 @@ func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Con return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26294,15 +24545,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteImagePullSecret(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createApp(ctx, field) +func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_interceptApp(ctx, field) if err != nil { return graphql.Null } @@ -26316,7 +24567,7 @@ func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + return ec.resolvers.Mutation().CoreInterceptApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appname"].(string), fc.Args["deviceName"].(string), fc.Args["intercept"].(bool)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26338,73 +24589,34 @@ func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.App); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.App) + res := resTmp.(bool) fc.Result = res - return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_interceptApp(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) { - switch field.Name { - case "accountName": - return ec.fieldContext_App_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "ciBuildId": - return ec.fieldContext_App_ciBuildId(ctx, field) - case "createdBy": - return ec.fieldContext_App_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_App_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_App_displayName(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_App_environmentName(ctx, field) - case "id": - return ec.fieldContext_App_id(ctx, field) - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_App_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_App_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "projectName": - return ec.fieldContext_App_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_App_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_App_updateTime(ctx, field) - case "build": - return ec.fieldContext_App_build(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -26414,15 +24626,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createApp(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_interceptApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateApp(ctx, field) +func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createConfig(ctx, field) if err != nil { return graphql.Null } @@ -26436,7 +24648,7 @@ func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26458,10 +24670,10 @@ func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.App); ok { + if data, ok := tmp.(*entities.Config); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -26470,12 +24682,12 @@ func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.App) + res := resTmp.(*entities.Config) fc.Result = res - return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26484,47 +24696,41 @@ func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Con Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_App_accountName(ctx, field) + return ec.fieldContext_Config_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "ciBuildId": - return ec.fieldContext_App_ciBuildId(ctx, field) + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) case "createdBy": - return ec.fieldContext_App_createdBy(ctx, field) + return ec.fieldContext_Config_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_App_creationTime(ctx, field) + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) case "displayName": - return ec.fieldContext_App_displayName(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) + return ec.fieldContext_Config_displayName(ctx, field) case "environmentName": - return ec.fieldContext_App_environmentName(ctx, field) + return ec.fieldContext_Config_environmentName(ctx, field) case "id": - return ec.fieldContext_App_id(ctx, field) + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) case "kind": - return ec.fieldContext_App_kind(ctx, field) + return ec.fieldContext_Config_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_App_lastUpdatedBy(ctx, field) + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_App_markedForDeletion(ctx, field) + return ec.fieldContext_Config_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "projectName": - return ec.fieldContext_App_projectName(ctx, field) + return ec.fieldContext_Config_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_App_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) + return ec.fieldContext_Config_recordVersion(ctx, field) case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) + return ec.fieldContext_Config_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_App_updateTime(ctx, field) - case "build": - return ec.fieldContext_App_build(ctx, field) + return ec.fieldContext_Config_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) }, } defer func() { @@ -26534,15 +24740,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteApp(ctx, field) +func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateConfig(ctx, field) if err != nil { return graphql.Null } @@ -26556,7 +24762,7 @@ func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26578,34 +24784,67 @@ func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*entities.Config); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) }) 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) + res := resTmp.(*entities.Config) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateConfig(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 Boolean does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_Config_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) + case "createdBy": + return ec.fieldContext_Config_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Config_creationTime(ctx, field) + case "data": + return ec.fieldContext_Config_data(ctx, field) + case "displayName": + return ec.fieldContext_Config_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Config_environmentName(ctx, field) + case "id": + return ec.fieldContext_Config_id(ctx, field) + case "immutable": + return ec.fieldContext_Config_immutable(ctx, field) + case "kind": + return ec.fieldContext_Config_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Config_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Config_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Config_recordVersion(ctx, field) + case "syncStatus": + return ec.fieldContext_Config_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Config_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) }, } defer func() { @@ -26615,15 +24854,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteApp(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_interceptApp(ctx, field) +func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteConfig(ctx, field) if err != nil { return graphql.Null } @@ -26637,7 +24876,7 @@ func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreInterceptApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appname"].(string), fc.Args["deviceName"].(string), fc.Args["intercept"].(bool)) + return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["configName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26679,7 +24918,7 @@ func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_interceptApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26696,15 +24935,15 @@ func (ec *executionContext) fieldContext_Mutation_core_interceptApp(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_interceptApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createConfig(ctx, field) +func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createSecret(ctx, field) if err != nil { return graphql.Null } @@ -26718,7 +24957,7 @@ func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26740,10 +24979,10 @@ func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Config); ok { + if data, ok := tmp.(*entities.Secret); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -26752,12 +24991,12 @@ func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(*entities.Secret) fc.Result = res - return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26766,43 +25005,45 @@ func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Config_accountName(ctx, field) + return ec.fieldContext_Secret_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "binaryData": - return ec.fieldContext_Config_binaryData(ctx, field) + return ec.fieldContext_Secret_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Config_createdBy(ctx, field) + return ec.fieldContext_Secret_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Config_creationTime(ctx, field) + return ec.fieldContext_Secret_creationTime(ctx, field) case "data": - return ec.fieldContext_Config_data(ctx, field) + return ec.fieldContext_Secret_data(ctx, field) case "displayName": - return ec.fieldContext_Config_displayName(ctx, field) + return ec.fieldContext_Secret_displayName(ctx, field) case "environmentName": - return ec.fieldContext_Config_environmentName(ctx, field) + return ec.fieldContext_Secret_environmentName(ctx, field) case "id": - return ec.fieldContext_Config_id(ctx, field) + return ec.fieldContext_Secret_id(ctx, field) case "immutable": - return ec.fieldContext_Config_immutable(ctx, field) + return ec.fieldContext_Secret_immutable(ctx, field) + case "isReadyOnly": + return ec.fieldContext_Secret_isReadyOnly(ctx, field) case "kind": - return ec.fieldContext_Config_kind(ctx, field) + return ec.fieldContext_Secret_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Config_markedForDeletion(ctx, field) + return ec.fieldContext_Secret_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Config_projectName(ctx, field) + return ec.fieldContext_Secret_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Config_recordVersion(ctx, field) + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) case "updateTime": - return ec.fieldContext_Config_updateTime(ctx, field) + return ec.fieldContext_Secret_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) }, } defer func() { @@ -26812,15 +25053,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateConfig(ctx, field) +func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateSecret(ctx, field) if err != nil { return graphql.Null } @@ -26834,7 +25075,7 @@ func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26856,10 +25097,10 @@ func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Config); ok { + if data, ok := tmp.(*entities.Secret); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -26868,12 +25109,12 @@ func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(*entities.Secret) fc.Result = res - return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -26882,43 +25123,45 @@ func (ec *executionContext) fieldContext_Mutation_core_updateConfig(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Config_accountName(ctx, field) + return ec.fieldContext_Secret_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "binaryData": - return ec.fieldContext_Config_binaryData(ctx, field) + return ec.fieldContext_Secret_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Config_createdBy(ctx, field) + return ec.fieldContext_Secret_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Config_creationTime(ctx, field) + return ec.fieldContext_Secret_creationTime(ctx, field) case "data": - return ec.fieldContext_Config_data(ctx, field) + return ec.fieldContext_Secret_data(ctx, field) case "displayName": - return ec.fieldContext_Config_displayName(ctx, field) + return ec.fieldContext_Secret_displayName(ctx, field) case "environmentName": - return ec.fieldContext_Config_environmentName(ctx, field) + return ec.fieldContext_Secret_environmentName(ctx, field) case "id": - return ec.fieldContext_Config_id(ctx, field) + return ec.fieldContext_Secret_id(ctx, field) case "immutable": - return ec.fieldContext_Config_immutable(ctx, field) + return ec.fieldContext_Secret_immutable(ctx, field) + case "isReadyOnly": + return ec.fieldContext_Secret_isReadyOnly(ctx, field) case "kind": - return ec.fieldContext_Config_kind(ctx, field) + return ec.fieldContext_Secret_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Config_markedForDeletion(ctx, field) + return ec.fieldContext_Secret_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Config_projectName(ctx, field) + return ec.fieldContext_Secret_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Config_recordVersion(ctx, field) + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) case "updateTime": - return ec.fieldContext_Config_updateTime(ctx, field) + return ec.fieldContext_Secret_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) }, } defer func() { @@ -26928,15 +25171,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateConfig(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteConfig(ctx, field) +func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteSecret(ctx, field) if err != nil { return graphql.Null } @@ -26950,7 +25193,7 @@ func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["configName"].(string)) + return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26992,7 +25235,7 @@ func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27009,15 +25252,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteConfig(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createSecret(ctx, field) +func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createRouter(ctx, field) if err != nil { return graphql.Null } @@ -27031,7 +25274,7 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27053,10 +25296,10 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Secret); ok { + if data, ok := tmp.(*entities.Router); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27065,12 +25308,12 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(*entities.Router) fc.Result = res - return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27079,47 +25322,41 @@ func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Secret_accountName(ctx, field) + return ec.fieldContext_Router_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) + return ec.fieldContext_Router_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Secret_createdBy(ctx, field) + return ec.fieldContext_Router_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Secret_creationTime(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) + return ec.fieldContext_Router_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Secret_displayName(ctx, field) + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) case "environmentName": - return ec.fieldContext_Secret_environmentName(ctx, field) + return ec.fieldContext_Router_environmentName(ctx, field) case "id": - return ec.fieldContext_Secret_id(ctx, field) - case "immutable": - return ec.fieldContext_Secret_immutable(ctx, field) - case "isReadyOnly": - return ec.fieldContext_Secret_isReadyOnly(ctx, field) + return ec.fieldContext_Router_id(ctx, field) case "kind": - return ec.fieldContext_Secret_kind(ctx, field) + return ec.fieldContext_Router_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Secret_markedForDeletion(ctx, field) + return ec.fieldContext_Router_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) + return ec.fieldContext_Router_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Secret_recordVersion(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + return ec.fieldContext_Router_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Secret_updateTime(ctx, field) + return ec.fieldContext_Router_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) }, } defer func() { @@ -27129,15 +25366,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateSecret(ctx, field) +func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateRouter(ctx, field) if err != nil { return graphql.Null } @@ -27151,7 +25388,7 @@ func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27173,10 +25410,10 @@ func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Secret); ok { + if data, ok := tmp.(*entities.Router); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27185,12 +25422,12 @@ func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(*entities.Router) fc.Result = res - return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27199,47 +25436,41 @@ func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Secret_accountName(ctx, field) + return ec.fieldContext_Router_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) + return ec.fieldContext_Router_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Secret_createdBy(ctx, field) + return ec.fieldContext_Router_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Secret_creationTime(ctx, field) - case "data": - return ec.fieldContext_Secret_data(ctx, field) + return ec.fieldContext_Router_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Secret_displayName(ctx, field) + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) case "environmentName": - return ec.fieldContext_Secret_environmentName(ctx, field) + return ec.fieldContext_Router_environmentName(ctx, field) case "id": - return ec.fieldContext_Secret_id(ctx, field) - case "immutable": - return ec.fieldContext_Secret_immutable(ctx, field) - case "isReadyOnly": - return ec.fieldContext_Secret_isReadyOnly(ctx, field) + return ec.fieldContext_Router_id(ctx, field) case "kind": - return ec.fieldContext_Secret_kind(ctx, field) + return ec.fieldContext_Router_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Secret_markedForDeletion(ctx, field) + return ec.fieldContext_Router_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) + return ec.fieldContext_Router_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Secret_recordVersion(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + return ec.fieldContext_Router_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Secret_updateTime(ctx, field) + return ec.fieldContext_Router_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) }, } defer func() { @@ -27249,15 +25480,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteSecret(ctx, field) +func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteRouter(ctx, field) if err != nil { return graphql.Null } @@ -27271,7 +25502,7 @@ func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["routerName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27313,7 +25544,7 @@ func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27330,15 +25561,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteSecret(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createRouter(ctx, field) +func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createManagedResource(ctx, field) if err != nil { return graphql.Null } @@ -27352,7 +25583,7 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27374,10 +25605,10 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Router); ok { + if data, ok := tmp.(*entities.ManagedResource); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27386,12 +25617,12 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(*entities.ManagedResource) fc.Result = res - return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27400,43 +25631,43 @@ func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Router_accountName(ctx, field) + return ec.fieldContext_ManagedResource_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Router_createdBy(ctx, field) + return ec.fieldContext_ManagedResource_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Router_creationTime(ctx, field) + return ec.fieldContext_ManagedResource_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Router_displayName(ctx, field) + return ec.fieldContext_ManagedResource_displayName(ctx, field) case "enabled": - return ec.fieldContext_Router_enabled(ctx, field) + return ec.fieldContext_ManagedResource_enabled(ctx, field) case "environmentName": - return ec.fieldContext_Router_environmentName(ctx, field) + return ec.fieldContext_ManagedResource_environmentName(ctx, field) case "id": - return ec.fieldContext_Router_id(ctx, field) + return ec.fieldContext_ManagedResource_id(ctx, field) case "kind": - return ec.fieldContext_Router_kind(ctx, field) + return ec.fieldContext_ManagedResource_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Router_markedForDeletion(ctx, field) + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Router_projectName(ctx, field) + return ec.fieldContext_ManagedResource_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Router_recordVersion(ctx, field) + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) case "spec": - return ec.fieldContext_Router_spec(ctx, field) + return ec.fieldContext_ManagedResource_spec(ctx, field) case "status": - return ec.fieldContext_Router_status(ctx, field) + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncedOutputSecretRef": + return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Router_updateTime(ctx, field) + return ec.fieldContext_ManagedResource_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) }, } defer func() { @@ -27446,15 +25677,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateRouter(ctx, field) +func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateManagedResource(ctx, field) if err != nil { return graphql.Null } @@ -27468,7 +25699,7 @@ func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27490,10 +25721,10 @@ func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Router); ok { + if data, ok := tmp.(*entities.ManagedResource); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27502,12 +25733,12 @@ func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(*entities.ManagedResource) fc.Result = res - return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27516,43 +25747,43 @@ func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context. Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Router_accountName(ctx, field) + return ec.fieldContext_ManagedResource_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Router_createdBy(ctx, field) + return ec.fieldContext_ManagedResource_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Router_creationTime(ctx, field) + return ec.fieldContext_ManagedResource_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Router_displayName(ctx, field) + return ec.fieldContext_ManagedResource_displayName(ctx, field) case "enabled": - return ec.fieldContext_Router_enabled(ctx, field) + return ec.fieldContext_ManagedResource_enabled(ctx, field) case "environmentName": - return ec.fieldContext_Router_environmentName(ctx, field) + return ec.fieldContext_ManagedResource_environmentName(ctx, field) case "id": - return ec.fieldContext_Router_id(ctx, field) + return ec.fieldContext_ManagedResource_id(ctx, field) case "kind": - return ec.fieldContext_Router_kind(ctx, field) + return ec.fieldContext_ManagedResource_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Router_markedForDeletion(ctx, field) + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Router_projectName(ctx, field) + return ec.fieldContext_ManagedResource_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Router_recordVersion(ctx, field) + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) case "spec": - return ec.fieldContext_Router_spec(ctx, field) + return ec.fieldContext_ManagedResource_spec(ctx, field) case "status": - return ec.fieldContext_Router_status(ctx, field) + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncedOutputSecretRef": + return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Router_updateTime(ctx, field) + return ec.fieldContext_ManagedResource_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) }, } defer func() { @@ -27562,15 +25793,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteRouter(ctx, field) +func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteManagedResource(ctx, field) if err != nil { return graphql.Null } @@ -27584,7 +25815,7 @@ func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["routerName"].(string)) + return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mresName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27626,7 +25857,7 @@ func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27643,15 +25874,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteRouter(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createManagedResource(ctx, field) +func (ec *executionContext) _Mutation_core_createVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_createVPNDevice(ctx, field) if err != nil { return graphql.Null } @@ -27665,7 +25896,7 @@ func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + return ec.resolvers.Mutation().CoreCreateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27687,10 +25918,10 @@ func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Con if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ManagedResource); ok { + if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27699,12 +25930,12 @@ func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Con if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ManagedResource) + res := resTmp.(*entities.ConsoleVPNDevice) fc.Result = res - return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) + return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_createVPNDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27713,45 +25944,47 @@ func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ManagedResource_accountName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_ManagedResource_createdBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ManagedResource_creationTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ManagedResource_displayName(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) case "environmentName": - return ec.fieldContext_ManagedResource_environmentName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) case "id": - return ec.fieldContext_ManagedResource_id(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) case "markedForDeletion": - return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) case "projectName": - return ec.fieldContext_ManagedResource_projectName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": - return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "syncedOutputSecretRef": - return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ManagedResource_updateTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) }, } defer func() { @@ -27761,15 +25994,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_createVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateManagedResource(ctx, field) +func (ec *executionContext) _Mutation_core_updateVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDevice(ctx, field) if err != nil { return graphql.Null } @@ -27783,7 +26016,7 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + return ec.resolvers.Mutation().CoreUpdateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27805,10 +26038,10 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ManagedResource); ok { + if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -27817,12 +26050,12 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ManagedResource) + res := resTmp.(*entities.ConsoleVPNDevice) fc.Result = res - return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) + return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27831,45 +26064,47 @@ func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ManagedResource_accountName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_ManagedResource_createdBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ManagedResource_creationTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ManagedResource_displayName(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) case "environmentName": - return ec.fieldContext_ManagedResource_environmentName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) case "id": - return ec.fieldContext_ManagedResource_id(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) case "markedForDeletion": - return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) case "projectName": - return ec.fieldContext_ManagedResource_projectName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": - return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "syncedOutputSecretRef": - return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ManagedResource_updateTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) + case "wireguardConfig": + return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) }, } defer func() { @@ -27879,15 +26114,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteManagedResource(ctx, field) +func (ec *executionContext) _Mutation_core_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDevicePorts(ctx, field) if err != nil { return graphql.Null } @@ -27901,7 +26136,7 @@ func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mresName"].(string)) + return ec.resolvers.Mutation().CoreUpdateVPNDevicePorts(rctx, fc.Args["deviceName"].(string), fc.Args["ports"].([]*v11.Port)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27943,7 +26178,7 @@ func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Con return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -27960,15 +26195,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteManagedResource(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateVPNDevicePorts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createProjectManagedService(ctx, field) +func (ec *executionContext) _Mutation_core_updateVPNDeviceEnv(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVPNDeviceEnv(ctx, field) if err != nil { return graphql.Null } @@ -27982,7 +26217,7 @@ func (ec *executionContext) _Mutation_core_createProjectManagedService(ctx conte resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvc"].(entities.ProjectManagedService)) + return ec.resolvers.Mutation().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["projectName"].(string), fc.Args["envName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28004,65 +26239,34 @@ func (ec *executionContext) _Mutation_core_createProjectManagedService(ctx conte if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ProjectManagedService); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.ProjectManagedService) + res := resTmp.(bool) fc.Result = res - return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateVPNDeviceEnv(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) { - switch field.Name { - case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) - case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) - case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -28072,15 +26276,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createProjectManagedServi } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateVPNDeviceEnv_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateProjectManagedService(ctx, field) +func (ec *executionContext) _Mutation_core_updateVpnDeviceNs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVpnDeviceNs(ctx, field) if err != nil { return graphql.Null } @@ -28094,7 +26298,7 @@ func (ec *executionContext) _Mutation_core_updateProjectManagedService(ctx conte resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvc"].(entities.ProjectManagedService)) + return ec.resolvers.Mutation().CoreUpdateVpnDeviceNs(rctx, fc.Args["deviceName"].(string), fc.Args["ns"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28116,65 +26320,34 @@ func (ec *executionContext) _Mutation_core_updateProjectManagedService(ctx conte if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ProjectManagedService); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.ProjectManagedService) + res := resTmp.(bool) fc.Result = res - return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateVpnDeviceNs(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) { - switch field.Name { - case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) - case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) - case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -28184,15 +26357,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateProjectManagedServi } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateVpnDeviceNs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_deleteProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteProjectManagedService(ctx, field) +func (ec *executionContext) _Mutation_core_updateVpnClusterName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_updateVpnClusterName(ctx, field) if err != nil { return graphql.Null } @@ -28206,7 +26379,7 @@ func (ec *executionContext) _Mutation_core_deleteProjectManagedService(ctx conte resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["pmsvcName"].(string)) + return ec.resolvers.Mutation().CoreUpdateVpnClusterName(rctx, fc.Args["deviceName"].(string), fc.Args["clusterName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28248,7 +26421,7 @@ func (ec *executionContext) _Mutation_core_deleteProjectManagedService(ctx conte return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_deleteProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_updateVpnClusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -28265,15 +26438,15 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteProjectManagedServi } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_deleteProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_updateVpnClusterName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_createVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_createVPNDevice(ctx, field) +func (ec *executionContext) _Mutation_core_deleteVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteVPNDevice(ctx, field) if err != nil { return graphql.Null } @@ -28287,7 +26460,7 @@ func (ec *executionContext) _Mutation_core_createVPNDevice(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) + return ec.resolvers.Mutation().CoreDeleteVPNDevice(rctx, fc.Args["deviceName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28309,73 +26482,34 @@ func (ec *executionContext) _Mutation_core_createVPNDevice(ctx context.Context, if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.ConsoleVPNDevice) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_createVPNDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_core_deleteVPNDevice(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) { - switch field.Name { - case "accountName": - return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) - case "clusterName": - return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) - case "createdBy": - return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) - case "id": - return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) - case "kind": - return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) - case "linkedClusters": - return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) - case "status": - return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) - case "wireguardConfig": - return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -28385,15 +26519,15 @@ func (ec *executionContext) fieldContext_Mutation_core_createVPNDevice(ctx conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_createVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_core_deleteVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_core_updateVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVPNDevice(ctx, field) +func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_endCursor(ctx, field) if err != nil { return graphql.Null } @@ -28405,34 +26539,8 @@ func (ec *executionContext) _Mutation_core_updateVPNDevice(ctx context.Context, } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.ConsoleVPNDevice); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ConsoleVPNDevice`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.EndCursor, nil }) if err != nil { ec.Error(ctx, err) @@ -28441,79 +26549,26 @@ func (ec *executionContext) _Mutation_core_updateVPNDevice(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ConsoleVPNDevice) + res := resTmp.(*string) fc.Result = res - return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) - case "clusterName": - return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) - case "createdBy": - return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) - case "id": - return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) - case "kind": - return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) - case "linkedClusters": - return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) - case "status": - return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ConsoleVPNDevice_updateTime(ctx, field) - case "wireguardConfig": - return ec.fieldContext_ConsoleVPNDevice_wireguardConfig(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) + 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_core_updateVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVPNDevicePorts(ctx, field) +func (ec *executionContext) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasNextPage(ctx, field) if err != nil { return graphql.Null } @@ -28525,76 +26580,36 @@ func (ec *executionContext) _Mutation_core_updateVPNDevicePorts(ctx context.Cont } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVPNDevicePorts(rctx, fc.Args["deviceName"].(string), fc.Args["ports"].([]*v11.Port)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.HasNextPage, 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) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, } - 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_core_updateVPNDevicePorts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateVPNDeviceEnv(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVPNDeviceEnv(ctx, field) +func (ec *executionContext) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) if err != nil { return graphql.Null } @@ -28606,442 +26621,36 @@ func (ec *executionContext) _Mutation_core_updateVPNDeviceEnv(ctx context.Contex } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["projectName"].(string), fc.Args["envName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.HasPreviousPage, 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) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_core_updateVPNDeviceEnv(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "PageInfo", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, } - 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_core_updateVPNDeviceEnv_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_core_updateVpnDeviceNs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVpnDeviceNs(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVpnDeviceNs(rctx, fc.Args["deviceName"].(string), fc.Args["ns"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - 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_Mutation_core_updateVpnDeviceNs(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 Boolean 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_core_updateVpnDeviceNs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_core_updateVpnClusterName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVpnClusterName(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVpnClusterName(rctx, fc.Args["deviceName"].(string), fc.Args["clusterName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - 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_Mutation_core_updateVpnClusterName(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 Boolean 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_core_updateVpnClusterName_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Mutation_core_deleteVPNDevice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_deleteVPNDevice(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteVPNDevice(rctx, fc.Args["deviceName"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - 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_Mutation_core_deleteVPNDevice(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 Boolean 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_core_deleteVPNDevice_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _PageInfo_endCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_endCursor(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.EndCursor, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_PageInfo_endCursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "PageInfo", - 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) _PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasNextPage(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.HasNextPage, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_PageInfo_hasNextPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "PageInfo", - 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) _PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_hasPreviousPage(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.HasPreviousPage, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_PageInfo_hasPreviousPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "PageInfo", - 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) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) +func (ec *executionContext) _PageInfo_startCursor(ctx context.Context, field graphql.CollectedField, obj *model.PageInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PageInfo_startCursor(ctx, field) if err != nil { return graphql.Null } @@ -29082,2222 +26691,7 @@ func (ec *executionContext) fieldContext_PageInfo_startCursor(ctx context.Contex } func (ec *executionContext) _Port_port(ctx context.Context, field graphql.CollectedField, obj *model.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Port_port(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.Port, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Port_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Port", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Port_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.Port) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Port_targetPort(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.TargetPort, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Port_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Port", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_accountName(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.AccountName, 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_Project_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_apiVersion(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.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_clusterName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_clusterName(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.ClusterName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_createdBy(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.CreatedBy, 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.(common.CreatedOrUpdatedBy) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "userEmail": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) - case "userId": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) - case "userName": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_creationTime(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.Project().CreationTime(rctx, obj) - }) - 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.marshalNDate2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_displayName(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.DisplayName, 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_Project_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_id(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_id(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.Id, 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.(repos.ID) - fc.Result = res - return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_kind(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.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_lastUpdatedBy(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.LastUpdatedBy, 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.(common.CreatedOrUpdatedBy) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "userEmail": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) - case "userId": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) - case "userName": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_markedForDeletion(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.MarkedForDeletion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - 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) _Project_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_metadata(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.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(v13.ObjectMeta) - fc.Result = res - return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "name": - return ec.fieldContext_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_recordVersion(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.RecordVersion, 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.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_spec(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.Project().Spec(rctx, obj) - }) - 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.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "targetNamespace": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_status(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_status(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.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "checkList": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field) - case "checks": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) - case "isReady": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) - case "lastReadyGeneration": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) - case "lastReconcileTime": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) - case "message": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) - case "resources": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_syncStatus(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.SyncStatus, 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.(types.SyncStatus) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "action": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) - case "error": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) - case "recordVersion": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) - case "state": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) - case "syncScheduledAt": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Project_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_updateTime(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.Project().UpdateTime(rctx, obj) - }) - 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.marshalNDate2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Project_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Project", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ProjectEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectEdge_cursor(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.Cursor, 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_ProjectEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectEdge", - 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) _ProjectEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ProjectEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectEdge_node(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.Node, 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.(*entities.Project) - fc.Result = res - return ec.marshalNProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_Project_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "clusterName": - return ec.fieldContext_Project_clusterName(ctx, field) - case "createdBy": - return ec.fieldContext_Project_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Project_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_Project_displayName(ctx, field) - case "id": - return ec.fieldContext_Project_id(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Project_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_Project_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "recordVersion": - return ec.fieldContext_Project_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Project_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_accountName(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.AccountName, 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_ProjectManagedService_accountName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_apiVersion(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.APIVersion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_createdBy(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.CreatedBy, 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.(common.CreatedOrUpdatedBy) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "userEmail": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) - case "userId": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) - case "userName": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_creationTime(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.ProjectManagedService().CreationTime(rctx, obj) - }) - 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.marshalNDate2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_creationTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_displayName(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.DisplayName, 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_ProjectManagedService_displayName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_id(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_id(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.Id, 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.(repos.ID) - fc.Result = res - return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_kind(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_kind(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.Kind, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_lastUpdatedBy(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.LastUpdatedBy, 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.(common.CreatedOrUpdatedBy) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_lastUpdatedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "userEmail": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userEmail(ctx, field) - case "userId": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userId(ctx, field) - case "userName": - return ec.fieldContext_Github__com___kloudlite___api___common__CreatedOrUpdatedBy_userName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___common__CreatedOrUpdatedBy", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_markedForDeletion(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.MarkedForDeletion, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_markedForDeletion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_metadata(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.ObjectMeta, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(v13.ObjectMeta) - fc.Result = res - return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_metadata(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "annotations": - return ec.fieldContext_Metadata_annotations(ctx, field) - case "creationTimestamp": - return ec.fieldContext_Metadata_creationTimestamp(ctx, field) - case "deletionTimestamp": - return ec.fieldContext_Metadata_deletionTimestamp(ctx, field) - case "generation": - return ec.fieldContext_Metadata_generation(ctx, field) - case "labels": - return ec.fieldContext_Metadata_labels(ctx, field) - case "name": - return ec.fieldContext_Metadata_name(ctx, field) - case "namespace": - return ec.fieldContext_Metadata_namespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_projectName(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.ProjectName, 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_ProjectManagedService_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - 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) _ProjectManagedService_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_recordVersion(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.RecordVersion, 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.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_recordVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_spec(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_spec(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.ProjectManagedService().Spec(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) - fc.Result = res - return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_spec(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "msvcSpec": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx, field) - case "targetNamespace": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_status(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_status(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.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(operator.Status) - fc.Result = res - return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "checkList": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field) - case "checks": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) - case "isReady": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field) - case "lastReadyGeneration": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field) - case "lastReconcileTime": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field) - case "message": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field) - case "resources": - return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_syncStatus(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.SyncStatus, 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.(types.SyncStatus) - fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_syncStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "action": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_action(ctx, field) - case "error": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_error(ctx, field) - case "lastSyncedAt": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_lastSyncedAt(ctx, field) - case "recordVersion": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_recordVersion(ctx, field) - case "state": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_state(ctx, field) - case "syncScheduledAt": - return ec.fieldContext_Github__com___kloudlite___api___pkg___types__SyncStatus_syncScheduledAt(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedService_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.ProjectManagedService) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedService_updateTime(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.ProjectManagedService().UpdateTime(rctx, obj) - }) - 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.marshalNDate2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedService_updateTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedService", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServiceEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedServiceEdge_cursor(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.Cursor, 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_ProjectManagedServiceEdge_cursor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedServiceEdge", - 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) _ProjectManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServiceEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedServiceEdge_node(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.Node, 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.(*entities.ProjectManagedService) - fc.Result = res - return ec.marshalNProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedServiceEdge_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedServiceEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) - case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) - case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_edges(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.Edges, 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.ProjectManagedServiceEdge) - fc.Result = res - return ec.marshalNProjectManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdgeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedServicePaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cursor": - return ec.fieldContext_ProjectManagedServiceEdge_cursor(ctx, field) - case "node": - return ec.fieldContext_ProjectManagedServiceEdge_node(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedServiceEdge", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(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.PageInfo, 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.PageInfo) - fc.Result = res - return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedServicePaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectManagedServicePaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectManagedServicePaginatedRecords_totalCount(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.TotalCount, 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.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectManagedServicePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectManagedServicePaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectPaginatedRecords_edges(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.Edges, 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.ProjectEdge) - fc.Result = res - return ec.marshalNProjectEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdgeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectPaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "cursor": - return ec.fieldContext_ProjectEdge_cursor(ctx, field) - case "node": - return ec.fieldContext_ProjectEdge_node(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectEdge", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectPaginatedRecords_pageInfo(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.PageInfo, 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.PageInfo) - fc.Result = res - return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectPaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "endCursor": - return ec.fieldContext_PageInfo_endCursor(ctx, field) - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "startCursor": - return ec.fieldContext_PageInfo_startCursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ProjectPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ProjectPaginatedRecords_totalCount(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.TotalCount, 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.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ProjectPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ProjectPaginatedRecords", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_checkNameAvailability(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["projectName"].(*string), fc.Args["envName"].(*string), fc.Args["resType"].(entities.ResourceType), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedIn == nil { - return nil, errors.New("directive isLoggedIn is not implemented") - } - return ec.directives.IsLoggedIn(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/domain.CheckNameAvailabilityOutput`, tmp) - }) - 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.(*domain.CheckNameAvailabilityOutput) - fc.Result = res - return ec.marshalNConsoleCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "result": - return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) - case "suggestedNames": - return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConsoleCheckNameAvailabilityOutput", 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_Query_core_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listProjects(ctx, field) + fc, err := ec.fieldContext_Port_port(ctx, field) if err != nil { return graphql.Null } @@ -31309,34 +26703,8 @@ func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListProjects(rctx, fc.Args["search"].(*model.SearchProjects), fc.Args["pq"].(*repos.CursorPagination)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.ProjectPaginatedRecords); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ProjectPaginatedRecords`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.Port, nil }) if err != nil { ec.Error(ctx, err) @@ -31345,45 +26713,26 @@ func (ec *executionContext) _Query_core_listProjects(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ProjectPaginatedRecords) + res := resTmp.(*int) fc.Result = res - return ec.marshalOProjectPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listProjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Port_port(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Port", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_ProjectPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ProjectPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ProjectPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ProjectPaginatedRecords", field.Name) + return nil, errors.New("field of type Int 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_Query_core_listProjects_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_core_getProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getProject(ctx, field) +func (ec *executionContext) _Port_targetPort(ctx context.Context, field graphql.CollectedField, obj *model.Port) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Port_targetPort(ctx, field) if err != nil { return graphql.Null } @@ -31395,34 +26744,8 @@ func (ec *executionContext) _Query_core_getProject(ctx context.Context, field gr } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetProject(rctx, fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.Project); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Project`, tmp) + ctx = rctx // use context from middleware stack in children + return obj.TargetPort, nil }) if err != nil { ec.Error(ctx, err) @@ -31431,71 +26754,26 @@ func (ec *executionContext) _Query_core_getProject(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Project) + res := resTmp.(*int) fc.Result = res - return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Port_targetPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "Port", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_Project_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Project_apiVersion(ctx, field) - case "clusterName": - return ec.fieldContext_Project_clusterName(ctx, field) - case "createdBy": - return ec.fieldContext_Project_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Project_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_Project_displayName(ctx, field) - case "id": - return ec.fieldContext_Project_id(ctx, field) - case "kind": - return ec.fieldContext_Project_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Project_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_Project_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_Project_metadata(ctx, field) - case "recordVersion": - return ec.fieldContext_Project_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_Project_spec(ctx, field) - case "status": - return ec.fieldContext_Project_status(ctx, field) - case "syncStatus": - return ec.fieldContext_Project_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Project_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Project", field.Name) + return nil, errors.New("field of type Int 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_Query_core_getProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncProject(ctx, field) +func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_checkNameAvailability(ctx, field) if err != nil { return graphql.Null } @@ -31509,13 +26787,13 @@ func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncProject(rctx, fc.Args["name"].(string)) + return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["projectName"].(*string), fc.Args["envName"].(*string), fc.Args["resType"].(entities.ResourceType), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") + if ec.directives.IsLoggedIn == nil { + return nil, errors.New("directive isLoggedIn is not implemented") } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + return ec.directives.IsLoggedIn(ctx, nil, directive0) } directive2 := func(ctx context.Context) (interface{}, error) { if ec.directives.HasAccount == nil { @@ -31531,10 +26809,10 @@ func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*domain.CheckNameAvailabilityOutput); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/domain.CheckNameAvailabilityOutput`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -31546,19 +26824,25 @@ func (ec *executionContext) _Query_core_resyncProject(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*domain.CheckNameAvailabilityOutput) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNConsoleCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncProject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_checkNameAvailability(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "result": + return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_result(ctx, field) + case "suggestedNames": + return ec.fieldContext_ConsoleCheckNameAvailabilityOutput_suggestedNames(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ConsoleCheckNameAvailabilityOutput", field.Name) }, } defer func() { @@ -31568,7 +26852,7 @@ func (ec *executionContext) fieldContext_Query_core_resyncProject(ctx context.Co } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_checkNameAvailability_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -31727,6 +27011,8 @@ func (ec *executionContext) fieldContext_Query_core_getEnvironment(ctx context.C return ec.fieldContext_Environment_accountName(ctx, field) case "apiVersion": return ec.fieldContext_Environment_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_Environment_clusterName(ctx, field) case "createdBy": return ec.fieldContext_Environment_createdBy(ctx, field) case "creationTime": @@ -31743,8 +27029,6 @@ func (ec *executionContext) fieldContext_Query_core_getEnvironment(ctx context.C return ec.fieldContext_Environment_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Environment_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Environment_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Environment_recordVersion(ctx, field) case "spec": @@ -31810,403 +27094,34 @@ func (ec *executionContext) _Query_core_resyncEnvironment(ctx context.Context, f if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - 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_Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean 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_Query_core_resyncEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listImagePullSecrets(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListImagePullSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchImagePullSecrets), fc.Args["pq"].(*repos.CursorPagination)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.ImagePullSecretPaginatedRecords); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ImagePullSecretPaginatedRecords`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.ImagePullSecretPaginatedRecords) - fc.Result = res - return ec.marshalOImagePullSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretPaginatedRecords(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_ImagePullSecretPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ImagePullSecretPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ImagePullSecretPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ImagePullSecretPaginatedRecords", 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_Query_core_listImagePullSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_getImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getImagePullSecret(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.ImagePullSecret); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.ImagePullSecret) - fc.Result = res - return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_getImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_ImagePullSecret_accountName(ctx, field) - case "createdBy": - return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ImagePullSecret_displayName(ctx, field) - case "dockerConfigJson": - return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) - case "environmentName": - return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) - case "format": - return ec.fieldContext_ImagePullSecret_format(ctx, field) - case "id": - return ec.fieldContext_ImagePullSecret_id(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ImagePullSecret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ImagePullSecret_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) - case "registryPassword": - return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) - case "registryURL": - return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) - case "registryUsername": - return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) - case "syncStatus": - return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", 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_Query_core_getImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncImagePullSecret(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - 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_Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean 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_Query_core_resyncImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listApps(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) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListApps(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.AppPaginatedRecords); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.AppPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.AppPaginatedRecords) + res := resTmp.(bool) fc.Result = res - return ec.marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_AppPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppPaginatedRecords", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -32216,15 +27131,15 @@ func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getApp(ctx, field) +func (ec *executionContext) _Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listImagePullSecrets(ctx, field) if err != nil { return graphql.Null } @@ -32238,7 +27153,7 @@ func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphq resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreListImagePullSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchImagePullSecrets), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32260,10 +27175,10 @@ func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphq if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.App); ok { + if data, ok := tmp.(*model.ImagePullSecretPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ImagePullSecretPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32272,12 +27187,12 @@ func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphq if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.App) + res := resTmp.(*model.ImagePullSecretPaginatedRecords) fc.Result = res - return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalOImagePullSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐImagePullSecretPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listImagePullSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32285,48 +27200,14 @@ func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "accountName": - return ec.fieldContext_App_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "ciBuildId": - return ec.fieldContext_App_ciBuildId(ctx, field) - case "createdBy": - return ec.fieldContext_App_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_App_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_App_displayName(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_App_environmentName(ctx, field) - case "id": - return ec.fieldContext_App_id(ctx, field) - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_App_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_App_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "projectName": - return ec.fieldContext_App_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_App_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_App_updateTime(ctx, field) - case "build": - return ec.fieldContext_App_build(ctx, field) + case "edges": + return ec.fieldContext_ImagePullSecretPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ImagePullSecretPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ImagePullSecretPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecretPaginatedRecords", field.Name) }, } defer func() { @@ -32336,15 +27217,15 @@ func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listImagePullSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) +func (ec *executionContext) _Query_core_getImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getImagePullSecret(ctx, field) if err != nil { return graphql.Null } @@ -32358,7 +27239,7 @@ func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32380,34 +27261,67 @@ func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*entities.ImagePullSecret); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret`, tmp) }) 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) + res := resTmp.(*entities.ImagePullSecret) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOImagePullSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_ImagePullSecret_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_ImagePullSecret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ImagePullSecret_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ImagePullSecret_displayName(ctx, field) + case "dockerConfigJson": + return ec.fieldContext_ImagePullSecret_dockerConfigJson(ctx, field) + case "environmentName": + return ec.fieldContext_ImagePullSecret_environmentName(ctx, field) + case "format": + return ec.fieldContext_ImagePullSecret_format(ctx, field) + case "id": + return ec.fieldContext_ImagePullSecret_id(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ImagePullSecret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ImagePullSecret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ImagePullSecret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ImagePullSecret_recordVersion(ctx, field) + case "registryPassword": + return ec.fieldContext_ImagePullSecret_registryPassword(ctx, field) + case "registryURL": + return ec.fieldContext_ImagePullSecret_registryURL(ctx, field) + case "registryUsername": + return ec.fieldContext_ImagePullSecret_registryUsername(ctx, field) + case "syncStatus": + return ec.fieldContext_ImagePullSecret_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ImagePullSecret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ImagePullSecret", field.Name) }, } defer func() { @@ -32417,15 +27331,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_restartApp(ctx, field) +func (ec *executionContext) _Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncImagePullSecret(ctx, field) if err != nil { return graphql.Null } @@ -32439,7 +27353,7 @@ func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field gr resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + return ec.resolvers.Query().CoreResyncImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32481,7 +27395,7 @@ func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field gr return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncImagePullSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32498,15 +27412,15 @@ func (ec *executionContext) fieldContext_Query_core_restartApp(ctx context.Conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_restartApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncImagePullSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getConfigValues(ctx, field) +func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listApps(ctx, field) if err != nil { return graphql.Null } @@ -32520,7 +27434,7 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) + return ec.resolvers.Query().CoreListApps(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32542,10 +27456,10 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.([]*domain.ConfigKeyValueRef); ok { + if data, ok := tmp.(*model.AppPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.AppPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32554,12 +27468,12 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.([]*domain.ConfigKeyValueRef) + res := resTmp.(*model.AppPaginatedRecords) fc.Result = res - return ec.marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx, field.Selections, res) + return ec.marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32567,14 +27481,14 @@ func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context. IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "configName": - return ec.fieldContext_ConfigKeyValueRef_configName(ctx, field) - case "key": - return ec.fieldContext_ConfigKeyValueRef_key(ctx, field) - case "value": - return ec.fieldContext_ConfigKeyValueRef_value(ctx, field) + case "edges": + return ec.fieldContext_AppPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ConfigKeyValueRef", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AppPaginatedRecords", field.Name) }, } defer func() { @@ -32584,15 +27498,15 @@ func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getConfigValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listConfigs(ctx, field) +func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getApp(ctx, field) if err != nil { return graphql.Null } @@ -32606,7 +27520,7 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32628,10 +27542,10 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.ConfigPaginatedRecords); ok { + if data, ok := tmp.(*entities.App); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ConfigPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32640,12 +27554,12 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ConfigPaginatedRecords) + res := resTmp.(*entities.App) fc.Result = res - return ec.marshalOConfigPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32653,14 +27567,46 @@ func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Cont IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_ConfigPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) + case "accountName": + return ec.fieldContext_App_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_App_apiVersion(ctx, field) + case "ciBuildId": + return ec.fieldContext_App_ciBuildId(ctx, field) + case "createdBy": + return ec.fieldContext_App_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_App_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_App_environmentName(ctx, field) + case "id": + return ec.fieldContext_App_id(ctx, field) + case "kind": + return ec.fieldContext_App_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_App_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_App_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_App_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_App_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_App_spec(ctx, field) + case "status": + return ec.fieldContext_App_status(ctx, field) + case "syncStatus": + return ec.fieldContext_App_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_App_updateTime(ctx, field) + case "build": + return ec.fieldContext_App_build(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ConfigPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) }, } defer func() { @@ -32670,15 +27616,15 @@ func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getConfig(ctx, field) +func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) if err != nil { return graphql.Null } @@ -32692,7 +27638,7 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32714,69 +27660,34 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Config); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.Config) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_Config_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "binaryData": - return ec.fieldContext_Config_binaryData(ctx, field) - case "createdBy": - return ec.fieldContext_Config_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Config_creationTime(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) - case "displayName": - return ec.fieldContext_Config_displayName(ctx, field) - case "environmentName": - return ec.fieldContext_Config_environmentName(ctx, field) - case "id": - return ec.fieldContext_Config_id(ctx, field) - case "immutable": - return ec.fieldContext_Config_immutable(ctx, field) - case "kind": - return ec.fieldContext_Config_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Config_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_Config_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Config_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_Config_recordVersion(ctx, field) - case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Config_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -32786,15 +27697,15 @@ func (ec *executionContext) fieldContext_Query_core_getConfig(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncConfig(ctx, field) +func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_restartApp(ctx, field) if err != nil { return graphql.Null } @@ -32808,7 +27719,7 @@ func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32850,7 +27761,7 @@ func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32867,15 +27778,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncConfig(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_restartApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getSecretValues(ctx, field) +func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getConfigValues(ctx, field) if err != nil { return graphql.Null } @@ -32889,7 +27800,7 @@ func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetSecretValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) + return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32911,10 +27822,10 @@ func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.([]*domain.SecretKeyValueRef); ok { + if data, ok := tmp.([]*domain.ConfigKeyValueRef); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.SecretKeyValueRef`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32923,12 +27834,12 @@ func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.([]*domain.SecretKeyValueRef) + res := resTmp.([]*domain.ConfigKeyValueRef) fc.Result = res - return ec.marshalOSecretKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRefᚄ(ctx, field.Selections, res) + return ec.marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getSecretValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32936,14 +27847,14 @@ func (ec *executionContext) fieldContext_Query_core_getSecretValues(ctx context. IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "configName": + return ec.fieldContext_ConfigKeyValueRef_configName(ctx, field) case "key": - return ec.fieldContext_SecretKeyValueRef_key(ctx, field) - case "secretName": - return ec.fieldContext_SecretKeyValueRef_secretName(ctx, field) + return ec.fieldContext_ConfigKeyValueRef_key(ctx, field) case "value": - return ec.fieldContext_SecretKeyValueRef_value(ctx, field) + return ec.fieldContext_ConfigKeyValueRef_value(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SecretKeyValueRef", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConfigKeyValueRef", field.Name) }, } defer func() { @@ -32953,15 +27864,15 @@ func (ec *executionContext) fieldContext_Query_core_getSecretValues(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getSecretValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getConfigValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listSecrets(ctx, field) +func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listConfigs(ctx, field) if err != nil { return graphql.Null } @@ -32975,7 +27886,7 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchSecrets), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32997,10 +27908,10 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.SecretPaginatedRecords); ok { + if data, ok := tmp.(*model.ConfigPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.SecretPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ConfigPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33009,12 +27920,12 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.(*model.SecretPaginatedRecords) + res := resTmp.(*model.ConfigPaginatedRecords) fc.Result = res - return ec.marshalOSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOConfigPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33023,13 +27934,13 @@ func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Cont Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_SecretPaginatedRecords_edges(ctx, field) + return ec.fieldContext_ConfigPaginatedRecords_edges(ctx, field) case "pageInfo": - return ec.fieldContext_SecretPaginatedRecords_pageInfo(ctx, field) + return ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_SecretPaginatedRecords_totalCount(ctx, field) + return ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SecretPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConfigPaginatedRecords", field.Name) }, } defer func() { @@ -33039,15 +27950,15 @@ func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getSecret(ctx, field) +func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getConfig(ctx, field) if err != nil { return graphql.Null } @@ -33061,7 +27972,7 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33083,10 +27994,10 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Secret); ok { + if data, ok := tmp.(*entities.Config); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33095,12 +28006,12 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Secret) + res := resTmp.(*entities.Config) fc.Result = res - return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) + return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33109,47 +28020,41 @@ func (ec *executionContext) fieldContext_Query_core_getSecret(ctx context.Contex Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Secret_accountName(ctx, field) + return ec.fieldContext_Config_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Secret_apiVersion(ctx, field) + return ec.fieldContext_Config_apiVersion(ctx, field) + case "binaryData": + return ec.fieldContext_Config_binaryData(ctx, field) case "createdBy": - return ec.fieldContext_Secret_createdBy(ctx, field) + return ec.fieldContext_Config_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Secret_creationTime(ctx, field) + return ec.fieldContext_Config_creationTime(ctx, field) case "data": - return ec.fieldContext_Secret_data(ctx, field) + return ec.fieldContext_Config_data(ctx, field) case "displayName": - return ec.fieldContext_Secret_displayName(ctx, field) + return ec.fieldContext_Config_displayName(ctx, field) case "environmentName": - return ec.fieldContext_Secret_environmentName(ctx, field) + return ec.fieldContext_Config_environmentName(ctx, field) case "id": - return ec.fieldContext_Secret_id(ctx, field) + return ec.fieldContext_Config_id(ctx, field) case "immutable": - return ec.fieldContext_Secret_immutable(ctx, field) - case "isReadyOnly": - return ec.fieldContext_Secret_isReadyOnly(ctx, field) + return ec.fieldContext_Config_immutable(ctx, field) case "kind": - return ec.fieldContext_Secret_kind(ctx, field) + return ec.fieldContext_Config_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + return ec.fieldContext_Config_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Secret_markedForDeletion(ctx, field) + return ec.fieldContext_Config_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) + return ec.fieldContext_Config_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Secret_recordVersion(ctx, field) - case "stringData": - return ec.fieldContext_Secret_stringData(ctx, field) + return ec.fieldContext_Config_recordVersion(ctx, field) case "syncStatus": - return ec.fieldContext_Secret_syncStatus(ctx, field) - case "type": - return ec.fieldContext_Secret_type(ctx, field) + return ec.fieldContext_Config_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Secret_updateTime(ctx, field) + return ec.fieldContext_Config_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) }, } defer func() { @@ -33159,15 +28064,15 @@ func (ec *executionContext) fieldContext_Query_core_getSecret(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncSecret(ctx, field) +func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncConfig(ctx, field) if err != nil { return graphql.Null } @@ -33181,7 +28086,7 @@ func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33223,7 +28128,7 @@ func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncConfig(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33240,15 +28145,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncSecret(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncConfig_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listRouters(ctx, field) +func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getSecretValues(ctx, field) if err != nil { return graphql.Null } @@ -33262,7 +28167,7 @@ func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchRouters), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreGetSecretValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33284,10 +28189,10 @@ func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field g if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.RouterPaginatedRecords); ok { + if data, ok := tmp.([]*domain.SecretKeyValueRef); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.RouterPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.SecretKeyValueRef`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33296,12 +28201,12 @@ func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.(*model.RouterPaginatedRecords) + res := resTmp.([]*domain.SecretKeyValueRef) fc.Result = res - return ec.marshalORouterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOSecretKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyValueRefᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getSecretValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33309,14 +28214,14 @@ func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Cont IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_RouterPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_RouterPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_RouterPaginatedRecords_totalCount(ctx, field) + case "key": + return ec.fieldContext_SecretKeyValueRef_key(ctx, field) + case "secretName": + return ec.fieldContext_SecretKeyValueRef_secretName(ctx, field) + case "value": + return ec.fieldContext_SecretKeyValueRef_value(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RouterPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type SecretKeyValueRef", field.Name) }, } defer func() { @@ -33326,15 +28231,15 @@ func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listRouters_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getSecretValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getRouter(ctx, field) +func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listSecrets(ctx, field) if err != nil { return graphql.Null } @@ -33348,7 +28253,7 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchSecrets), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33370,10 +28275,10 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.Router); ok { + if data, ok := tmp.(*model.SecretPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.SecretPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33382,12 +28287,12 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(*model.SecretPaginatedRecords) fc.Result = res - return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalOSecretPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSecretPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listSecrets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33395,44 +28300,14 @@ func (ec *executionContext) fieldContext_Query_core_getRouter(ctx context.Contex IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "accountName": - return ec.fieldContext_Router_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_Router_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Router_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_Router_displayName(ctx, field) - case "enabled": - return ec.fieldContext_Router_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_Router_environmentName(ctx, field) - case "id": - return ec.fieldContext_Router_id(ctx, field) - case "kind": - return ec.fieldContext_Router_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Router_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_Router_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Router_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_Router_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_Router_spec(ctx, field) - case "status": - return ec.fieldContext_Router_status(ctx, field) - case "syncStatus": - return ec.fieldContext_Router_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Router_updateTime(ctx, field) + case "edges": + return ec.fieldContext_SecretPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_SecretPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_SecretPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, fmt.Errorf("no field named %q was found under type SecretPaginatedRecords", field.Name) }, } defer func() { @@ -33442,15 +28317,15 @@ func (ec *executionContext) fieldContext_Query_core_getRouter(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listSecrets_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncRouter(ctx, field) +func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getSecret(ctx, field) if err != nil { return graphql.Null } @@ -33464,7 +28339,7 @@ func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33486,34 +28361,71 @@ func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*entities.Secret); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Secret`, tmp) }) 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) + res := resTmp.(*entities.Secret) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOSecret2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_Secret_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Secret_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Secret_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Secret_creationTime(ctx, field) + case "data": + return ec.fieldContext_Secret_data(ctx, field) + case "displayName": + return ec.fieldContext_Secret_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_Secret_environmentName(ctx, field) + case "id": + return ec.fieldContext_Secret_id(ctx, field) + case "immutable": + return ec.fieldContext_Secret_immutable(ctx, field) + case "isReadyOnly": + return ec.fieldContext_Secret_isReadyOnly(ctx, field) + case "kind": + return ec.fieldContext_Secret_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Secret_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Secret_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Secret_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Secret_recordVersion(ctx, field) + case "stringData": + return ec.fieldContext_Secret_stringData(ctx, field) + case "syncStatus": + return ec.fieldContext_Secret_syncStatus(ctx, field) + case "type": + return ec.fieldContext_Secret_type(ctx, field) + case "updateTime": + return ec.fieldContext_Secret_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Secret", field.Name) }, } defer func() { @@ -33523,15 +28435,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncRouter(ctx context.Con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeys(ctx, field) +func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncSecret(ctx, field) if err != nil { return graphql.Null } @@ -33545,7 +28457,7 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context. resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResouceOutputKeys(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33567,10 +28479,10 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context. if tmp == nil { return nil, nil } - if data, ok := tmp.([]string); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []string`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33582,19 +28494,19 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context. } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(bool) fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncSecret(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", 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") + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -33604,15 +28516,15 @@ func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeys( } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getManagedResouceOutputKeys_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncSecret_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeyValues(ctx, field) +func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listRouters(ctx, field) if err != nil { return graphql.Null } @@ -33626,7 +28538,7 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResouceOutputKeyValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) + return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchRouters), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33648,27 +28560,24 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx con if tmp == nil { return nil, nil } - if data, ok := tmp.([]*domain.ManagedResourceKeyValueRef); ok { + if data, ok := tmp.(*model.RouterPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyValueRef`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.RouterPaginatedRecords`, tmp) }) 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.([]*domain.ManagedResourceKeyValueRef) + res := resTmp.(*model.RouterPaginatedRecords) fc.Result = res - return ec.marshalNManagedResourceKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRefᚄ(ctx, field.Selections, res) + return ec.marshalORouterPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeyValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listRouters(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33676,14 +28585,14 @@ func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeyVa IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "key": - return ec.fieldContext_ManagedResourceKeyValueRef_key(ctx, field) - case "mresName": - return ec.fieldContext_ManagedResourceKeyValueRef_mresName(ctx, field) - case "value": - return ec.fieldContext_ManagedResourceKeyValueRef_value(ctx, field) + case "edges": + return ec.fieldContext_RouterPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_RouterPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_RouterPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedResourceKeyValueRef", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RouterPaginatedRecords", field.Name) }, } defer func() { @@ -33693,15 +28602,15 @@ func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeyVa } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getManagedResouceOutputKeyValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listRouters_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listManagedResources(ctx, field) +func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getRouter(ctx, field) if err != nil { return graphql.Null } @@ -33715,7 +28624,7 @@ func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchManagedResources), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33737,10 +28646,10 @@ func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.ManagedResourcePaginatedRecords); ok { + if data, ok := tmp.(*entities.Router); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ManagedResourcePaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Router`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33749,12 +28658,12 @@ func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ManagedResourcePaginatedRecords) + res := resTmp.(*entities.Router) fc.Result = res - return ec.marshalOManagedResourcePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourcePaginatedRecords(ctx, field.Selections, res) + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33762,14 +28671,42 @@ func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx con IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_ManagedResourcePaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ManagedResourcePaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ManagedResourcePaginatedRecords_totalCount(ctx, field) + case "accountName": + return ec.fieldContext_Router_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_Router_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_Router_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_Router_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Router_displayName(ctx, field) + case "enabled": + return ec.fieldContext_Router_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_Router_environmentName(ctx, field) + case "id": + return ec.fieldContext_Router_id(ctx, field) + case "kind": + return ec.fieldContext_Router_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Router_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Router_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Router_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_Router_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_Router_spec(ctx, field) + case "status": + return ec.fieldContext_Router_status(ctx, field) + case "syncStatus": + return ec.fieldContext_Router_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Router_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ManagedResourcePaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) }, } defer func() { @@ -33779,15 +28716,15 @@ func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listManagedResources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getManagedResource(ctx, field) +func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncRouter(ctx, field) if err != nil { return graphql.Null } @@ -33801,7 +28738,7 @@ func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33823,71 +28760,34 @@ func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ManagedResource); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) }) 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.(*entities.ManagedResource) + res := resTmp.(bool) fc.Result = res - return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncRouter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "accountName": - return ec.fieldContext_ManagedResource_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ManagedResource_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_ManagedResource_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ManagedResource_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ManagedResource_displayName(ctx, field) - case "enabled": - return ec.fieldContext_ManagedResource_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_ManagedResource_environmentName(ctx, field) - case "id": - return ec.fieldContext_ManagedResource_id(ctx, field) - case "kind": - return ec.fieldContext_ManagedResource_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ManagedResource_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ManagedResource_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ManagedResource_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ManagedResource_spec(ctx, field) - case "status": - return ec.fieldContext_ManagedResource_status(ctx, field) - case "syncedOutputSecretRef": - return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) - case "syncStatus": - return ec.fieldContext_ManagedResource_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ManagedResource_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -33897,15 +28797,15 @@ func (ec *executionContext) fieldContext_Query_core_getManagedResource(ctx conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncRouter_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncManagedResource(ctx, field) +func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeys(ctx, field) if err != nil { return graphql.Null } @@ -33919,7 +28819,7 @@ func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Contex resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetManagedResouceOutputKeys(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33941,10 +28841,10 @@ func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Contex if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.([]string); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []string`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -33956,19 +28856,19 @@ func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Contex } return graphql.Null } - res := resTmp.(bool) + res := resTmp.([]string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeys(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, 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 nil, errors.New("field of type String does not have child fields") }, } defer func() { @@ -33978,15 +28878,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncManagedResource(ctx co } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getManagedResouceOutputKeys_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listProjectManagedServices(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listProjectManagedServices(ctx, field) +func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResouceOutputKeyValues(ctx, field) if err != nil { return graphql.Null } @@ -34000,7 +28900,7 @@ func (ec *executionContext) _Query_core_listProjectManagedServices(ctx context.C resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListProjectManagedServices(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchProjectManagedService), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreGetManagedResouceOutputKeyValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34022,24 +28922,27 @@ func (ec *executionContext) _Query_core_listProjectManagedServices(ctx context.C if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.ProjectManagedServicePaginatedRecords); ok { + if data, ok := tmp.([]*domain.ManagedResourceKeyValueRef); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ProjectManagedServicePaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ManagedResourceKeyValueRef`, tmp) }) 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.ProjectManagedServicePaginatedRecords) + res := resTmp.([]*domain.ManagedResourceKeyValueRef) fc.Result = res - return ec.marshalOProjectManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServicePaginatedRecords(ctx, field.Selections, res) + return ec.marshalNManagedResourceKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyValueRefᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listProjectManagedServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getManagedResouceOutputKeyValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -34047,14 +28950,14 @@ func (ec *executionContext) fieldContext_Query_core_listProjectManagedServices(c IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "edges": - return ec.fieldContext_ProjectManagedServicePaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ProjectManagedServicePaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ProjectManagedServicePaginatedRecords_totalCount(ctx, field) + case "key": + return ec.fieldContext_ManagedResourceKeyValueRef_key(ctx, field) + case "mresName": + return ec.fieldContext_ManagedResourceKeyValueRef_mresName(ctx, field) + case "value": + return ec.fieldContext_ManagedResourceKeyValueRef_value(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedServicePaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ManagedResourceKeyValueRef", field.Name) }, } defer func() { @@ -34064,15 +28967,15 @@ func (ec *executionContext) fieldContext_Query_core_listProjectManagedServices(c } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listProjectManagedServices_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getManagedResouceOutputKeyValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getProjectManagedService(ctx, field) +func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listManagedResources(ctx, field) if err != nil { return graphql.Null } @@ -34086,7 +28989,7 @@ func (ec *executionContext) _Query_core_getProjectManagedService(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchManagedResources), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34108,10 +29011,10 @@ func (ec *executionContext) _Query_core_getProjectManagedService(ctx context.Con if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ProjectManagedService); ok { + if data, ok := tmp.(*model.ManagedResourcePaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ProjectManagedService`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ManagedResourcePaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -34120,12 +29023,12 @@ func (ec *executionContext) _Query_core_getProjectManagedService(ctx context.Con if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ProjectManagedService) + res := resTmp.(*model.ManagedResourcePaginatedRecords) fc.Result = res - return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx, field.Selections, res) + return ec.marshalOManagedResourcePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐManagedResourcePaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listManagedResources(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -34133,40 +29036,14 @@ func (ec *executionContext) fieldContext_Query_core_getProjectManagedService(ctx IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) - case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) - case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) - case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) - case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) - case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_ProjectManagedService_updateTime(ctx, field) + case "edges": + return ec.fieldContext_ManagedResourcePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ManagedResourcePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_ManagedResourcePaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ProjectManagedService", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ManagedResourcePaginatedRecords", field.Name) }, } defer func() { @@ -34176,15 +29053,15 @@ func (ec *executionContext) fieldContext_Query_core_getProjectManagedService(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listManagedResources_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncProjectManagedService(ctx, field) +func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getManagedResource(ctx, field) if err != nil { return graphql.Null } @@ -34198,7 +29075,7 @@ func (ec *executionContext) _Query_core_resyncProjectManagedService(ctx context. resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34220,34 +29097,69 @@ func (ec *executionContext) _Query_core_resyncProjectManagedService(ctx context. if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*entities.ManagedResource); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ManagedResource`, tmp) }) 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) + res := resTmp.(*entities.ManagedResource) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOManagedResource2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + switch field.Name { + case "accountName": + return ec.fieldContext_ManagedResource_accountName(ctx, field) + case "apiVersion": + return ec.fieldContext_ManagedResource_apiVersion(ctx, field) + case "createdBy": + return ec.fieldContext_ManagedResource_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_ManagedResource_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_ManagedResource_displayName(ctx, field) + case "enabled": + return ec.fieldContext_ManagedResource_enabled(ctx, field) + case "environmentName": + return ec.fieldContext_ManagedResource_environmentName(ctx, field) + case "id": + return ec.fieldContext_ManagedResource_id(ctx, field) + case "kind": + return ec.fieldContext_ManagedResource_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_ManagedResource_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_ManagedResource_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_ManagedResource_metadata(ctx, field) + case "recordVersion": + return ec.fieldContext_ManagedResource_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ManagedResource_spec(ctx, field) + case "status": + return ec.fieldContext_ManagedResource_status(ctx, field) + case "syncedOutputSecretRef": + return ec.fieldContext_ManagedResource_syncedOutputSecretRef(ctx, field) + case "syncStatus": + return ec.fieldContext_ManagedResource_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_ManagedResource_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ManagedResource", field.Name) }, } defer func() { @@ -34257,15 +29169,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncProjectManagedService( } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_restartProjectManagedService(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_restartProjectManagedService(ctx, field) +func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncManagedResource(ctx, field) if err != nil { return graphql.Null } @@ -34279,7 +29191,7 @@ func (ec *executionContext) _Query_core_restartProjectManagedService(ctx context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreRestartProjectManagedService(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34321,7 +29233,7 @@ func (ec *executionContext) _Query_core_restartProjectManagedService(ctx context return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_restartProjectManagedService(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_resyncManagedResource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -34338,7 +29250,7 @@ func (ec *executionContext) fieldContext_Query_core_restartProjectManagedService } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_restartProjectManagedService_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_resyncManagedResource_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -35437,50 +30349,6 @@ func (ec *executionContext) fieldContext_Router_metadata(ctx context.Context, fi return fc, nil } -func (ec *executionContext) _Router_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_projectName(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.ProjectName, 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_Router_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Router", - 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) _Router_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Router_recordVersion(ctx, field) if err != nil { @@ -35855,8 +30723,6 @@ func (ec *executionContext) fieldContext_RouterEdge_node(ctx context.Context, fi return ec.fieldContext_Router_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Router_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Router_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Router_recordVersion(ctx, field) case "spec": @@ -36652,50 +31518,6 @@ func (ec *executionContext) fieldContext_Secret_metadata(ctx context.Context, fi return fc, nil } -func (ec *executionContext) _Secret_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_projectName(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.ProjectName, 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_Secret_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Secret", - 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) _Secret_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Secret_recordVersion(ctx, field) if err != nil { @@ -37035,8 +31857,6 @@ func (ec *executionContext) fieldContext_SecretEdge_node(ctx context.Context, fi return ec.fieldContext_Secret_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_Secret_metadata(ctx, field) - case "projectName": - return ec.fieldContext_Secret_projectName(ctx, field) case "recordVersion": return ec.fieldContext_Secret_recordVersion(ctx, field) case "stringData": @@ -39728,7 +34548,7 @@ func (ec *executionContext) unmarshalInputEnvironmentIn(ctx context.Context, obj asMap[k] = v } - fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} + fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "kind", "metadata", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -39744,6 +34564,15 @@ func (ec *executionContext) unmarshalInputEnvironmentIn(ctx context.Context, obj return it, err } it.APIVersion = data + case "clusterName": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ClusterName = data case "displayName": var err error @@ -40476,22 +35305,13 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a asMap[k] = v } - fieldsInOrder := [...]string{"projectName", "routing", "targetNamespace"} + fieldsInOrder := [...]string{"routing", "targetNamespace"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.ProjectName = data case "routing": var err error @@ -40751,53 +35571,6 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, nil } -func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { - var it model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"nodeSelector", "serviceTemplate", "tolerations"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "nodeSelector": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nodeSelector")) - data, err := ec.unmarshalOMap2map(ctx, v) - if err != nil { - return it, err - } - it.NodeSelector = data - case "serviceTemplate": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceTemplate")) - data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx, v) - if err != nil { - return it, err - } - it.ServiceTemplate = data - case "tolerations": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("tolerations")) - data, err := ec.unmarshalOK8s__io___api___core___v1__TolerationIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐK8sIoAPICoreV1TolerationInᚄ(ctx, v) - if err != nil { - return it, err - } - it.Tolerations = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn, error) { var it model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn asMap := map[string]interface{}{} @@ -40993,73 +35766,6 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, nil } -func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn, error) { - var it model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"msvcSpec", "targetNamespace"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "msvcSpec": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("msvcSpec")) - data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx, v) - if err != nil { - return it, err - } - it.MsvcSpec = data - case "targetNamespace": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.TargetNamespace = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { - var it model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"targetNamespace"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "targetNamespace": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.TargetNamespace = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__RateLimitIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1RateLimitIn, error) { var it model.GithubComKloudliteOperatorApisCrdsV1RateLimitIn asMap := map[string]interface{}{} @@ -41273,53 +35979,6 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, nil } -func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { - var it model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"apiVersion", "kind", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.APIVersion = data - case "kind": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.Kind = data - case "spec": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalNMap2map(ctx, v) - if err != nil { - return it, err - } - it.Spec = data - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ShellProbeIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ShellProbeIn, error) { var it model.GithubComKloudliteOperatorApisCrdsV1ShellProbeIn asMap := map[string]interface{}{} @@ -42147,153 +36806,6 @@ func (ec *executionContext) unmarshalInputPortIn(ctx context.Context, obj interf return it, nil } -func (ec *executionContext) unmarshalInputProjectIn(ctx context.Context, obj interface{}) (entities.Project, error) { - var it entities.Project - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - data, err := ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - it.APIVersion = data - case "clusterName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clusterName")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.ClusterName = data - case "displayName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.DisplayName = data - case "kind": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - data, err := ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - it.Kind = data - case "metadata": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ProjectIn().Metadata(ctx, &it, data); err != nil { - return it, err - } - case "spec": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ProjectIn().Spec(ctx, &it, data); err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputProjectManagedServiceIn(ctx context.Context, obj interface{}) (entities.ProjectManagedService, error) { - var it entities.ProjectManagedService - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"apiVersion", "displayName", "kind", "metadata", "spec"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "apiVersion": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) - data, err := ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - it.APIVersion = data - case "displayName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.DisplayName = data - case "kind": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) - data, err := ec.unmarshalOString2string(ctx, v) - if err != nil { - return it, err - } - it.Kind = data - case "metadata": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("metadata")) - data, err := ec.unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ProjectManagedServiceIn().Metadata(ctx, &it, data); err != nil { - return it, err - } - case "spec": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("spec")) - data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn(ctx, v) - if err != nil { - return it, err - } - if err = ec.resolvers.ProjectManagedServiceIn().Spec(ctx, &it, data); err != nil { - return it, err - } - } - } - - return it, nil -} - func (ec *executionContext) unmarshalInputRouterIn(ctx context.Context, obj interface{}) (entities.Router, error) { var it entities.Router asMap := map[string]interface{}{} @@ -43120,11 +37632,6 @@ func (ec *executionContext) _App(ctx context.Context, sel ast.SelectionSet, obj out.Values[i] = ec._App_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._App_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._App_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._App_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -43550,11 +38057,6 @@ func (ec *executionContext) _Config(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec._Config_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._Config_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._Config_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._Config_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -44297,6 +38799,11 @@ func (ec *executionContext) _Environment(ctx context.Context, sel ast.SelectionS } case "apiVersion": out.Values[i] = ec._Environment_apiVersion(ctx, field, obj) + case "clusterName": + out.Values[i] = ec._Environment_clusterName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } case "createdBy": out.Values[i] = ec._Environment_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -44359,11 +38866,6 @@ func (ec *executionContext) _Environment(ctx context.Context, sel ast.SelectionS out.Values[i] = ec._Environment_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._Environment_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._Environment_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._Environment_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -45329,11 +39831,6 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec") - case "projectName": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } case "routing": out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec_routing(ctx, field, obj) case "targetNamespace": @@ -45582,49 +40079,6 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ return out } -var github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec"} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecImplementors) - - 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("Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec") - case "nodeSelector": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_nodeSelector(ctx, field, obj) - case "serviceTemplate": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_serviceTemplate(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "tolerations": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec_tolerations(ctx, field, obj) - 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 github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate"} func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) graphql.Marshaler { @@ -45784,89 +40238,6 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ return out } -var github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec"} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecImplementors) - - 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("Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec") - case "msvcSpec": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_msvcSpec(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "targetNamespace": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec_targetNamespace(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 github__com___kloudlite___operator___apis___crds___v1__ProjectSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec"} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ProjectSpecImplementors) - - 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("Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec") - case "targetNamespace": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec_targetNamespace(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 github__com___kloudlite___operator___apis___crds___v1__RateLimitImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__RateLimit"} func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__RateLimit(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) graphql.Marshaler { @@ -46015,55 +40386,6 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ return out } -var github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate"} - -func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateImplementors) - - 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("Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate") - case "apiVersion": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_apiVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "spec": - out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_spec(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 github__com___kloudlite___operator___apis___crds___v1__ShellProbeImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__ShellProbe"} func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ShellProbe(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1ShellProbe) graphql.Marshaler { @@ -46780,11 +41102,6 @@ func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.Select if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "projectName": - out.Values[i] = ec._ImagePullSecret_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._ImagePullSecret_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -47047,395 +41364,7 @@ func (ec *executionContext) _K8s__io___api___core___v1__Secret(ctx context.Conte ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._K8s__io___api___core___v1__Secret_type(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - 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 k8s__io___api___core___v1__TolerationImplementors = []string{"K8s__io___api___core___v1__Toleration"} - -func (ec *executionContext) _K8s__io___api___core___v1__Toleration(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Toleration) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TolerationImplementors) - - 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("K8s__io___api___core___v1__Toleration") - case "effect": - out.Values[i] = ec._K8s__io___api___core___v1__Toleration_effect(ctx, field, obj) - case "key": - out.Values[i] = ec._K8s__io___api___core___v1__Toleration_key(ctx, field, obj) - case "operator": - out.Values[i] = ec._K8s__io___api___core___v1__Toleration_operator(ctx, field, obj) - case "tolerationSeconds": - out.Values[i] = ec._K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field, obj) - case "value": - out.Values[i] = ec._K8s__io___api___core___v1__Toleration_value(ctx, field, obj) - 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 k8s__io___api___core___v1__TopologySpreadConstraintImplementors = []string{"K8s__io___api___core___v1__TopologySpreadConstraint"} - -func (ec *executionContext) _K8s__io___api___core___v1__TopologySpreadConstraint(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1TopologySpreadConstraint) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TopologySpreadConstraintImplementors) - - 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("K8s__io___api___core___v1__TopologySpreadConstraint") - case "labelSelector": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_labelSelector(ctx, field, obj) - case "matchLabelKeys": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_matchLabelKeys(ctx, field, obj) - case "maxSkew": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_maxSkew(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "minDomains": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_minDomains(ctx, field, obj) - case "nodeAffinityPolicy": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_nodeAffinityPolicy(ctx, field, obj) - case "nodeTaintsPolicy": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_nodeTaintsPolicy(ctx, field, obj) - case "topologyKey": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_topologyKey(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "whenUnsatisfiable": - out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_whenUnsatisfiable(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 k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector"} - -func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors) - - 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("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector") - case "matchExpressions": - out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field, obj) - case "matchLabels": - out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field, obj) - 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 k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement"} - -func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors) - - 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("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement") - case "key": - out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "operator": - out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "values": - out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx, field, obj) - 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 managedResourceImplementors = []string{"ManagedResource"} - -func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.SelectionSet, obj *entities.ManagedResource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceImplementors) - - 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("ManagedResource") - case "accountName": - out.Values[i] = ec._ManagedResource_accountName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "apiVersion": - out.Values[i] = ec._ManagedResource_apiVersion(ctx, field, obj) - case "createdBy": - out.Values[i] = ec._ManagedResource_createdBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "creationTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._ManagedResource_creationTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "displayName": - out.Values[i] = ec._ManagedResource_displayName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "enabled": - out.Values[i] = ec._ManagedResource_enabled(ctx, field, obj) - case "environmentName": - out.Values[i] = ec._ManagedResource_environmentName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "id": - out.Values[i] = ec._ManagedResource_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "kind": - out.Values[i] = ec._ManagedResource_kind(ctx, field, obj) - case "lastUpdatedBy": - out.Values[i] = ec._ManagedResource_lastUpdatedBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "markedForDeletion": - out.Values[i] = ec._ManagedResource_markedForDeletion(ctx, field, obj) - case "metadata": - out.Values[i] = ec._ManagedResource_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._ManagedResource_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "recordVersion": - out.Values[i] = ec._ManagedResource_recordVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "spec": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._ManagedResource_spec(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "status": - out.Values[i] = ec._ManagedResource_status(ctx, field, obj) - case "syncedOutputSecretRef": - out.Values[i] = ec._ManagedResource_syncedOutputSecretRef(ctx, field, obj) - case "syncStatus": - out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "updateTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._ManagedResource_updateTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._K8s__io___api___core___v1__Secret_type(ctx, field, obj) return res } @@ -47482,71 +41411,27 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select return out } -var managedResourceEdgeImplementors = []string{"ManagedResourceEdge"} - -func (ec *executionContext) _ManagedResourceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceEdgeImplementors) - - 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("ManagedResourceEdge") - case "cursor": - out.Values[i] = ec._ManagedResourceEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "node": - out.Values[i] = ec._ManagedResourceEdge_node(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 managedResourceKeyRefImplementors = []string{"ManagedResourceKeyRef"} +var k8s__io___api___core___v1__TolerationImplementors = []string{"K8s__io___api___core___v1__Toleration"} -func (ec *executionContext) _ManagedResourceKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceKeyRef) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyRefImplementors) +func (ec *executionContext) _K8s__io___api___core___v1__Toleration(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1Toleration) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TolerationImplementors) 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("ManagedResourceKeyRef") + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Toleration") + case "effect": + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_effect(ctx, field, obj) case "key": - out.Values[i] = ec._ManagedResourceKeyRef_key(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "mresName": - out.Values[i] = ec._ManagedResourceKeyRef_mresName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_key(ctx, field, obj) + case "operator": + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_operator(ctx, field, obj) + case "tolerationSeconds": + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_tolerationSeconds(ctx, field, obj) + case "value": + out.Values[i] = ec._K8s__io___api___core___v1__Toleration_value(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -47570,29 +41455,39 @@ func (ec *executionContext) _ManagedResourceKeyRef(ctx context.Context, sel ast. return out } -var managedResourceKeyValueRefImplementors = []string{"ManagedResourceKeyValueRef"} +var k8s__io___api___core___v1__TopologySpreadConstraintImplementors = []string{"K8s__io___api___core___v1__TopologySpreadConstraint"} -func (ec *executionContext) _ManagedResourceKeyValueRef(ctx context.Context, sel ast.SelectionSet, obj *domain.ManagedResourceKeyValueRef) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyValueRefImplementors) +func (ec *executionContext) _K8s__io___api___core___v1__TopologySpreadConstraint(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoAPICoreV1TopologySpreadConstraint) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__TopologySpreadConstraintImplementors) 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("ManagedResourceKeyValueRef") - case "key": - out.Values[i] = ec._ManagedResourceKeyValueRef_key(ctx, field, obj) + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__TopologySpreadConstraint") + case "labelSelector": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_labelSelector(ctx, field, obj) + case "matchLabelKeys": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_matchLabelKeys(ctx, field, obj) + case "maxSkew": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_maxSkew(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "mresName": - out.Values[i] = ec._ManagedResourceKeyValueRef_mresName(ctx, field, obj) + case "minDomains": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_minDomains(ctx, field, obj) + case "nodeAffinityPolicy": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_nodeAffinityPolicy(ctx, field, obj) + case "nodeTaintsPolicy": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_nodeTaintsPolicy(ctx, field, obj) + case "topologyKey": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_topologyKey(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "value": - out.Values[i] = ec._ManagedResourceKeyValueRef_value(ctx, field, obj) + case "whenUnsatisfiable": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_whenUnsatisfiable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -47619,32 +41514,21 @@ func (ec *executionContext) _ManagedResourceKeyValueRef(ctx context.Context, sel return out } -var managedResourcePaginatedRecordsImplementors = []string{"ManagedResourcePaginatedRecords"} +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector"} -func (ec *executionContext) _ManagedResourcePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourcePaginatedRecords) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourcePaginatedRecordsImplementors) +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelector) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors) 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("ManagedResourcePaginatedRecords") - case "edges": - out.Values[i] = ec._ManagedResourcePaginatedRecords_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pageInfo": - out.Values[i] = ec._ManagedResourcePaginatedRecords_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "totalCount": - out.Values[i] = ec._ManagedResourcePaginatedRecords_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = graphql.MarshalString("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector") + case "matchExpressions": + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchExpressions(ctx, field, obj) + case "matchLabels": + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector_matchLabels(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -47668,28 +41552,29 @@ func (ec *executionContext) _ManagedResourcePaginatedRecords(ctx context.Context return out } -var matchFilterImplementors = []string{"MatchFilter"} +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement"} -func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors) +func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.K8sIoApimachineryPkgApisMetaV1LabelSelectorRequirement) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors) 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("MatchFilter") - case "array": - out.Values[i] = ec._MatchFilter_array(ctx, field, obj) - case "exact": - out.Values[i] = ec._MatchFilter_exact(ctx, field, obj) - case "matchType": - out.Values[i] = ec._MatchFilter_matchType(ctx, field, obj) + out.Values[i] = graphql.MarshalString("K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement") + case "key": + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_key(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "regex": - out.Values[i] = ec._MatchFilter_regex(ctx, field, obj) + case "operator": + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_operator(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "values": + out.Values[i] = ec._K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement_values(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -47713,51 +41598,30 @@ func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionS return out } -var metadataImplementors = []string{"Metadata"} +var managedResourceImplementors = []string{"ManagedResource"} -func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v13.ObjectMeta) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) +func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.SelectionSet, obj *entities.ManagedResource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceImplementors) 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("Metadata") - case "annotations": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Metadata_annotations(ctx, field, obj) - return res + out.Values[i] = graphql.MarshalString("ManagedResource") + case "accountName": + out.Values[i] = ec._ManagedResource_accountName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + case "apiVersion": + out.Values[i] = ec._ManagedResource_apiVersion(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._ManagedResource_createdBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "creationTimestamp": + case "creationTime": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47766,7 +41630,7 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_creationTimestamp(ctx, field, obj) + res = ec._ManagedResource_creationTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -47793,7 +41657,40 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "deletionTimestamp": + case "displayName": + out.Values[i] = ec._ManagedResource_displayName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "enabled": + out.Values[i] = ec._ManagedResource_enabled(ctx, field, obj) + case "environmentName": + out.Values[i] = ec._ManagedResource_environmentName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "id": + out.Values[i] = ec._ManagedResource_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "kind": + out.Values[i] = ec._ManagedResource_kind(ctx, field, obj) + case "lastUpdatedBy": + out.Values[i] = ec._ManagedResource_lastUpdatedBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "markedForDeletion": + out.Values[i] = ec._ManagedResource_markedForDeletion(ctx, field, obj) + case "metadata": + out.Values[i] = ec._ManagedResource_metadata(ctx, field, obj) + case "recordVersion": + out.Values[i] = ec._ManagedResource_recordVersion(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "spec": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47802,7 +41699,10 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_deletionTimestamp(ctx, field, obj) + res = ec._ManagedResource_spec(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -47826,12 +41726,16 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "generation": - out.Values[i] = ec._Metadata_generation(ctx, field, obj) + case "status": + out.Values[i] = ec._ManagedResource_status(ctx, field, obj) + case "syncedOutputSecretRef": + out.Values[i] = ec._ManagedResource_syncedOutputSecretRef(ctx, field, obj) + case "syncStatus": + out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "labels": + case "updateTime": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47840,7 +41744,10 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Metadata_labels(ctx, field, obj) + res = ec._ManagedResource_updateTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -47864,13 +41771,6 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "name": - out.Values[i] = ec._Metadata_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "namespace": - out.Values[i] = ec._Metadata_namespace(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -47894,207 +41794,24 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, return out } -var mutationImplementors = []string{"Mutation"} +var managedResourceEdgeImplementors = []string{"ManagedResourceEdge"} -func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Mutation", - }) +func (ec *executionContext) _ManagedResourceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceEdgeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Mutation") - case "core_createProject": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createProject(ctx, field) - }) - case "core_updateProject": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateProject(ctx, field) - }) - case "core_deleteProject": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteProject(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createEnvironment(ctx, field) - }) - case "core_updateEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateEnvironment(ctx, field) - }) - case "core_deleteEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteEnvironment(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_cloneEnvironment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_cloneEnvironment(ctx, field) - }) - case "core_createImagePullSecret": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createImagePullSecret(ctx, field) - }) - case "core_deleteImagePullSecret": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteImagePullSecret(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createApp": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createApp(ctx, field) - }) - case "core_updateApp": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateApp(ctx, field) - }) - case "core_deleteApp": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteApp(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_interceptApp": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_interceptApp(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createConfig": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createConfig(ctx, field) - }) - case "core_updateConfig": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateConfig(ctx, field) - }) - case "core_deleteConfig": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteConfig(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createSecret": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createSecret(ctx, field) - }) - case "core_updateSecret": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateSecret(ctx, field) - }) - case "core_deleteSecret": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteSecret(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createRouter": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createRouter(ctx, field) - }) - case "core_updateRouter": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateRouter(ctx, field) - }) - case "core_deleteRouter": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteRouter(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createManagedResource": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createManagedResource(ctx, field) - }) - case "core_updateManagedResource": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateManagedResource(ctx, field) - }) - case "core_deleteManagedResource": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteManagedResource(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createProjectManagedService": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createProjectManagedService(ctx, field) - }) - case "core_updateProjectManagedService": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateProjectManagedService(ctx, field) - }) - case "core_deleteProjectManagedService": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteProjectManagedService(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_createVPNDevice": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_createVPNDevice(ctx, field) - }) - case "core_updateVPNDevice": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVPNDevice(ctx, field) - }) - case "core_updateVPNDevicePorts": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVPNDevicePorts(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_updateVPNDeviceEnv": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVPNDeviceEnv(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_updateVpnDeviceNs": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVpnDeviceNs(ctx, field) - }) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "core_updateVpnClusterName": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVpnClusterName(ctx, field) - }) + out.Values[i] = graphql.MarshalString("ManagedResourceEdge") + case "cursor": + out.Values[i] = ec._ManagedResourceEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "core_deleteVPNDevice": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteVPNDevice(ctx, field) - }) + case "node": + out.Values[i] = ec._ManagedResourceEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -48121,25 +41838,27 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -var pageInfoImplementors = []string{"PageInfo"} +var managedResourceKeyRefImplementors = []string{"ManagedResourceKeyRef"} -func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) +func (ec *executionContext) _ManagedResourceKeyRef(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceKeyRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyRefImplementors) 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("PageInfo") - case "endCursor": - out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) - case "hasNextPage": - out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) - case "hasPreviousPage": - out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) - case "startCursor": - out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ManagedResourceKeyRef") + case "key": + out.Values[i] = ec._ManagedResourceKeyRef_key(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mresName": + out.Values[i] = ec._ManagedResourceKeyRef_mresName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48163,21 +41882,32 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, return out } -var portImplementors = []string{"Port"} +var managedResourceKeyValueRefImplementors = []string{"ManagedResourceKeyValueRef"} -func (ec *executionContext) _Port(ctx context.Context, sel ast.SelectionSet, obj *model.Port) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, portImplementors) +func (ec *executionContext) _ManagedResourceKeyValueRef(ctx context.Context, sel ast.SelectionSet, obj *domain.ManagedResourceKeyValueRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceKeyValueRefImplementors) 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("Port") - case "port": - out.Values[i] = ec._Port_port(ctx, field, obj) - case "targetPort": - out.Values[i] = ec._Port_targetPort(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ManagedResourceKeyValueRef") + case "key": + out.Values[i] = ec._ManagedResourceKeyValueRef_key(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "mresName": + out.Values[i] = ec._ManagedResourceKeyValueRef_mresName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "value": + out.Values[i] = ec._ManagedResourceKeyValueRef_value(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48201,172 +41931,32 @@ func (ec *executionContext) _Port(ctx context.Context, sel ast.SelectionSet, obj return out } -var projectImplementors = []string{"Project"} +var managedResourcePaginatedRecordsImplementors = []string{"ManagedResourcePaginatedRecords"} -func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, obj *entities.Project) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectImplementors) +func (ec *executionContext) _ManagedResourcePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourcePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, managedResourcePaginatedRecordsImplementors) 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("Project") - case "accountName": - out.Values[i] = ec._Project_accountName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "apiVersion": - out.Values[i] = ec._Project_apiVersion(ctx, field, obj) - case "clusterName": - out.Values[i] = ec._Project_clusterName(ctx, field, obj) - case "createdBy": - out.Values[i] = ec._Project_createdBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "creationTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Project_creationTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "displayName": - out.Values[i] = ec._Project_displayName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "id": - out.Values[i] = ec._Project_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "kind": - out.Values[i] = ec._Project_kind(ctx, field, obj) - case "lastUpdatedBy": - out.Values[i] = ec._Project_lastUpdatedBy(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ManagedResourcePaginatedRecords") + case "edges": + out.Values[i] = ec._ManagedResourcePaginatedRecords_edges(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } - case "markedForDeletion": - out.Values[i] = ec._Project_markedForDeletion(ctx, field, obj) - case "metadata": - out.Values[i] = ec._Project_metadata(ctx, field, obj) - case "recordVersion": - out.Values[i] = ec._Project_recordVersion(ctx, field, obj) + case "pageInfo": + out.Values[i] = ec._ManagedResourcePaginatedRecords_pageInfo(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "spec": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Project_spec(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "status": - out.Values[i] = ec._Project_status(ctx, field, obj) - case "syncStatus": - out.Values[i] = ec._Project_syncStatus(ctx, field, obj) + case "totalCount": + out.Values[i] = ec._ManagedResourcePaginatedRecords_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "updateTime": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Project_updateTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48390,27 +41980,28 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, return out } -var projectEdgeImplementors = []string{"ProjectEdge"} +var matchFilterImplementors = []string{"MatchFilter"} -func (ec *executionContext) _ProjectEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectEdgeImplementors) +func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionSet, obj *repos.MatchFilter) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, matchFilterImplementors) 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("ProjectEdge") - case "cursor": - out.Values[i] = ec._ProjectEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "node": - out.Values[i] = ec._ProjectEdge_node(ctx, field, obj) + out.Values[i] = graphql.MarshalString("MatchFilter") + case "array": + out.Values[i] = ec._MatchFilter_array(ctx, field, obj) + case "exact": + out.Values[i] = ec._MatchFilter_exact(ctx, field, obj) + case "matchType": + out.Values[i] = ec._MatchFilter_matchType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "regex": + out.Values[i] = ec._MatchFilter_regex(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48434,30 +42025,51 @@ func (ec *executionContext) _ProjectEdge(ctx context.Context, sel ast.SelectionS return out } -var projectManagedServiceImplementors = []string{"ProjectManagedService"} +var metadataImplementors = []string{"Metadata"} -func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast.SelectionSet, obj *entities.ProjectManagedService) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServiceImplementors) +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *v13.ObjectMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) 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("ProjectManagedService") - case "accountName": - out.Values[i] = ec._ProjectManagedService_accountName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Values[i] = graphql.MarshalString("Metadata") + case "annotations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Metadata_annotations(ctx, field, obj) + return res } - case "apiVersion": - out.Values[i] = ec._ProjectManagedService_apiVersion(ctx, field, obj) - case "createdBy": - out.Values[i] = ec._ProjectManagedService_createdBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "creationTime": + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "creationTimestamp": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -48466,7 +42078,7 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ProjectManagedService_creationTime(ctx, field, obj) + res = ec._Metadata_creationTimestamp(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -48493,38 +42105,7 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "displayName": - out.Values[i] = ec._ProjectManagedService_displayName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "id": - out.Values[i] = ec._ProjectManagedService_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "kind": - out.Values[i] = ec._ProjectManagedService_kind(ctx, field, obj) - case "lastUpdatedBy": - out.Values[i] = ec._ProjectManagedService_lastUpdatedBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "markedForDeletion": - out.Values[i] = ec._ProjectManagedService_markedForDeletion(ctx, field, obj) - case "metadata": - out.Values[i] = ec._ProjectManagedService_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._ProjectManagedService_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "recordVersion": - out.Values[i] = ec._ProjectManagedService_recordVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "spec": + case "deletionTimestamp": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -48533,7 +42114,7 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ProjectManagedService_spec(ctx, field, obj) + res = ec._Metadata_deletionTimestamp(ctx, field, obj) return res } @@ -48557,14 +42138,12 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "status": - out.Values[i] = ec._ProjectManagedService_status(ctx, field, obj) - case "syncStatus": - out.Values[i] = ec._ProjectManagedService_syncStatus(ctx, field, obj) + case "generation": + out.Values[i] = ec._Metadata_generation(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "updateTime": + case "labels": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -48573,10 +42152,7 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ProjectManagedService_updateTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Metadata_labels(ctx, field, obj) return res } @@ -48600,6 +42176,13 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "name": + out.Values[i] = ec._Metadata_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "namespace": + out.Values[i] = ec._Metadata_namespace(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48623,24 +42206,177 @@ func (ec *executionContext) _ProjectManagedService(ctx context.Context, sel ast. return out } -var projectManagedServiceEdgeImplementors = []string{"ProjectManagedServiceEdge"} +var mutationImplementors = []string{"Mutation"} -func (ec *executionContext) _ProjectManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectManagedServiceEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServiceEdgeImplementors) +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ProjectManagedServiceEdge") - case "cursor": - out.Values[i] = ec._ProjectManagedServiceEdge_cursor(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Mutation") + case "core_createEnvironment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createEnvironment(ctx, field) + }) + case "core_updateEnvironment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateEnvironment(ctx, field) + }) + case "core_deleteEnvironment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteEnvironment(ctx, field) + }) if out.Values[i] == graphql.Null { out.Invalids++ } - case "node": - out.Values[i] = ec._ProjectManagedServiceEdge_node(ctx, field, obj) + case "core_cloneEnvironment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_cloneEnvironment(ctx, field) + }) + case "core_createImagePullSecret": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createImagePullSecret(ctx, field) + }) + case "core_deleteImagePullSecret": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteImagePullSecret(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createApp": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createApp(ctx, field) + }) + case "core_updateApp": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateApp(ctx, field) + }) + case "core_deleteApp": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteApp(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_interceptApp": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_interceptApp(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createConfig": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createConfig(ctx, field) + }) + case "core_updateConfig": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateConfig(ctx, field) + }) + case "core_deleteConfig": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteConfig(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createSecret": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createSecret(ctx, field) + }) + case "core_updateSecret": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateSecret(ctx, field) + }) + case "core_deleteSecret": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteSecret(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createRouter": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createRouter(ctx, field) + }) + case "core_updateRouter": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateRouter(ctx, field) + }) + case "core_deleteRouter": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteRouter(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createManagedResource": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createManagedResource(ctx, field) + }) + case "core_updateManagedResource": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateManagedResource(ctx, field) + }) + case "core_deleteManagedResource": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteManagedResource(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_createVPNDevice": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_createVPNDevice(ctx, field) + }) + case "core_updateVPNDevice": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDevice(ctx, field) + }) + case "core_updateVPNDevicePorts": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDevicePorts(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_updateVPNDeviceEnv": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVPNDeviceEnv(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_updateVpnDeviceNs": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVpnDeviceNs(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_updateVpnClusterName": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_updateVpnClusterName(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "core_deleteVPNDevice": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteVPNDevice(ctx, field) + }) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -48667,32 +42403,25 @@ func (ec *executionContext) _ProjectManagedServiceEdge(ctx context.Context, sel return out } -var projectManagedServicePaginatedRecordsImplementors = []string{"ProjectManagedServicePaginatedRecords"} +var pageInfoImplementors = []string{"PageInfo"} -func (ec *executionContext) _ProjectManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectManagedServicePaginatedRecords) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectManagedServicePaginatedRecordsImplementors) +func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, obj *model.PageInfo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pageInfoImplementors) 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("ProjectManagedServicePaginatedRecords") - case "edges": - out.Values[i] = ec._ProjectManagedServicePaginatedRecords_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pageInfo": - out.Values[i] = ec._ProjectManagedServicePaginatedRecords_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "totalCount": - out.Values[i] = ec._ProjectManagedServicePaginatedRecords_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = graphql.MarshalString("PageInfo") + case "endCursor": + out.Values[i] = ec._PageInfo_endCursor(ctx, field, obj) + case "hasNextPage": + out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) + case "hasPreviousPage": + out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) + case "startCursor": + out.Values[i] = ec._PageInfo_startCursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48716,32 +42445,21 @@ func (ec *executionContext) _ProjectManagedServicePaginatedRecords(ctx context.C return out } -var projectPaginatedRecordsImplementors = []string{"ProjectPaginatedRecords"} +var portImplementors = []string{"Port"} -func (ec *executionContext) _ProjectPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectPaginatedRecords) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectPaginatedRecordsImplementors) +func (ec *executionContext) _Port(ctx context.Context, sel ast.SelectionSet, obj *model.Port) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, portImplementors) 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("ProjectPaginatedRecords") - case "edges": - out.Values[i] = ec._ProjectPaginatedRecords_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pageInfo": - out.Values[i] = ec._ProjectPaginatedRecords_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "totalCount": - out.Values[i] = ec._ProjectPaginatedRecords_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } + out.Values[i] = graphql.MarshalString("Port") + case "port": + out.Values[i] = ec._Port_port(ctx, field, obj) + case "targetPort": + out.Values[i] = ec._Port_targetPort(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -48805,66 +42523,6 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_listProjects": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_listProjects(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_getProject": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_getProject(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncProject": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_resyncProject(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "core_listEnvironments": field := field @@ -49389,88 +43047,6 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_listProjectManagedServices": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_listProjectManagedServices(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_getProjectManagedService": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_getProjectManagedService(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_resyncProjectManagedService": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_resyncProjectManagedService(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) - case "core_restartProjectManagedService": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_core_restartProjectManagedService(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "core_listVPNDevices": field := field @@ -49691,11 +43267,6 @@ func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec._Router_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._Router_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._Router_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._Router_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -50052,11 +43623,6 @@ func (ec *executionContext) _Secret(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec._Secret_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._Secret_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._Secret_projectName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordVersion": out.Values[i] = ec._Secret_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -51411,21 +44977,6 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec) 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._Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn, error) { - res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -51456,30 +45007,6 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) graphql.Marshaler { - return ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx, sel, &v) -} - -func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec) 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._Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx context.Context, v interface{}) (model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { - res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn, error) { - res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__Route2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1Route(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1Route) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -51519,21 +45046,6 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplate(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) 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._Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn, error) { - res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___wireguard___v1__CNameRecord2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisWireguardV1CNameRecord(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisWireguardV1CNameRecord) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -51970,144 +45482,6 @@ func (ec *executionContext) unmarshalNPortIn2ᚖgithubᚗcomᚋkloudliteᚋopera return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) 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._Project(ctx, sel, v) -} - -func (ec *executionContext) marshalNProjectEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectEdge) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNProjectEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNProjectEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectEdge(ctx context.Context, sel ast.SelectionSet, v *model.ProjectEdge) 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._ProjectEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNProjectIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, v interface{}) (entities.Project, error) { - res, err := ec.unmarshalInputProjectIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ProjectManagedService) 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._ProjectManagedService(ctx, sel, v) -} - -func (ec *executionContext) marshalNProjectManagedServiceEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectManagedServiceEdge) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNProjectManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdge(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNProjectManagedServiceEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServiceEdge(ctx context.Context, sel ast.SelectionSet, v *model.ProjectManagedServiceEdge) 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._ProjectManagedServiceEdge(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNProjectManagedServiceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, v interface{}) (entities.ProjectManagedService, error) { - res, err := ec.unmarshalInputProjectManagedServiceIn(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalNRouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -53568,21 +46942,6 @@ func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__RateLimit2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RateLimit(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1RateLimit) graphql.Marshaler { if v == nil { return graphql.Null @@ -54397,34 +47756,6 @@ func (ec *executionContext) unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpk return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx context.Context, sel ast.SelectionSet, v *entities.Project) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Project(ctx, sel, v) -} - -func (ec *executionContext) marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(ctx context.Context, sel ast.SelectionSet, v *entities.ProjectManagedService) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._ProjectManagedService(ctx, sel, v) -} - -func (ec *executionContext) marshalOProjectManagedServicePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectManagedServicePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ProjectManagedServicePaginatedRecords) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._ProjectManagedServicePaginatedRecords(ctx, sel, v) -} - -func (ec *executionContext) marshalOProjectPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectPaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.ProjectPaginatedRecords) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._ProjectPaginatedRecords(ctx, sel, v) -} - func (ec *executionContext) marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx context.Context, sel ast.SelectionSet, v *entities.Router) graphql.Marshaler { if v == nil { return graphql.Null @@ -54479,22 +47810,6 @@ func (ec *executionContext) unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋk return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOSearchProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjectManagedService(ctx context.Context, v interface{}) (*model.SearchProjectManagedService, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputSearchProjectManagedService(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOSearchProjects2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchProjects(ctx context.Context, v interface{}) (*model.SearchProjects, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputSearchProjects(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) unmarshalOSearchRouters2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchRouters(ctx context.Context, v interface{}) (*model.SearchRouters, error) { if v == nil { return nil, nil diff --git a/apps/console/internal/app/graph/model/models_gen.go b/apps/console/internal/app/graph/model/models_gen.go index c89517a91..1e06603e1 100644 --- a/apps/console/internal/app/graph/model/models_gen.go +++ b/apps/console/internal/app/graph/model/models_gen.go @@ -255,13 +255,11 @@ type GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn struct { } type GithubComKloudliteOperatorApisCrdsV1EnvironmentSpec struct { - ProjectName string `json:"projectName"` Routing *GithubComKloudliteOperatorApisCrdsV1EnvironmentRouting `json:"routing,omitempty"` TargetNamespace *string `json:"targetNamespace,omitempty"` } type GithubComKloudliteOperatorApisCrdsV1EnvironmentSpecIn struct { - ProjectName string `json:"projectName"` Routing *GithubComKloudliteOperatorApisCrdsV1EnvironmentRoutingIn `json:"routing,omitempty"` TargetNamespace *string `json:"targetNamespace,omitempty"` } @@ -326,18 +324,6 @@ type GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpecIn struct { ResourceTemplate *GithubComKloudliteOperatorApisCrdsV1MresResourceTemplateIn `json:"resourceTemplate"` } -type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec struct { - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplate `json:"serviceTemplate"` - Tolerations []*K8sIoAPICoreV1Toleration `json:"tolerations,omitempty"` -} - -type GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn struct { - NodeSelector map[string]interface{} `json:"nodeSelector,omitempty"` - ServiceTemplate *GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn `json:"serviceTemplate"` - Tolerations []*K8sIoAPICoreV1TolerationIn `json:"tolerations,omitempty"` -} - type GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` @@ -386,24 +372,6 @@ type GithubComKloudliteOperatorApisCrdsV1ProbeIn struct { Type string `json:"type"` } -type GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec struct { - MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpec `json:"msvcSpec"` - TargetNamespace string `json:"targetNamespace"` -} - -type GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn struct { - MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn `json:"msvcSpec"` - TargetNamespace string `json:"targetNamespace"` -} - -type GithubComKloudliteOperatorApisCrdsV1ProjectSpec struct { - TargetNamespace string `json:"targetNamespace"` -} - -type GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn struct { - TargetNamespace string `json:"targetNamespace"` -} - type GithubComKloudliteOperatorApisCrdsV1RateLimit struct { Connections *int `json:"connections,omitempty"` Enabled *bool `json:"enabled,omitempty"` @@ -456,18 +424,6 @@ type GithubComKloudliteOperatorApisCrdsV1RouterSpecIn struct { Routes []*GithubComKloudliteOperatorApisCrdsV1RouteIn `json:"routes,omitempty"` } -type GithubComKloudliteOperatorApisCrdsV1ServiceTemplate struct { - APIVersion string `json:"apiVersion"` - Kind string `json:"kind"` - Spec map[string]interface{} `json:"spec"` -} - -type GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn struct { - APIVersion string `json:"apiVersion"` - Kind string `json:"kind"` - Spec map[string]interface{} `json:"spec"` -} - type GithubComKloudliteOperatorApisCrdsV1ShellProbe struct { Command []string `json:"command,omitempty"` } @@ -653,28 +609,6 @@ type Port struct { TargetPort *int `json:"targetPort,omitempty"` } -type ProjectEdge struct { - Cursor string `json:"cursor"` - Node *entities.Project `json:"node"` -} - -type ProjectManagedServiceEdge struct { - Cursor string `json:"cursor"` - Node *entities.ProjectManagedService `json:"node"` -} - -type ProjectManagedServicePaginatedRecords struct { - Edges []*ProjectManagedServiceEdge `json:"edges"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - -type ProjectPaginatedRecords struct { - Edges []*ProjectEdge `json:"edges"` - PageInfo *PageInfo `json:"pageInfo"` - TotalCount int `json:"totalCount"` -} - type RouterEdge struct { Cursor string `json:"cursor"` Node *entities.Router `json:"node"` diff --git a/apps/console/internal/app/graph/project.resolvers.go b/apps/console/internal/app/graph/project.resolvers.go deleted file mode 100644 index 11b664976..000000000 --- a/apps/console/internal/app/graph/project.resolvers.go +++ /dev/null @@ -1,76 +0,0 @@ -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.39 - -import ( - "context" - "github.com/kloudlite/api/pkg/errors" - "time" - - "github.com/kloudlite/api/apps/console/internal/app/graph/generated" - "github.com/kloudlite/api/apps/console/internal/app/graph/model" - "github.com/kloudlite/api/apps/console/internal/entities" - fn "github.com/kloudlite/api/pkg/functions" - "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreationTime is the resolver for the creationTime field. -func (r *projectResolver) CreationTime(ctx context.Context, obj *entities.Project) (string, error) { - if obj == nil { - return "", errNilProject - } - return obj.CreationTime.Format(time.RFC3339), nil -} - -// Spec is the resolver for the spec field. -func (r *projectResolver) Spec(ctx context.Context, obj *entities.Project) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec, error) { - if obj == nil { - return nil, errNilProject - } - - m := &model.GithubComKloudliteOperatorApisCrdsV1ProjectSpec{} - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, errors.NewE(err) - } - return m, nil -} - -// UpdateTime is the resolver for the updateTime field. -func (r *projectResolver) UpdateTime(ctx context.Context, obj *entities.Project) (string, error) { - if obj == nil { - return "", errNilProject - } - return obj.UpdateTime.Format(time.RFC3339), nil -} - -// Metadata is the resolver for the metadata field. -func (r *projectInResolver) Metadata(ctx context.Context, obj *entities.Project, data *v1.ObjectMeta) error { - if obj == nil { - return errNilProject - } - - if data != nil { - obj.ObjectMeta = *data - } - - return nil -} - -// Spec is the resolver for the spec field. -func (r *projectInResolver) Spec(ctx context.Context, obj *entities.Project, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectSpecIn) error { - if obj == nil { - return errNilProject - } - return fn.JsonConversion(data, &obj.Spec) -} - -// Project returns generated.ProjectResolver implementation. -func (r *Resolver) Project() generated.ProjectResolver { return &projectResolver{r} } - -// ProjectIn returns generated.ProjectInResolver implementation. -func (r *Resolver) ProjectIn() generated.ProjectInResolver { return &projectInResolver{r} } - -type projectResolver struct{ *Resolver } -type projectInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/projectmanagedservice.resolvers.go b/apps/console/internal/app/graph/projectmanagedservice.resolvers.go deleted file mode 100644 index f9495a71b..000000000 --- a/apps/console/internal/app/graph/projectmanagedservice.resolvers.go +++ /dev/null @@ -1,80 +0,0 @@ -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.39 - -import ( - "context" - "github.com/kloudlite/api/pkg/errors" - "time" - - "github.com/kloudlite/api/apps/console/internal/app/graph/generated" - "github.com/kloudlite/api/apps/console/internal/app/graph/model" - "github.com/kloudlite/api/apps/console/internal/entities" - fn "github.com/kloudlite/api/pkg/functions" - "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// CreationTime is the resolver for the creationTime field. -func (r *projectManagedServiceResolver) CreationTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) { - if obj == nil { - return "", errNilProjectManagedService - } - return obj.CreationTime.Format(time.RFC3339), nil -} - -// Spec is the resolver for the spec field. -func (r *projectManagedServiceResolver) Spec(ctx context.Context, obj *entities.ProjectManagedService) (*model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec, error) { - if obj == nil { - return nil, errNilProjectManagedService - } - - m := &model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpec{} - if err := fn.JsonConversion(obj.Spec, &m); err != nil { - return nil, errors.NewE(err) - } - return m, nil -} - -// UpdateTime is the resolver for the updateTime field. -func (r *projectManagedServiceResolver) UpdateTime(ctx context.Context, obj *entities.ProjectManagedService) (string, error) { - if obj == nil { - return "", errNilProjectManagedService - } - return obj.UpdateTime.Format(time.RFC3339), nil -} - -// Metadata is the resolver for the metadata field. -func (r *projectManagedServiceInResolver) Metadata(ctx context.Context, obj *entities.ProjectManagedService, data *v1.ObjectMeta) error { - if obj == nil { - return errNilProjectManagedService - } - - if data != nil { - obj.ObjectMeta = *data - } - - return nil -} - -// Spec is the resolver for the spec field. -func (r *projectManagedServiceInResolver) Spec(ctx context.Context, obj *entities.ProjectManagedService, data *model.GithubComKloudliteOperatorApisCrdsV1ProjectManagedServiceSpecIn) error { - if obj == nil { - return errNilProjectManagedService - } - return fn.JsonConversion(data, &obj.Spec) -} - -// ProjectManagedService returns generated.ProjectManagedServiceResolver implementation. -func (r *Resolver) ProjectManagedService() generated.ProjectManagedServiceResolver { - return &projectManagedServiceResolver{r} -} - -// ProjectManagedServiceIn returns generated.ProjectManagedServiceInResolver implementation. -func (r *Resolver) ProjectManagedServiceIn() generated.ProjectManagedServiceInResolver { - return &projectManagedServiceInResolver{r} -} - -type projectManagedServiceResolver struct{ *Resolver } -type projectManagedServiceInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/resolver-utils.go b/apps/console/internal/app/graph/resolver-utils.go index 6b798ce85..9483e3667 100644 --- a/apps/console/internal/app/graph/resolver-utils.go +++ b/apps/console/internal/app/graph/resolver-utils.go @@ -98,10 +98,6 @@ var ( errNilRouter = errors.Newf("router obj is nil") ) -func newResourceContext(ctx domain.ConsoleContext, projectName string, environmentName string) domain.ResourceContext { - return domain.ResourceContext{ - ConsoleContext: ctx, - ProjectName: projectName, - EnvironmentName: environmentName, - } +func newResourceContext(ctx domain.ConsoleContext, environmentName string) domain.ResourceContext { + return domain.ResourceContext{ConsoleContext: ctx, EnvironmentName: environmentName} } diff --git a/apps/console/internal/app/graph/schema.graphqls b/apps/console/internal/app/graph/schema.graphqls index b6ed7853c..2bec68b57 100644 --- a/apps/console/internal/app/graph/schema.graphqls +++ b/apps/console/internal/app/graph/schema.graphqls @@ -3,7 +3,7 @@ directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION enum ConsoleResType { - project + # project app config secret @@ -86,9 +86,9 @@ input CoreSearchVPNDevices { type Query { core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount - core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount - core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount + # core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount @@ -124,10 +124,10 @@ type Query { core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount - core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount @@ -135,9 +135,9 @@ type Query { } type Mutation { - core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount - core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount - core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + # core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount + # core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount @@ -169,9 +169,10 @@ type Mutation { core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount diff --git a/apps/console/internal/app/graph/schema.resolvers.go b/apps/console/internal/app/graph/schema.resolvers.go index 509b6f536..205b85a66 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -27,43 +27,13 @@ func (r *appResolver) Build(ctx context.Context, obj *entities.App) (*model.Buil return &model.Build{ID: *obj.CIBuildId}, nil } -// CoreCreateProject is the resolver for the core_createProject field. -func (r *mutationResolver) CoreCreateProject(ctx context.Context, project entities.Project) (*entities.Project, error) { - cc, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - return r.Domain.CreateProject(cc, project) -} - -// CoreUpdateProject is the resolver for the core_updateProject field. -func (r *mutationResolver) CoreUpdateProject(ctx context.Context, project entities.Project) (*entities.Project, error) { - cc, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - return r.Domain.UpdateProject(cc, project) -} - -// CoreDeleteProject is the resolver for the core_deleteProject field. -func (r *mutationResolver) CoreDeleteProject(ctx context.Context, name string) (bool, error) { - cc, err := toConsoleContext(ctx) - if err != nil { - return false, errors.NewE(err) - } - if err := r.Domain.DeleteProject(cc, name); err != nil { - return false, errors.NewE(err) - } - return true, nil -} - // CoreCreateEnvironment is the resolver for the core_createEnvironment field. func (r *mutationResolver) CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateEnvironment(cc, projectName, env) + return r.Domain.CreateEnvironment(cc, env) } // CoreUpdateEnvironment is the resolver for the core_updateEnvironment field. @@ -72,7 +42,7 @@ func (r *mutationResolver) CoreUpdateEnvironment(ctx context.Context, projectNam if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateEnvironment(cc, projectName, env) + return r.Domain.UpdateEnvironment(cc, env) } // CoreDeleteEnvironment is the resolver for the core_deleteEnvironment field. @@ -81,7 +51,7 @@ func (r *mutationResolver) CoreDeleteEnvironment(ctx context.Context, projectNam if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteEnvironment(cc, projectName, envName); err != nil { + if err := r.Domain.DeleteEnvironment(cc, envName); err != nil { return false, errors.NewE(err) } return true, nil @@ -93,7 +63,7 @@ func (r *mutationResolver) CoreCloneEnvironment(ctx context.Context, projectName if err != nil { return nil, errors.NewE(err) } - return r.Domain.CloneEnvironment(cc, projectName, sourceEnvName, destinationEnvName, displayName, environmentRoutingMode) + return r.Domain.CloneEnvironment(cc, sourceEnvName, destinationEnvName, displayName, environmentRoutingMode) } // CoreCreateImagePullSecret is the resolver for the core_createImagePullSecret field. @@ -103,7 +73,7 @@ func (r *mutationResolver) CoreCreateImagePullSecret(ctx context.Context, projec return nil, errors.NewE(err) } - return r.Domain.CreateImagePullSecret(newResourceContext(cc, projectName, envName), imagePullSecretIn) + return r.Domain.CreateImagePullSecret(newResourceContext(cc, envName), imagePullSecretIn) } // CoreDeleteImagePullSecret is the resolver for the core_deleteImagePullSecret field. @@ -112,7 +82,7 @@ func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, projec if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteImagePullSecret(newResourceContext(cc, projectName, envName), secretName); err != nil { + if err := r.Domain.DeleteImagePullSecret(newResourceContext(cc, envName), secretName); err != nil { return false, errors.NewE(err) } return true, nil @@ -124,7 +94,7 @@ func (r *mutationResolver) CoreCreateApp(ctx context.Context, projectName string if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateApp(newResourceContext(cc, projectName, envName), app) + return r.Domain.CreateApp(newResourceContext(cc, envName), app) } // CoreUpdateApp is the resolver for the core_updateApp field. @@ -133,7 +103,7 @@ func (r *mutationResolver) CoreUpdateApp(ctx context.Context, projectName string if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateApp(newResourceContext(cc, projectName, envName), app) + return r.Domain.UpdateApp(newResourceContext(cc, envName), app) } // CoreDeleteApp is the resolver for the core_deleteApp field. @@ -142,7 +112,7 @@ func (r *mutationResolver) CoreDeleteApp(ctx context.Context, projectName string if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteApp(newResourceContext(cc, projectName, envName), appName); err != nil { + if err := r.Domain.DeleteApp(newResourceContext(cc, envName), appName); err != nil { return false, errors.NewE(err) } return true, nil @@ -154,7 +124,7 @@ func (r *mutationResolver) CoreInterceptApp(ctx context.Context, projectName str if err != nil { return false, errors.NewE(err) } - return r.Domain.InterceptApp(newResourceContext(cc, projectName, envName), appname, deviceName, intercept) + return r.Domain.InterceptApp(newResourceContext(cc, envName), appname, deviceName, intercept) } // CoreCreateConfig is the resolver for the core_createConfig field. @@ -163,7 +133,7 @@ func (r *mutationResolver) CoreCreateConfig(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateConfig(newResourceContext(cc, projectName, envName), config) + return r.Domain.CreateConfig(newResourceContext(cc, envName), config) } // CoreUpdateConfig is the resolver for the core_updateConfig field. @@ -172,7 +142,7 @@ func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateConfig(newResourceContext(cc, projectName, envName), config) + return r.Domain.UpdateConfig(newResourceContext(cc, envName), config) } // CoreDeleteConfig is the resolver for the core_deleteConfig field. @@ -181,7 +151,7 @@ func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, projectName str if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteConfig(newResourceContext(cc, projectName, envName), configName); err != nil { + if err := r.Domain.DeleteConfig(newResourceContext(cc, envName), configName); err != nil { return false, errors.NewE(err) } return true, nil @@ -193,7 +163,7 @@ func (r *mutationResolver) CoreCreateSecret(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateSecret(newResourceContext(cc, projectName, envName), secret) + return r.Domain.CreateSecret(newResourceContext(cc, envName), secret) } // CoreUpdateSecret is the resolver for the core_updateSecret field. @@ -202,7 +172,7 @@ func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateSecret(newResourceContext(cc, projectName, envName), secret) + return r.Domain.UpdateSecret(newResourceContext(cc, envName), secret) } // CoreDeleteSecret is the resolver for the core_deleteSecret field. @@ -211,7 +181,7 @@ func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, projectName str if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteSecret(newResourceContext(cc, projectName, envName), secretName); err != nil { + if err := r.Domain.DeleteSecret(newResourceContext(cc, envName), secretName); err != nil { return false, errors.NewE(err) } return true, nil @@ -223,7 +193,7 @@ func (r *mutationResolver) CoreCreateRouter(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateRouter(newResourceContext(cc, projectName, envName), router) + return r.Domain.CreateRouter(newResourceContext(cc, envName), router) } // CoreUpdateRouter is the resolver for the core_updateRouter field. @@ -232,7 +202,7 @@ func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, projectName str if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateRouter(newResourceContext(cc, projectName, envName), router) + return r.Domain.UpdateRouter(newResourceContext(cc, envName), router) } // CoreDeleteRouter is the resolver for the core_deleteRouter field. @@ -241,7 +211,7 @@ func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, projectName str if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteRouter(newResourceContext(cc, projectName, envName), routerName); err != nil { + if err := r.Domain.DeleteRouter(newResourceContext(cc, envName), routerName); err != nil { return false, errors.NewE(err) } return true, nil @@ -253,7 +223,7 @@ func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, projec if err != nil { return nil, errors.NewE(err) } - return r.Domain.CreateManagedResource(newResourceContext(cc, projectName, envName), mres) + return r.Domain.CreateManagedResource(newResourceContext(cc, envName), mres) } // CoreUpdateManagedResource is the resolver for the core_updateManagedResource field. @@ -262,7 +232,7 @@ func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, projec if err != nil { return nil, errors.NewE(err) } - return r.Domain.UpdateManagedResource(newResourceContext(cc, projectName, envName), mres) + return r.Domain.UpdateManagedResource(newResourceContext(cc, envName), mres) } // CoreDeleteManagedResource is the resolver for the core_deleteManagedResource field. @@ -271,38 +241,7 @@ func (r *mutationResolver) CoreDeleteManagedResource(ctx context.Context, projec if err != nil { return false, errors.NewE(err) } - if err := r.Domain.DeleteManagedResource(newResourceContext(cc, projectName, envName), mresName); err != nil { - return false, errors.NewE(err) - } - return true, nil -} - -// CoreCreateProjectManagedService is the resolver for the core_createProjectManagedService field. -func (r *mutationResolver) CoreCreateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - return r.Domain.CreateProjectManagedService(ictx, projectName, pmsvc) -} - -// CoreUpdateProjectManagedService is the resolver for the core_updateProjectManagedService field. -func (r *mutationResolver) CoreUpdateProjectManagedService(ctx context.Context, projectName string, pmsvc entities.ProjectManagedService) (*entities.ProjectManagedService, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - return r.Domain.UpdateProjectManagedService(ictx, projectName, pmsvc) -} - -// CoreDeleteProjectManagedService is the resolver for the core_deleteProjectManagedService field. -func (r *mutationResolver) CoreDeleteProjectManagedService(ctx context.Context, projectName string, pmsvcName string) (bool, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return false, errors.NewE(err) - } - err = r.Domain.DeleteProjectManagedService(ictx, projectName, pmsvcName) - if err != nil { + if err := r.Domain.DeleteManagedResource(newResourceContext(cc, envName), mresName); err != nil { return false, errors.NewE(err) } return true, nil @@ -344,7 +283,7 @@ func (r *mutationResolver) CoreUpdateVPNDevicePorts(ctx context.Context, deviceN // CoreUpdateVPNDeviceEnv is the resolver for the core_updateVPNDeviceEnv field. func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, projectName string, envName string) (bool, error) { - if projectName == "" && envName == "" { + if envName == "" { return false, fmt.Errorf("projectName and envName cannot be empty") } @@ -353,7 +292,7 @@ func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceNam return false, errors.NewE(err) } - if err := r.Domain.ActivateVpnDeviceOnEnvironment(cc, deviceName, projectName, envName); err != nil { + if err := r.Domain.ActivateVpnDeviceOnEnvironment(cc, deviceName, envName); err != nil { return false, errors.NewE(err) } @@ -408,58 +347,7 @@ func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, projectNa if err != nil { return nil, err } - return r.Domain.CheckNameAvailability(ctx, cc.AccountName, projectName, envName, resType, name) -} - -// CoreListProjects is the resolver for the core_listProjects field. -func (r *queryResolver) CoreListProjects(ctx context.Context, search *model.SearchProjects, pq *repos.CursorPagination) (*model.ProjectPaginatedRecords, error) { - filter := map[string]repos.MatchFilter{} - if search != nil { - if search.Text != nil { - filter["metadata.name"] = *search.Text - } - if search.IsReady != nil { - filter["status.isReady"] = *search.IsReady - } - if search.MarkedForDeletion != nil { - filter["markedForDeletion"] = *search.MarkedForDeletion - } - } - - cc, err := toConsoleContext(ctx) - if err != nil { - // if cc.UserId == "" || cc.AccountName == "" { - // } - return nil, errors.NewE(err) - } - - p, err := r.Domain.ListProjects(ctx, cc.UserId, cc.AccountName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) - if err != nil { - return nil, errors.NewE(err) - } - - return fn.JsonConvertP[model.ProjectPaginatedRecords](p) -} - -// CoreGetProject is the resolver for the core_getProject field. -func (r *queryResolver) CoreGetProject(ctx context.Context, name string) (*entities.Project, error) { - cc, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - return r.Domain.GetProject(cc, name) -} - -// CoreResyncProject is the resolver for the core_resyncProject field. -func (r *queryResolver) CoreResyncProject(ctx context.Context, name string) (bool, error) { - cc, err := toConsoleContext(ctx) - if err != nil { - return false, errors.NewE(err) - } - if err := r.Domain.ResyncProject(cc, name); err != nil { - return false, errors.NewE(err) - } - return true, nil + return r.Domain.CheckNameAvailability(ctx, cc.AccountName, envName, resType, name) } // CoreListEnvironments is the resolver for the core_listEnvironments field. @@ -484,7 +372,7 @@ func (r *queryResolver) CoreListEnvironments(ctx context.Context, projectName st } } - envs, err := r.Domain.ListEnvironments(cc, projectName, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + envs, err := r.Domain.ListEnvironments(cc, filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -499,7 +387,7 @@ func (r *queryResolver) CoreGetEnvironment(ctx context.Context, projectName stri return nil, errors.NewE(err) } - return r.Domain.GetEnvironment(cc, projectName, name) + return r.Domain.GetEnvironment(cc, name) } // CoreResyncEnvironment is the resolver for the core_resyncEnvironment field. @@ -508,7 +396,7 @@ func (r *queryResolver) CoreResyncEnvironment(ctx context.Context, projectName s if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncEnvironment(cc, projectName, name); err != nil { + if err := r.Domain.ResyncEnvironment(cc, name); err != nil { return false, errors.NewE(err) } return true, nil @@ -533,7 +421,7 @@ func (r *queryResolver) CoreListImagePullSecrets(ctx context.Context, projectNam } } - pullSecrets, err := r.Domain.ListImagePullSecrets(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pullSecrets, err := r.Domain.ListImagePullSecrets(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -547,7 +435,7 @@ func (r *queryResolver) CoreGetImagePullSecret(ctx context.Context, projectName if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetImagePullSecret(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetImagePullSecret(newResourceContext(cc, envName), name) } // CoreResyncImagePullSecret is the resolver for the core_resyncImagePullSecret field. @@ -557,7 +445,7 @@ func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, projectNa return false, errors.NewE(err) } - if err := r.Domain.ResyncImagePullSecret(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncImagePullSecret(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } return true, nil @@ -582,7 +470,7 @@ func (r *queryResolver) CoreListApps(ctx context.Context, projectName string, en } } - pApps, err := r.Domain.ListApps(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pApps, err := r.Domain.ListApps(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -596,7 +484,7 @@ func (r *queryResolver) CoreGetApp(ctx context.Context, projectName string, envN if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetApp(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetApp(newResourceContext(cc, envName), name) } // CoreResyncApp is the resolver for the core_resyncApp field. @@ -605,7 +493,7 @@ func (r *queryResolver) CoreResyncApp(ctx context.Context, projectName string, e if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncApp(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncApp(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } return true, nil @@ -617,7 +505,7 @@ func (r *queryResolver) CoreRestartApp(ctx context.Context, projectName string, if err != nil { return false, errors.NewE(err) } - if err := r.Domain.RestartApp(newResourceContext(cc, projectName, envName), appName); err != nil { + if err := r.Domain.RestartApp(newResourceContext(cc, envName), appName); err != nil { return false, err } return true, nil @@ -635,7 +523,7 @@ func (r *queryResolver) CoreGetConfigValues(ctx context.Context, projectName str m[i] = *queries[i] } - return r.Domain.GetConfigEntries(newResourceContext(cc, projectName, envName), m) + return r.Domain.GetConfigEntries(newResourceContext(cc, envName), m) } // CoreListConfigs is the resolver for the core_listConfigs field. @@ -657,7 +545,7 @@ func (r *queryResolver) CoreListConfigs(ctx context.Context, projectName string, } } - pConfigs, err := r.Domain.ListConfigs(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pConfigs, err := r.Domain.ListConfigs(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -672,7 +560,7 @@ func (r *queryResolver) CoreGetConfig(ctx context.Context, projectName string, e return nil, errors.NewE(err) } - return r.Domain.GetConfig(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetConfig(newResourceContext(cc, envName), name) } // CoreResyncConfig is the resolver for the core_resyncConfig field. @@ -681,7 +569,7 @@ func (r *queryResolver) CoreResyncConfig(ctx context.Context, projectName string if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncConfig(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncConfig(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } return true, nil @@ -699,7 +587,7 @@ func (r *queryResolver) CoreGetSecretValues(ctx context.Context, projectName str m[i] = *queries[i] } - return r.Domain.GetSecretEntries(newResourceContext(cc, projectName, envName), m) + return r.Domain.GetSecretEntries(newResourceContext(cc, envName), m) } // CoreListSecrets is the resolver for the core_listSecrets field. @@ -721,7 +609,7 @@ func (r *queryResolver) CoreListSecrets(ctx context.Context, projectName string, } } - pSecrets, err := r.Domain.ListSecrets(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pSecrets, err := r.Domain.ListSecrets(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -735,7 +623,7 @@ func (r *queryResolver) CoreGetSecret(ctx context.Context, projectName string, e if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetSecret(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetSecret(newResourceContext(cc, envName), name) } // CoreResyncSecret is the resolver for the core_resyncSecret field. @@ -744,7 +632,7 @@ func (r *queryResolver) CoreResyncSecret(ctx context.Context, projectName string if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncSecret(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncSecret(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } return true, nil @@ -769,7 +657,7 @@ func (r *queryResolver) CoreListRouters(ctx context.Context, projectName string, } } - pRouters, err := r.Domain.ListRouters(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pRouters, err := r.Domain.ListRouters(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -783,7 +671,7 @@ func (r *queryResolver) CoreGetRouter(ctx context.Context, projectName string, e if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetRouter(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetRouter(newResourceContext(cc, envName), name) } // CoreResyncRouter is the resolver for the core_resyncRouter field. @@ -792,7 +680,7 @@ func (r *queryResolver) CoreResyncRouter(ctx context.Context, projectName string if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncRouter(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncRouter(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } return true, nil @@ -804,7 +692,7 @@ func (r *queryResolver) CoreGetManagedResouceOutputKeys(ctx context.Context, pro if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetManagedResourceOutputKeys(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetManagedResourceOutputKeys(newResourceContext(cc, envName), name) } // CoreGetManagedResouceOutputKeyValues is the resolver for the core_getManagedResouceOutputKeyValues field. @@ -819,7 +707,7 @@ func (r *queryResolver) CoreGetManagedResouceOutputKeyValues(ctx context.Context m[i] = *keyrefs[i] } - return r.Domain.GetManagedResourceOutputKVs(newResourceContext(cc, projectName, envName), m) + return r.Domain.GetManagedResourceOutputKVs(newResourceContext(cc, envName), m) } // CoreListManagedResources is the resolver for the core_listManagedResources field. @@ -845,7 +733,7 @@ func (r *queryResolver) CoreListManagedResources(ctx context.Context, projectNam } } - pmsvcs, err := r.Domain.ListManagedResources(newResourceContext(cc, projectName, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + pmsvcs, err := r.Domain.ListManagedResources(newResourceContext(cc, envName), filter, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) if err != nil { return nil, errors.NewE(err) } @@ -859,7 +747,7 @@ func (r *queryResolver) CoreGetManagedResource(ctx context.Context, projectName if err != nil { return nil, errors.NewE(err) } - return r.Domain.GetManagedResource(newResourceContext(cc, projectName, envName), name) + return r.Domain.GetManagedResource(newResourceContext(cc, envName), name) } // CoreResyncManagedResource is the resolver for the core_resyncManagedResource field. @@ -868,77 +756,9 @@ func (r *queryResolver) CoreResyncManagedResource(ctx context.Context, projectNa if err != nil { return false, errors.NewE(err) } - if err := r.Domain.ResyncManagedResource(newResourceContext(cc, projectName, envName), name); err != nil { - return false, errors.NewE(err) - } - return true, nil -} - -// CoreListProjectManagedServices is the resolver for the core_listProjectManagedServices field. -func (r *queryResolver) CoreListProjectManagedServices(ctx context.Context, projectName string, search *model.SearchProjectManagedService, pq *repos.CursorPagination) (*model.ProjectManagedServicePaginatedRecords, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - - if pq == nil { - pq = &repos.DefaultCursorPagination - } - - filter := map[string]repos.MatchFilter{} - - if search != nil { - if search.IsReady != nil { - filter["status.isReady"] = *search.IsReady - } - - if search.Text != nil { - filter["metadata.name"] = *search.Text - } - } - - pmsvcs, err := r.Domain.ListProjectManagedServices(ictx, projectName, filter, *pq) - if err != nil { - return nil, errors.NewE(err) - } - - return fn.JsonConvertP[model.ProjectManagedServicePaginatedRecords](pmsvcs) -} - -// CoreGetProjectManagedService is the resolver for the core_getProjectManagedService field. -func (r *queryResolver) CoreGetProjectManagedService(ctx context.Context, projectName string, name string) (*entities.ProjectManagedService, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return nil, errors.NewE(err) - } - - return r.Domain.GetProjectManagedService(ictx, projectName, name) -} - -// CoreResyncProjectManagedService is the resolver for the core_resyncProjectManagedService field. -func (r *queryResolver) CoreResyncProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) { - ictx, err := toConsoleContext(ctx) - if err != nil { - return false, errors.NewE(err) - } - - if err := r.Domain.ResyncProjectManagedService(ictx, projectName, name); err != nil { - return false, errors.NewE(err) - } - - return true, nil -} - -// CoreRestartProjectManagedService is the resolver for the core_restartProjectManagedService field. -func (r *queryResolver) CoreRestartProjectManagedService(ctx context.Context, projectName string, name string) (bool, error) { - cc, err := toConsoleContext(ctx) - if err != nil { + if err := r.Domain.ResyncManagedResource(newResourceContext(cc, envName), name); err != nil { return false, errors.NewE(err) } - - if err := r.Domain.RestartProjectManagedService(cc, projectName, name); err != nil { - return false, err - } return true, nil } diff --git a/apps/console/internal/app/graph/struct-to-graphql/app.graphqls b/apps/console/internal/app/graph/struct-to-graphql/app.graphqls index 39eaa62b5..fb76fb29c 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/app.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/app.graphqls @@ -12,7 +12,6 @@ type App @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpec! status: Github__com___kloudlite___operator___pkg___operator__Status diff --git a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls index 10f76a2d2..57032d159 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -105,7 +105,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting @ } type Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec @shareable { - projectName: String! routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRouting targetNamespace: String } @@ -140,12 +139,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate! } -type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec @shareable { - nodeSelector: Map - serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! - tolerations: [K8s__io___api___core___v1__Toleration!] -} - type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate @shareable { apiVersion: String! kind: String! @@ -170,15 +163,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__Probe @shareable { type: String! } -type Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec @shareable { - msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! - targetNamespace: String! -} - -type Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec @shareable { - targetNamespace: String! -} - type Github__com___kloudlite___operator___apis___crds___v1__RateLimit @shareable { connections: Int enabled: Boolean @@ -205,12 +189,6 @@ type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec @shareabl routes: [Github__com___kloudlite___operator___apis___crds___v1__Route!] } -type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @shareable { - apiVersion: String! - kind: String! - spec: Map! -} - type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe @shareable { command: [String!] } @@ -419,7 +397,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingI } input Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpecIn { - projectName: String! routing: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingIn targetNamespace: String } @@ -454,12 +431,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn! } -input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { - nodeSelector: Map - serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! - tolerations: [K8s__io___api___core___v1__TolerationIn!] -} - input Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn { apiVersion: String! kind: String! @@ -484,15 +455,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__ProbeIn { type: String! } -input Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn { - msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! - targetNamespace: String! -} - -input Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn { - targetNamespace: String! -} - input Github__com___kloudlite___operator___apis___crds___v1__RateLimitIn { connections: Int enabled: Boolean @@ -519,12 +481,6 @@ input Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn { routes: [Github__com___kloudlite___operator___apis___crds___v1__RouteIn!] } -input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { - apiVersion: String! - kind: String! - spec: Map! -} - input Github__com___kloudlite___operator___apis___crds___v1__ShellProbeIn { command: [String!] } diff --git a/apps/console/internal/app/graph/struct-to-graphql/config.graphqls b/apps/console/internal/app/graph/struct-to-graphql/config.graphqls index 8f83d8007..b7eb58370 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/config.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/config.graphqls @@ -13,7 +13,6 @@ type Config @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! diff --git a/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls b/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls index c0b47f8fe..01d4c4bb7 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/environment.graphqls @@ -1,6 +1,7 @@ type Environment @shareable { accountName: String! apiVersion: String + clusterName: String! createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! @@ -9,7 +10,6 @@ type Environment @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentSpec status: Github__com___kloudlite___operator___pkg___operator__Status @@ -30,6 +30,7 @@ type EnvironmentPaginatedRecords @shareable { input EnvironmentIn { apiVersion: String + clusterName: String! displayName: String! kind: String metadata: MetadataIn diff --git a/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls b/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls index c173da36b..4f8a2be67 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/imagepullsecret.graphqls @@ -10,7 +10,6 @@ type ImagePullSecret @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! @goField(name: "objectMeta") - projectName: String! recordVersion: Int! registryPassword: String registryURL: String diff --git a/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls b/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls index b18ccc8b7..57a85b5f5 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/managedresource.graphqls @@ -11,7 +11,6 @@ type ManagedResource @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec! status: Github__com___kloudlite___operator___pkg___operator__Status diff --git a/apps/console/internal/app/graph/struct-to-graphql/project.graphqls b/apps/console/internal/app/graph/struct-to-graphql/project.graphqls deleted file mode 100644 index 1de64b7fa..000000000 --- a/apps/console/internal/app/graph/struct-to-graphql/project.graphqls +++ /dev/null @@ -1,39 +0,0 @@ -type Project @shareable { - accountName: String! - apiVersion: String - clusterName: String - createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - creationTime: Date! - displayName: String! - id: ID! - kind: String - lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - markedForDeletion: Boolean - metadata: Metadata @goField(name: "objectMeta") - recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec! - status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! - updateTime: Date! -} - -type ProjectEdge @shareable { - cursor: String! - node: Project! -} - -type ProjectPaginatedRecords @shareable { - edges: [ProjectEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -input ProjectIn { - apiVersion: String - clusterName: String - displayName: String! - kind: String - metadata: MetadataIn - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpecIn! -} - diff --git a/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls b/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls deleted file mode 100644 index b01cbcf40..000000000 --- a/apps/console/internal/app/graph/struct-to-graphql/projectmanagedservice.graphqls +++ /dev/null @@ -1,38 +0,0 @@ -type ProjectManagedService @shareable { - accountName: String! - apiVersion: String - createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - creationTime: Date! - displayName: String! - id: ID! - kind: String - lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! - markedForDeletion: Boolean - metadata: Metadata @goField(name: "objectMeta") - projectName: String! - recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpec - status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! - updateTime: Date! -} - -type ProjectManagedServiceEdge @shareable { - cursor: String! - node: ProjectManagedService! -} - -type ProjectManagedServicePaginatedRecords @shareable { - edges: [ProjectManagedServiceEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - -input ProjectManagedServiceIn { - apiVersion: String - displayName: String! - kind: String - metadata: MetadataIn - spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectManagedServiceSpecIn -} - diff --git a/apps/console/internal/app/graph/struct-to-graphql/router.graphqls b/apps/console/internal/app/graph/struct-to-graphql/router.graphqls index 52758e9fa..53c35bf42 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/router.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/router.graphqls @@ -11,7 +11,6 @@ type Router @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status diff --git a/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls b/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls index 24129b61a..d44905e92 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/secret.graphqls @@ -13,7 +13,6 @@ type Secret @shareable { lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String! recordVersion: Int! stringData: Map syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! diff --git a/apps/console/internal/app/process-error-on-apply.go b/apps/console/internal/app/process-error-on-apply.go index 3919f4562..2b4cf154c 100644 --- a/apps/console/internal/app/process-error-on-apply.go +++ b/apps/console/internal/app/process-error-on-apply.go @@ -30,7 +30,7 @@ func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logger if mapping == nil { return domain.ResourceContext{}, fmt.Errorf("resource mapping could not be found") } - return newResourceContext(ctx, mapping.ProjectName, mapping.EnvironmentName), nil + return newResourceContext(ctx, mapping.EnvironmentName), nil } msgReader := func(msg *msgTypes.ConsumeMsg) error { @@ -74,19 +74,20 @@ func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logger return d.OnVPNDeviceDeleteMessage(dctx, p) } - case projectGVK.String(): - { - if errObj.Action == t.ActionApply { - return d.OnProjectApplyError(dctx, errObj.Error, obj.GetName(), opts) - } - - p, err := fn.JsonConvert[entities.Project](obj.Object) - if err != nil { - return err - } + //case projectGVK.String(): + // { + // if errObj.Action == t.ActionApply { + // return d.OnProjectApplyError(dctx, errObj.Error, obj.GetName(), opts) + // } + // + // p, err := fn.JsonConvert[entities.Project](obj.Object) + // if err != nil { + // return err + // } + // + // return d.OnProjectDeleteMessage(dctx, p) + // } - return d.OnProjectDeleteMessage(dctx, p) - } case environmentGVK.String(): { if errObj.Action == t.ActionApply { @@ -100,27 +101,27 @@ func ProcessErrorOnApply(consumer ErrorOnApplyConsumer, d domain.Domain, logger return d.OnEnvironmentDeleteMessage(dctx, p) } - case projectManagedServiceGVK.String(): - { - mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, errObj.ClusterName, obj.GetNamespace(), obj.GetName()) - if err != nil { - return err - } - if mapping == nil { - return err - } - - if errObj.Action == t.ActionApply { - return d.OnProjectManagedServiceApplyError(dctx, mapping.ProjectName, obj.GetName(), errObj.Error, opts) - } - - pmsvc, err := fn.JsonConvert[entities.ProjectManagedService](obj.Object) - if err != nil { - return err - } - - return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) - } + //case projectManagedServiceGVK.String(): + // { + // mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, errObj.ClusterName, obj.GetNamespace(), obj.GetName()) + // if err != nil { + // return err + // } + // if mapping == nil { + // return err + // } + // + // if errObj.Action == t.ActionApply { + // return d.OnProjectManagedServiceApplyError(dctx, mapping.ProjectName, obj.GetName(), errObj.Error, opts) + // } + // + // pmsvc, err := fn.JsonConvert[entities.ProjectManagedService](obj.Object) + // if err != nil { + // return err + // } + // + // return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) + // } case appsGVK.String(): { diff --git a/apps/console/internal/app/process-resource-updates.go b/apps/console/internal/app/process-resource-updates.go index 28c14e6c6..b73280503 100644 --- a/apps/console/internal/app/process-resource-updates.go +++ b/apps/console/internal/app/process-resource-updates.go @@ -21,16 +21,15 @@ import ( type ResourceUpdateConsumer messaging.Consumer -func newResourceContext(ctx domain.ConsoleContext, projectName string, environmentName string) domain.ResourceContext { +func newResourceContext(ctx domain.ConsoleContext, environmentName string) domain.ResourceContext { return domain.ResourceContext{ ConsoleContext: ctx, - ProjectName: projectName, EnvironmentName: environmentName, } } var ( - projectGVK = fn.GVK("crds.kloudlite.io/v1", "Project") + //projectGVK = fn.GVK("crds.kloudlite.io/v1", "Project") appsGVK = fn.GVK("crds.kloudlite.io/v1", "App") environmentGVK = fn.GVK("crds.kloudlite.io/v1", "Environment") deviceGVK = fn.GVK("wireguard.kloudlite.io/v1", "Device") @@ -53,7 +52,7 @@ func ProcessResourceUpdates(consumer ResourceUpdateConsumer, d domain.Domain, lo return domain.ResourceContext{}, errors.Newf("mapping not found for %s %s/%s", rt, obj.GetNamespace(), obj.GetName()) } - return newResourceContext(ctx, mapping.ProjectName, mapping.EnvironmentName), nil + return newResourceContext(ctx, mapping.EnvironmentName), nil } msgReader := func(msg *msgTypes.ConsumeMsg) error { @@ -146,48 +145,48 @@ func ProcessResourceUpdates(consumer ResourceUpdateConsumer, d domain.Domain, lo return d.OnVPNDeviceUpdateMessage(dctx, dev, resStatus, opts, ru.ClusterName) } - case projectGVK.String(): - { - var p entities.Project - if err := fn.JsonConversion(ru.Object, &p); err != nil { - return errors.NewE(err) - } - - if resStatus == types.ResourceStatusDeleted { - return d.OnProjectDeleteMessage(dctx, p) - } - return d.OnProjectUpdateMessage(dctx, p, resStatus, opts) - } - - case projectManagedServiceGVK.String(): - { - var pmsvc entities.ProjectManagedService - if err := fn.JsonConversion(ru.Object, &pmsvc); err != nil { - return errors.NewE(err) - } - - mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, ru.ClusterName, obj.GetNamespace(), obj.GetName()) - if err != nil { - return err - } - if mapping == nil { - return err - } - - if v, ok := ru.Object[types.KeyProjectManagedSvcSecret]; ok { - s, err := fn.JsonConvertP[corev1.Secret](v) - s.SetManagedFields(nil) - if err != nil { - return err - } - pmsvc.SyncedOutputSecretRef = s - } - - if resStatus == types.ResourceStatusDeleted { - return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) - } - return d.OnProjectManagedServiceUpdateMessage(dctx, mapping.ProjectName, pmsvc, resStatus, opts) - } + //case projectGVK.String(): + // { + // var p entities.Project + // if err := fn.JsonConversion(ru.Object, &p); err != nil { + // return errors.NewE(err) + // } + // + // if resStatus == types.ResourceStatusDeleted { + // return d.OnProjectDeleteMessage(dctx, p) + // } + // return d.OnProjectUpdateMessage(dctx, p, resStatus, opts) + // } + + //case projectManagedServiceGVK.String(): + // { + // var pmsvc entities.ProjectManagedService + // if err := fn.JsonConversion(ru.Object, &pmsvc); err != nil { + // return errors.NewE(err) + // } + // + // mapping, err := d.GetProjectResourceMapping(dctx, entities.ResourceTypeProjectManagedService, ru.ClusterName, obj.GetNamespace(), obj.GetName()) + // if err != nil { + // return err + // } + // if mapping == nil { + // return err + // } + // + // if v, ok := ru.Object[types.KeyProjectManagedSvcSecret]; ok { + // s, err := fn.JsonConvertP[corev1.Secret](v) + // s.SetManagedFields(nil) + // if err != nil { + // return err + // } + // pmsvc.SyncedOutputSecretRef = s + // } + // + // if resStatus == types.ResourceStatusDeleted { + // return d.OnProjectManagedServiceDeleteMessage(dctx, mapping.ProjectName, pmsvc) + // } + // return d.OnProjectManagedServiceUpdateMessage(dctx, mapping.ProjectName, pmsvc, resStatus, opts) + // } case environmentGVK.String(): { diff --git a/apps/console/internal/domain/api.go b/apps/console/internal/domain/api.go index 4d9cab534..618331317 100644 --- a/apps/console/internal/domain/api.go +++ b/apps/console/internal/domain/api.go @@ -42,14 +42,13 @@ func (c ConsoleContext) GetAccountName() string { type ResourceContext struct { ConsoleContext - ProjectName string + //ProjectName string EnvironmentName string } func (r ResourceContext) DBFilters() repos.Filter { return repos.Filter{ fields.AccountName: r.AccountName, - fields.ProjectName: r.ProjectName, fields.EnvironmentName: r.EnvironmentName, } } @@ -114,34 +113,35 @@ type UpdateAndDeleteOpts struct { } type Domain interface { - CheckNameAvailability(ctx context.Context, accountName string, projectName *string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) - - ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) - GetProject(ctx ConsoleContext, name string) (*entities.Project, error) - - CreateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) - UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) - DeleteProject(ctx ConsoleContext, name string) error - - OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error - OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error - OnProjectUpdateMessage(ctx ConsoleContext, cluster entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - - ResyncProject(ctx ConsoleContext, name string) error - - ListEnvironments(ctx ConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) - GetEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) - - CreateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) - CloneEnvironment(ctx ConsoleContext, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) - UpdateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) - DeleteEnvironment(ctx ConsoleContext, projectName string, name string) error + CheckNameAvailability(ctx context.Context, accountName string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) + + // INFO: project have been disabled + // ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) + // GetProject(ctx ConsoleContext, name string) (*entities.Project, error) + // + // CreateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) + // UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) + // DeleteProject(ctx ConsoleContext, name string) error + // + // OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error + // OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error + // OnProjectUpdateMessage(ctx ConsoleContext, cluster entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + + // ResyncProject(ctx ConsoleContext, name string) error + + ListEnvironments(ctx ConsoleContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) + GetEnvironment(ctx ConsoleContext, name string) (*entities.Environment, error) + + CreateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) + CloneEnvironment(ctx ConsoleContext, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) + UpdateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) + DeleteEnvironment(ctx ConsoleContext, name string) error OnEnvironmentApplyError(ctx ConsoleContext, errMsg, namespace, name string, opts UpdateAndDeleteOpts) error OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Environment) error OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Environment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - ResyncEnvironment(ctx ConsoleContext, projectName string, name string) error + ResyncEnvironment(ctx ConsoleContext, name string) error ListApps(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.App], error) GetApp(ctx ResourceContext, name string) (*entities.App, error) @@ -229,20 +229,20 @@ type Domain interface { ResyncImagePullSecret(ctx ResourceContext, name string) error GetEnvironmentResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) - GetProjectResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) - - ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) - GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) - CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) - UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) - DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error + //GetProjectResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) - RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error + //ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) + //GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) + //CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) + //UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) + //DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error - OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error - OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error - OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error - ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error + //RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error + // + //OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error + //OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error + //OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error + //ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error ListVPNDevices(ctx ConsoleContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ConsoleVPNDevice], error) ListVPNDevicesForUser(ctx ConsoleContext) ([]*entities.ConsoleVPNDevice, error) @@ -251,7 +251,7 @@ type Domain interface { UpdateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) DeleteVPNDevice(ctx ConsoleContext, name string) error UpdateVpnDevicePorts(ctx ConsoleContext, devName string, ports []*wgv1.Port) error - ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, projectName string, envName string) error + ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, envName string) error OnVPNDeviceApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error OnVPNDeviceDeleteMessage(ctx ConsoleContext, device entities.ConsoleVPNDevice) error @@ -271,6 +271,6 @@ const ( type ResourceEventPublisher interface { PublishConsoleEvent(ctx ConsoleContext, resourceType entities.ResourceType, name string, update PublishMsg) - PublishProjectResourceEvent(ctx ConsoleContext, projectName string, resourceType entities.ResourceType, name string, update PublishMsg) + PublishEnvironmentResourceEvent(ctx ConsoleContext, envName string, resourceType entities.ResourceType, name string, update PublishMsg) PublishResourceEvent(ctx ResourceContext, resourceType entities.ResourceType, name string, update PublishMsg) } diff --git a/apps/console/internal/domain/app.go b/apps/console/internal/domain/app.go index 69ac74b1f..62313e240 100644 --- a/apps/console/internal/domain/app.go +++ b/apps/console/internal/domain/app.go @@ -47,7 +47,7 @@ func (d *domain) GetApp(ctx ResourceContext, name string) (*entities.App, error) func (d *domain) applyApp(ctx ResourceContext, app *entities.App) error { addTrackingId(&app.App, app.Id) - return d.applyK8sResource(ctx, app.ProjectName, &app.App, app.RecordVersion) + return d.applyK8sResource(ctx, app.EnvironmentName, &app.App, app.RecordVersion) } func (d *domain) CreateApp(ctx ResourceContext, app entities.App) (*entities.App, error) { @@ -55,7 +55,7 @@ func (d *domain) CreateApp(ctx ResourceContext, app entities.App) (*entities.App return nil, errors.NewE(err) } - env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -76,7 +76,6 @@ func (d *domain) CreateApp(ctx ResourceContext, app entities.App) (*entities.App app.LastUpdatedBy = app.CreatedBy app.AccountName = ctx.AccountName - app.ProjectName = ctx.ProjectName app.EnvironmentName = ctx.EnvironmentName app.SyncStatus = t.GenSyncStatus(t.SyncActionApply, app.RecordVersion) @@ -118,7 +117,7 @@ func (d *domain) DeleteApp(ctx ResourceContext, name string) error { return errors.NewE(err) } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, uapp.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, uapp.ProjectName, &uapp.App); err != nil { + if err := d.deleteK8sResource(ctx, uapp.EnvironmentName, &uapp.App); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.appRepo.DeleteById(ctx, uapp.Id) } @@ -239,7 +238,7 @@ func (d *domain) RestartApp(ctx ResourceContext, appName string) error { return err } - if err := d.restartK8sResource(ctx, ctx.ProjectName, app.Namespace, app.GetEnsuredLabels()); err != nil { + if err := d.restartK8sResource(ctx, ctx.EnvironmentName, app.Namespace, app.GetEnsuredLabels()); err != nil { return err } @@ -308,5 +307,5 @@ func (d *domain) ResyncApp(ctx ResourceContext, name string) error { if err != nil { return errors.NewE(err) } - return d.resyncK8sResource(ctx, a.ProjectName, a.SyncStatus.Action, &a.App, a.RecordVersion) + return d.resyncK8sResource(ctx, a.EnvironmentName, a.SyncStatus.Action, &a.App, a.RecordVersion) } diff --git a/apps/console/internal/domain/config.go b/apps/console/internal/domain/config.go index c8b7ab6cf..0a627e859 100644 --- a/apps/console/internal/domain/config.go +++ b/apps/console/internal/domain/config.go @@ -83,7 +83,7 @@ func (d *domain) CreateConfig(ctx ResourceContext, config entities.Config) (*ent config.SetGroupVersionKind(fn.GVK("v1", "ConfigMap")) var err error - config.Namespace, err = d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + config.Namespace, err = d.envTargetNamespace(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, err } @@ -97,7 +97,6 @@ func (d *domain) CreateConfig(ctx ResourceContext, config entities.Config) (*ent config.LastUpdatedBy = config.CreatedBy config.AccountName = ctx.AccountName - config.ProjectName = ctx.ProjectName config.EnvironmentName = ctx.EnvironmentName if config.Annotations == nil { @@ -126,7 +125,7 @@ func (d *domain) createAndApplyConfig(ctx ResourceContext, config *entities.Conf return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, cfg.ProjectName, &cfg.ConfigMap, cfg.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, ctx.EnvironmentName, &cfg.ConfigMap, cfg.RecordVersion); err != nil { return nil, errors.NewE(err) } @@ -159,13 +158,21 @@ func (d *domain) UpdateConfig(ctx ResourceContext, config entities.Config) (*ent d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, upConfig.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, upConfig.ProjectName, &upConfig.ConfigMap, upConfig.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, upConfig.EnvironmentName, &upConfig.ConfigMap, upConfig.RecordVersion); err != nil { return nil, errors.NewE(err) } return upConfig, nil } +func (d *domain) applyConfigToK8s(ctx ResourceContext, config *entities.Config) error { + return d.applyK8sResource(ctx, ctx.EnvironmentName, &config.ConfigMap, config.RecordVersion) +} + +func (d *domain) deleteConfigFromK8s(ctx ResourceContext, config *entities.Config) error { + return d.deleteK8sResource(ctx, ctx.EnvironmentName, &config.ConfigMap) +} + func (d *domain) DeleteConfig(ctx ResourceContext, name string) error { if err := d.canMutateResourcesInEnvironment(ctx); err != nil { return errors.NewE(err) @@ -181,7 +188,7 @@ func (d *domain) DeleteConfig(ctx ResourceContext, name string) error { } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeConfig, uc.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, uc.ProjectName, &uc.ConfigMap); err != nil { + if err := d.deleteConfigFromK8s(ctx, uc); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.configRepo.DeleteById(ctx, uc.Id) } @@ -230,7 +237,7 @@ func (d *domain) OnConfigUpdateMessage(ctx ResourceContext, configIn entities.Co recordVersion, err := d.MatchRecordVersion(configIn.Annotations, xconfig.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xconfig.ProjectName, xconfig.SyncStatus.Action, &xconfig.ConfigMap, xconfig.RecordVersion) + return d.resyncK8sResource(ctx, xconfig.EnvironmentName, xconfig.SyncStatus.Action, &xconfig.ConfigMap, xconfig.RecordVersion) } uc, err := d.configRepo.PatchById(ctx, xconfig.Id, common.PatchForSyncFromAgent(&configIn, recordVersion, status, common.PatchOpts{ @@ -250,5 +257,5 @@ func (d *domain) ResyncConfig(ctx ResourceContext, name string) error { return errors.NewE(err) } - return d.resyncK8sResource(ctx, cfg.ProjectName, cfg.SyncStatus.Action, &cfg.ConfigMap, cfg.RecordVersion) + return d.resyncK8sResource(ctx, cfg.EnvironmentName, cfg.SyncStatus.Action, &cfg.ConfigMap, cfg.RecordVersion) } diff --git a/apps/console/internal/domain/domain.go b/apps/console/internal/domain/domain.go index 6f9ff7cab..b94c03ca7 100644 --- a/apps/console/internal/domain/domain.go +++ b/apps/console/internal/domain/domain.go @@ -46,7 +46,9 @@ type domain struct { iamClient iam.IAMClient infraClient infra.InfraClient - projectRepo repos.DbRepo[*entities.Project] + // projectRepo repos.DbRepo[*entities.Project] + // pmsRepo repos.DbRepo[*entities.ProjectManagedService] + environmentRepo repos.DbRepo[*entities.Environment] vpnDeviceRepo repos.DbRepo[*entities.ConsoleVPNDevice] @@ -62,7 +64,6 @@ type domain struct { resourceEventPublisher ResourceEventPublisher consoleCacheStore kv.BinaryDataRepo resourceMappingRepo repos.DbRepo[*entities.ResourceMapping] - pmsRepo repos.DbRepo[*entities.ProjectManagedService] } func errAlreadyMarkedForDeletion(label, namespace, name string) error { @@ -138,8 +139,8 @@ func (d *domain) applyK8sResourceOnCluster(ctx K8sContext, clusterName string, o return errors.NewE(err) } -func (d *domain) applyK8sResource(ctx K8sContext, projectName string, obj client.Object, recordVersion int) error { - clusterName, err := d.getClusterAttachedToProject(ctx, projectName) +func (d *domain) applyK8sResource(ctx K8sContext, envName string, obj client.Object, recordVersion int) error { + clusterName, err := d.getClusterAttachedToEnvironment(ctx, envName) if err != nil { return errors.NewE(err) } @@ -184,7 +185,7 @@ func (d *domain) applyK8sResource(ctx K8sContext, projectName string, obj client } func (d *domain) restartK8sResource(ctx K8sContext, projectName string, namespace string, labels map[string]string) error { - clusterName, err := d.getClusterAttachedToProject(ctx, projectName) + clusterName, err := d.getClusterAttachedToEnvironment(ctx, projectName) if err != nil { return errors.NewE(err) } @@ -248,8 +249,8 @@ func (d *domain) deleteK8sResourceOfCluster(ctx K8sContext, clusterName string, return errors.NewE(err) } -func (d *domain) deleteK8sResource(ctx K8sContext, projectName string, obj client.Object) error { - clusterName, err := d.getClusterAttachedToProject(ctx, projectName) +func (d *domain) deleteK8sResource(ctx K8sContext, environmentName string, obj client.Object) error { + clusterName, err := d.getClusterAttachedToEnvironment(ctx, environmentName) if err != nil { return errors.NewE(err) } @@ -285,15 +286,15 @@ func (d *domain) deleteK8sResource(ctx K8sContext, projectName string, obj clien return errors.NewE(err) } -func (d *domain) resyncK8sResource(ctx K8sContext, projectName string, action types.SyncAction, obj client.Object, rv int) error { +func (d *domain) resyncK8sResource(ctx K8sContext, environmentName string, action types.SyncAction, obj client.Object, rv int) error { switch action { case types.SyncActionApply: { - return d.applyK8sResource(ctx, projectName, obj, rv) + return d.applyK8sResource(ctx, environmentName, obj, rv) } case types.SyncActionDelete: { - return d.deleteK8sResource(ctx, projectName, obj) + return d.deleteK8sResource(ctx, environmentName, obj) } default: { @@ -399,31 +400,31 @@ func (d *domain) canReadSecretsFromAccount(ctx context.Context, userId string, a return nil } -func (d *domain) checkProjectAccess(ctx ConsoleContext, projectName string, action iamT.Action) error { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, projectName), - }, - Action: string(action), - }) - if err != nil { - return errors.NewE(err) - } - - if !co.Status { - return errors.Newf("unauthorized to access project %q", projectName) - } - return nil -} +//func (d *domain) checkProjectAccess(ctx ConsoleContext, projectName string, action iamT.Action) error { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, projectName), +// }, +// Action: string(action), +// }) +// if err != nil { +// return errors.NewE(err) +// } +// +// if !co.Status { +// return errors.Newf("unauthorized to access project %q", projectName) +// } +// return nil +//} func (d *domain) checkEnvironmentAccess(ctx ResourceContext, action iamT.Action) error { co, err := d.iamClient.Can(ctx, &iam.CanIn{ UserId: string(ctx.UserId), ResourceRefs: []string{ iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, ctx.ProjectName), + //iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, ctx.ProjectName), iamT.NewResourceRef(ctx.AccountName, iamT.ResourceEnvironment, ctx.EnvironmentName), }, Action: string(action), @@ -488,7 +489,7 @@ func cloneResource[T repos.Entity](ctx ResourceContext, d *domain, repoName repo } } - if err := d.applyK8sResource(ctx, ctx.ProjectName, obj, 0); err != nil { + if err := d.applyK8sResource(ctx, ctx.EnvironmentName, obj, 0); err != nil { return errors.NewE(err) } return nil @@ -505,15 +506,16 @@ var Module = fx.Module("domain", iamClient iam.IAMClient, infraClient infra.InfraClient, - projectRepo repos.DbRepo[*entities.Project], + // projectRepo repos.DbRepo[*entities.Project], + // pmsRepo repos.DbRepo[*entities.ProjectManagedService], environmentRepo repos.DbRepo[*entities.Environment], + appRepo repos.DbRepo[*entities.App], configRepo repos.DbRepo[*entities.Config], secretRepo repos.DbRepo[*entities.Secret], routerRepo repos.DbRepo[*entities.Router], mresRepo repos.DbRepo[*entities.ManagedResource], ipsRepo repos.DbRepo[*entities.ImagePullSecret], - pmsRepo repos.DbRepo[*entities.ProjectManagedService], resourceMappingRepo repos.DbRepo[*entities.ResourceMapping], vpnDeviceRepo repos.DbRepo[*entities.ConsoleVPNDevice], @@ -533,7 +535,8 @@ var Module = fx.Module("domain", infraClient: infraClient, logger: logger, - projectRepo: projectRepo, + // projectRepo: projectRepo, + // pmsRepo: pmsRepo, environmentRepo: environmentRepo, appRepo: appRepo, configRepo: configRepo, @@ -548,7 +551,6 @@ var Module = fx.Module("domain", resourceEventPublisher: resourceEventPublisher, consoleCacheStore: consoleCacheStore, - pmsRepo: pmsRepo, } }), ) diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go index 12c1484eb..dc3d5e24d 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -4,6 +4,9 @@ import ( "crypto/md5" "encoding/hex" "fmt" + "strings" + + fn "github.com/kloudlite/api/pkg/functions" "github.com/kloudlite/api/common/fields" crdsv1 "github.com/kloudlite/operator/apis/crds/v1" @@ -24,27 +27,62 @@ import ( t "github.com/kloudlite/api/pkg/types" ) -func (d *domain) findEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) { +func (d *domain) findEnvironment(ctx ConsoleContext, name string) (*entities.Environment, error) { env, err := d.environmentRepo.FindOne(ctx, repos.Filter{ fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, fields.MetadataName: name, }) if err != nil { return nil, errors.NewE(err) } if env == nil { - return nil, errors.Newf("no environment with name (%s) and project (%s)", name, projectName) + return nil, errors.Newf("no environment with name (%s)", name) } return env, nil } -func (d *domain) envTargetNamespace(ctx ConsoleContext, projectName string, envName string) (string, error) { - key := fmt.Sprintf("environment-namespace.%s/%s/%s", ctx.AccountName, projectName, envName) +func (d *domain) getClusterAttachedToEnvironment(ctx K8sContext, name string) (*string, error) { + cacheKey := fmt.Sprintf("account_name_%s-cluster_name_%s", ctx.GetAccountName(), name) + + clusterName, err := d.consoleCacheStore.Get(ctx, cacheKey) + if err != nil && !d.consoleCacheStore.ErrKeyNotFound(err) { + return nil, err + } + + if len(clusterName) == 0 { + env, err := d.environmentRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.GetAccountName(), + fields.MetadataName: name, + }) + if err != nil { + return nil, errors.NewE(err) + } + if env == nil { + return nil, errors.Newf("no cluster attached to this environment") + } + + defer func() { + if err := d.consoleCacheStore.Set(ctx, cacheKey, []byte(env.ClusterName)); err != nil { + d.logger.Infof("failed to set env cluster map: %v", err) + } + }() + + return &env.ClusterName, nil + } + + if clusterName == nil { + return nil, nil + } + + return fn.New(string(clusterName)), nil +} + +func (d *domain) envTargetNamespace(ctx ConsoleContext, envName string) (string, error) { + key := fmt.Sprintf("environment-namespace.%s/%s", ctx.AccountName, envName) b, err := d.consoleCacheStore.Get(ctx, key) if err != nil { if d.consoleCacheStore.ErrKeyNotFound(err) { - env, err := d.findEnvironment(ctx, projectName, envName) + env, err := d.findEnvironment(ctx, envName) if err != nil { return "", err } @@ -60,23 +98,20 @@ func (d *domain) envTargetNamespace(ctx ConsoleContext, projectName string, envN return string(b), nil } -func (d *domain) GetEnvironment(ctx ConsoleContext, projectName string, name string) (*entities.Environment, error) { - if err := d.canReadResourcesInProject(ctx, projectName); err != nil { +func (d *domain) GetEnvironment(ctx ConsoleContext, name string) (*entities.Environment, error) { + if err := d.canPerformActionInAccount(ctx, iamT.GetEnvironment); err != nil { return nil, errors.NewE(err) } - return d.findEnvironment(ctx, projectName, name) + return d.findEnvironment(ctx, name) } -func (d *domain) ListEnvironments(ctx ConsoleContext, projectName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) { - if err := d.canReadResourcesInProject(ctx, projectName); err != nil { +func (d *domain) ListEnvironments(ctx ConsoleContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListEnvironments); err != nil { return nil, errors.NewE(err) } - filter := repos.Filter{ - fields.AccountName: ctx.AccountName, - fc.EnvironmentSpecProjectName: projectName, - } + filter := repos.Filter{fields.AccountName: ctx.AccountName} return d.environmentRepo.FindPaginated(ctx, d.environmentRepo.MergeMatchFilters(filter, search), pq) } @@ -97,19 +132,13 @@ func (d *domain) findEnvironmentByTargetNs(ctx ConsoleContext, targetNs string) return w, nil } -func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) { - project, err := d.findProject(ctx, projectName) - if err != nil { - return nil, errors.NewE(err) - } +func (d *domain) CreateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) { + env.Namespace = "kloudlite-environments" - if err := d.canMutateResourcesInProject(ctx, project.Name); err != nil { - return nil, errors.NewE(err) + if strings.TrimSpace(env.ClusterName) == "" { + return nil, fmt.Errorf("clustername must be set while creating environments") } - env.ProjectName = project.Name - env.Namespace = project.Spec.TargetNamespace - env.EnsureGVK() if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { return nil, errors.NewE(err) @@ -118,7 +147,7 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env e env.IncrementRecordVersion() if env.Spec.TargetNamespace == "" { - env.Spec.TargetNamespace = d.getEnvironmentTargetNamespace(projectName, env.Name) + env.Spec.TargetNamespace = d.getEnvironmentTargetNamespace(env.Name) } if env.Spec.Routing == nil { @@ -137,10 +166,6 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env e env.AccountName = ctx.AccountName env.SyncStatus = t.GenSyncStatus(t.SyncActionApply, env.RecordVersion) - if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, ProjectName: env.ProjectName, EnvironmentName: env.Name}, &env); err != nil { - return nil, errors.NewE(err) - } - nenv, err := d.environmentRepo.Create(ctx, &env) if err != nil { if d.environmentRepo.ErrAlreadyExists(err) { @@ -150,7 +175,11 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env e return nil, errors.NewE(err) } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, nenv.ProjectName, entities.ResourceTypeEnvironment, nenv.Name, PublishAdd) + if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, EnvironmentName: env.Name}, &env); err != nil { + return nil, errors.NewE(err) + } + + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, nenv.Name, entities.ResourceTypeEnvironment, nenv.Name, PublishAdd) if _, err := d.iamClient.AddMembership(ctx, &iam.AddMembershipIn{ UserId: string(ctx.UserId), @@ -165,25 +194,25 @@ func (d *domain) CreateEnvironment(ctx ConsoleContext, projectName string, env e return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, nenv.ProjectName, &nenv.Environment, nenv.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, nenv.Name, &nenv.Environment, nenv.RecordVersion); err != nil { return nil, errors.NewE(err) } - if err := d.syncAccountLevelImagePullSecrets(ctx, nenv.ProjectName, nenv.Spec.TargetNamespace); err != nil { + if err := d.syncAccountLevelImagePullSecrets(ctx, nenv.Name, nenv.Spec.TargetNamespace); err != nil { return nil, errors.NewE(err) } return nenv, nil } -func (d *domain) syncAccountLevelImagePullSecrets(ctx ConsoleContext, projectName string, envTargetNamespace string) error { +func (d *domain) syncAccountLevelImagePullSecrets(ctx ConsoleContext, envName string, envTargetNamespace string) error { secrets, err := d.k8sClient.ListSecrets(ctx, constants.GetAccountTargetNamespace(ctx.AccountName), corev1.SecretTypeDockerConfigJson) if err != nil { return err } for i := range secrets { - if err := d.applyK8sResource(ctx, projectName, &corev1.Secret{ + if err := d.applyK8sResource(ctx, envName, &corev1.Secret{ TypeMeta: metav1.TypeMeta{ Kind: "Secret", APIVersion: "v1", @@ -203,12 +232,12 @@ func (d *domain) syncAccountLevelImagePullSecrets(ctx ConsoleContext, projectNam return nil } -func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, sourceEnvName string, destinationEnvName string, displayName string, envRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +func (d *domain) CloneEnvironment(ctx ConsoleContext, sourceEnvName string, destinationEnvName string, displayName string, envRoutingMode crdsv1.EnvironmentRoutingMode) (*entities.Environment, error) { + if err := d.canPerformActionInAccount(ctx, iamT.CloneEnvironment); err != nil { return nil, errors.NewE(err) } - sourceEnv, err := d.findEnvironment(ctx, projectName, sourceEnvName) + sourceEnv, err := d.findEnvironment(ctx, sourceEnvName) if err != nil { return nil, errors.NewE(err) } @@ -221,15 +250,13 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source Namespace: sourceEnv.Namespace, }, Spec: crdsv1.EnvironmentSpec{ - ProjectName: projectName, - TargetNamespace: d.getEnvironmentTargetNamespace(projectName, destinationEnvName), + TargetNamespace: d.getEnvironmentTargetNamespace(destinationEnvName), Routing: &crdsv1.EnvironmentRouting{ Mode: envRoutingMode, }, }, }, AccountName: ctx.AccountName, - ProjectName: projectName, ResourceMetadata: common.ResourceMetadata{ DisplayName: displayName, CreatedBy: common.CreatedOrUpdatedBy{ @@ -264,11 +291,11 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source return nil, errors.NewE(err) } - if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, ProjectName: sourceEnv.ProjectName, EnvironmentName: sourceEnv.Name}, sourceEnv); err != nil { + if _, err := d.upsertEnvironmentResourceMapping(ResourceContext{ConsoleContext: ctx, EnvironmentName: sourceEnv.Name}, sourceEnv); err != nil { return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, sourceEnv.ProjectName, &corev1.Namespace{ + if err := d.applyK8sResource(ctx, sourceEnv.Name, &corev1.Namespace{ TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, ObjectMeta: metav1.ObjectMeta{ Name: destEnv.Spec.TargetNamespace, @@ -277,23 +304,21 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source return nil, errors.NewE(err) } - if err := d.syncAccountLevelImagePullSecrets(ctx, destEnv.ProjectName, destEnv.Spec.TargetNamespace); err != nil { + if err := d.syncAccountLevelImagePullSecrets(ctx, destEnv.Name, destEnv.Spec.TargetNamespace); err != nil { return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, sourceEnv.ProjectName, &destEnv.Environment, destEnv.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, sourceEnv.Name, &destEnv.Environment, destEnv.RecordVersion); err != nil { return nil, errors.NewE(err) } resCtx := ResourceContext{ ConsoleContext: ctx, - ProjectName: sourceEnv.ProjectName, EnvironmentName: destEnv.Name, } filters := repos.Filter{ fields.AccountName: resCtx.AccountName, - fields.ProjectName: resCtx.ProjectName, fields.EnvironmentName: sourceEnvName, } @@ -363,7 +388,6 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source Spec: apps[i].Spec, }, AccountName: ctx.AccountName, - ProjectName: projectName, EnvironmentName: destEnv.Name, ResourceMetadata: resourceMetadata(apps[i].DisplayName), SyncStatus: t.GenSyncStatus(t.SyncActionApply, 0), @@ -383,7 +407,6 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source Type: secrets[i].Type, }, AccountName: ctx.AccountName, - ProjectName: projectName, EnvironmentName: destEnv.Name, ResourceMetadata: resourceMetadata(secrets[i].DisplayName), }); err != nil { @@ -401,7 +424,6 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source BinaryData: configs[i].BinaryData, }, AccountName: ctx.AccountName, - ProjectName: projectName, EnvironmentName: destEnv.Name, ResourceMetadata: resourceMetadata(configs[i].DisplayName), }); err != nil { @@ -418,7 +440,6 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source Enabled: routers[i].Enabled, }, AccountName: ctx.AccountName, - ProjectName: projectName, EnvironmentName: destEnv.Name, ResourceMetadata: resourceMetadata(routers[i].DisplayName), }); err != nil { @@ -436,7 +457,6 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source Enabled: managedResources[i].Enabled, }, AccountName: ctx.AccountName, - ProjectName: projectName, EnvironmentName: destEnv.Name, ResourceMetadata: resourceMetadata(managedResources[i].DisplayName), }); err != nil { @@ -447,18 +467,18 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, projectName string, source return destEnv, nil } -func (d *domain) getEnvironmentTargetNamespace(projectName string, envName string) string { - envNamespace := fmt.Sprintf("env-%s-%s", projectName, envName) +func (d *domain) getEnvironmentTargetNamespace(envName string) string { + envNamespace := fmt.Sprintf("env-%s", envName) hash := md5.Sum([]byte(envNamespace)) return fmt.Sprintf("env-%s", hex.EncodeToString(hash[:])) } -func (d *domain) UpdateEnvironment(ctx ConsoleContext, projectName string, env entities.Environment) (*entities.Environment, error) { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +func (d *domain) UpdateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) { + if err := d.canPerformActionInAccount(ctx, iamT.UpdateEnvironment); err != nil { return nil, errors.NewE(err) } - env.Namespace = "trest" + env.Namespace = "non-empty-namespace" env.EnsureGVK() if err := d.k8sClient.ValidateObject(ctx, &env.Environment); err != nil { @@ -480,43 +500,34 @@ func (d *domain) UpdateEnvironment(ctx ConsoleContext, projectName string, env e repos.Filter{ fields.AccountName: ctx.AccountName, fields.MetadataName: env.Name, - fields.ProjectName: projectName, }, patchForUpdate, ) if err != nil { return nil, errors.NewE(err) } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, upEnv.ProjectName, entities.ResourceTypeEnvironment, upEnv.Name, PublishUpdate) + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, upEnv.Name, entities.ResourceTypeEnvironment, upEnv.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, upEnv.ProjectName, &upEnv.Environment, upEnv.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, upEnv.Name, &upEnv.Environment, upEnv.RecordVersion); err != nil { return nil, errors.NewE(err) } return upEnv, nil } -func (d *domain) DeleteEnvironment(ctx ConsoleContext, projectName string, name string) error { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +func (d *domain) DeleteEnvironment(ctx ConsoleContext, name string) error { + if err := d.canPerformActionInAccount(ctx, iamT.DeleteEnvironment); err != nil { return errors.NewE(err) } - uenv, err := d.environmentRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ProjectName: projectName, - fields.MetadataName: name, - }, - common.PatchForMarkDeletion(), - ) + uenv, err := d.environmentRepo.Patch(ctx, entities.EnvironmentDBFilter(ctx.AccountName, name), common.PatchForMarkDeletion()) if err != nil { return errors.NewE(err) } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, uenv.ProjectName, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, uenv.Name, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, uenv.ProjectName, &uenv.Environment); err != nil { + if err := d.deleteK8sResource(ctx, uenv.Name, &uenv.Environment); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.environmentRepo.DeleteById(ctx, uenv.Id) } @@ -545,7 +556,7 @@ func (d *domain) OnEnvironmentApplyError(ctx ConsoleContext, errMsg, namespace, return errors.NewE(err) } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, uenv.ProjectName, entities.ResourceTypeEnvironment, uenv.Name, PublishDelete) + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, uenv.Name, entities.ResourceTypeEnvironment, uenv.Name, PublishDelete) return errors.NewE(err) } @@ -556,7 +567,6 @@ func (d *domain) OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Env repos.Filter{ fields.AccountName: ctx.AccountName, fields.MetadataName: env.Name, - fields.ProjectName: env.Spec.ProjectName, }, ) if err != nil { @@ -569,12 +579,12 @@ func (d *domain) OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Env return errors.NewE(err) } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, env.ProjectName, entities.ResourceTypeEnvironment, env.Name, PublishDelete) + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, env.Name, entities.ResourceTypeEnvironment, env.Name, PublishDelete) return nil } func (d *domain) OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Environment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { - xenv, err := d.findEnvironment(ctx, env.Spec.ProjectName, env.Name) + xenv, err := d.findEnvironment(ctx, env.Name) if err != nil { return errors.NewE(err) } @@ -585,7 +595,7 @@ func (d *domain) OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Env recordVersion, err := d.MatchRecordVersion(env.Annotations, xenv.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xenv.ProjectName, xenv.SyncStatus.Action, &xenv.Environment, xenv.RecordVersion) + return d.resyncK8sResource(ctx, xenv.Name, xenv.SyncStatus.Action, &xenv.Environment, xenv.RecordVersion) } uenv, err := d.environmentRepo.PatchById( @@ -602,12 +612,12 @@ func (d *domain) OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Env return err } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, uenv.ProjectName, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) + d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, uenv.Name, entities.ResourceTypeEnvironment, uenv.Name, PublishUpdate) return nil } func (d *domain) applyEnvironmentTargetNamespace(ctx ConsoleContext, env *entities.Environment) error { - if err := d.applyK8sResource(ctx, env.ProjectName, &corev1.Namespace{ + if err := d.applyK8sResource(ctx, env.Name, &corev1.Namespace{ TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, ObjectMeta: metav1.ObjectMeta{ Name: env.Spec.TargetNamespace, @@ -622,17 +632,17 @@ func (d *domain) applyEnvironmentTargetNamespace(ctx ConsoleContext, env *entiti return nil } -func (d *domain) ResyncEnvironment(ctx ConsoleContext, projectName string, name string) error { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +func (d *domain) ResyncEnvironment(ctx ConsoleContext, name string) error { + if err := d.canPerformActionInAccount(ctx, iamT.CreateEnvironment); err != nil { return errors.NewE(err) } - e, err := d.findEnvironment(ctx, projectName, name) + e, err := d.findEnvironment(ctx, name) if err != nil { return errors.NewE(err) } - if err := d.resyncK8sResource(ctx, e.ProjectName, t.SyncActionApply, &corev1.Namespace{ + if err := d.resyncK8sResource(ctx, e.Name, t.SyncActionApply, &corev1.Namespace{ TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, ObjectMeta: metav1.ObjectMeta{ Name: e.Spec.TargetNamespace, @@ -644,5 +654,5 @@ func (d *domain) ResyncEnvironment(ctx ConsoleContext, projectName string, name return errors.NewE(err) } - return d.resyncK8sResource(ctx, e.ProjectName, e.SyncStatus.Action, &e.Environment, e.RecordVersion) + return d.resyncK8sResource(ctx, e.Name, e.SyncStatus.Action, &e.Environment, e.RecordVersion) } diff --git a/apps/console/internal/domain/image-pull-secret.go b/apps/console/internal/domain/image-pull-secret.go index 4689fd0f1..4fbcbe8ae 100644 --- a/apps/console/internal/domain/image-pull-secret.go +++ b/apps/console/internal/domain/image-pull-secret.go @@ -102,7 +102,7 @@ func (d *domain) CreateImagePullSecret(ctx ResourceContext, ips entities.ImagePu return nil, errors.NewE(err) } - env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -119,7 +119,6 @@ func (d *domain) CreateImagePullSecret(ctx ResourceContext, ips entities.ImagePu ips.LastUpdatedBy = ips.CreatedBy ips.AccountName = ctx.AccountName - ips.ProjectName = ctx.ProjectName ips.EnvironmentName = ctx.EnvironmentName ips.SyncStatus = t.GenSyncStatus(t.SyncActionApply, ips.RecordVersion) @@ -144,7 +143,7 @@ func (d *domain) CreateImagePullSecret(ctx ResourceContext, ips entities.ImagePu d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, nips.Name, PublishAdd) - if err := d.applyK8sResource(ctx, nips.ProjectName, &pullSecret, nips.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, nips.EnvironmentName, &pullSecret, nips.RecordVersion); err != nil { return nil, errors.NewE(err) } @@ -198,7 +197,7 @@ func (d *domain) UpdateImagePullSecret(ctx ResourceContext, ips entities.ImagePu } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeImagePullSecret, upIps.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, upIps.ProjectName, &pullSecret, upIps.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, upIps.EnvironmentName, &pullSecret, upIps.RecordVersion); err != nil { return nil, errors.NewE(err) } @@ -221,7 +220,7 @@ func (d *domain) DeleteImagePullSecret(ctx ResourceContext, name string) error { d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeApp, uips.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, uips.ProjectName, &corev1.Secret{ + if err := d.deleteK8sResource(ctx, "", &corev1.Secret{ TypeMeta: v1.TypeMeta{APIVersion: "v1", Kind: "Secret"}, ObjectMeta: v1.ObjectMeta{Name: uips.Name, Namespace: uips.Namespace}, }); err != nil { @@ -245,7 +244,7 @@ func (d *domain) OnImagePullSecretUpdateMessage(ctx ResourceContext, ips entitie recordVersion, err := d.MatchRecordVersion(ips.Annotations, xips.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xips.ProjectName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) + return d.resyncK8sResource(ctx, xips.EnvironmentName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) } uips, err := d.pullSecretsRepo.PatchById( @@ -301,5 +300,5 @@ func (d *domain) ResyncImagePullSecret(ctx ResourceContext, name string) error { if err != nil { return errors.NewE(err) } - return d.resyncK8sResource(ctx, xips.ProjectName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) + return d.resyncK8sResource(ctx, xips.EnvironmentName, xips.SyncStatus.Action, &xips.GeneratedK8sSecret, xips.RecordVersion) } diff --git a/apps/console/internal/domain/mres.go b/apps/console/internal/domain/mres.go index cd0332506..416fe71c3 100644 --- a/apps/console/internal/domain/mres.go +++ b/apps/console/internal/domain/mres.go @@ -130,7 +130,7 @@ func (d *domain) CreateManagedResource(ctx ResourceContext, mres entities.Manage return nil, errors.New(".spec.resourceTemplate.apiVersion, and .spec.resourceTemplate.kind must be set") } - env, err := d.findEnvironment(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + env, err := d.findEnvironment(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -152,7 +152,6 @@ func (d *domain) CreateManagedResource(ctx ResourceContext, mres entities.Manage mres.LastUpdatedBy = mres.CreatedBy mres.AccountName = ctx.AccountName - mres.ProjectName = ctx.ProjectName mres.EnvironmentName = ctx.EnvironmentName return d.createAndApplyManagedResource(ctx, &mres) @@ -185,7 +184,7 @@ func (d *domain) createAndApplyManagedResource(ctx ResourceContext, mres *entiti d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, m.Name, PublishAdd) - if err := d.applyK8sResource(ctx, ctx.ProjectName, &m.ManagedResource, m.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, ctx.EnvironmentName, &m.ManagedResource, m.RecordVersion); err != nil { return m, errors.NewE(err) } @@ -222,7 +221,7 @@ func (d *domain) UpdateManagedResource(ctx ResourceContext, mres entities.Manage d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, upMres.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, ctx.ProjectName, &upMres.ManagedResource, upMres.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, ctx.EnvironmentName, &upMres.ManagedResource, upMres.RecordVersion); err != nil { return upMres, errors.NewE(err) } @@ -243,7 +242,7 @@ func (d *domain) DeleteManagedResource(ctx ResourceContext, name string) error { return errors.NewE(err) } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeManagedResource, umres.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, umres.ProjectName, &umres.ManagedResource); err != nil { + if err := d.deleteK8sResource(ctx, "", &umres.ManagedResource); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.mresRepo.DeleteById(ctx, umres.Id) } @@ -276,7 +275,7 @@ func (d *domain) OnManagedResourceUpdateMessage(ctx ResourceContext, mres entiti recordVersion, err := d.MatchRecordVersion(mres.Annotations, xmres.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xmres.ProjectName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) + return d.resyncK8sResource(ctx, xmres.EnvironmentName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) } umres, err := d.mresRepo.PatchById( @@ -311,14 +310,12 @@ func (d *domain) OnManagedResourceUpdateMessage(ctx ResourceContext, mres entiti if _, err = d.secretRepo.Upsert(ctx, repos.Filter{ fc.AccountName: ctx.AccountName, - fc.ProjectName: ctx.ProjectName, fc.EnvironmentName: ctx.EnvironmentName, fc.MetadataName: mres.SyncedOutputSecretRef.GetName(), fc.MetadataNamespace: mres.SyncedOutputSecretRef.GetNamespace(), }, &entities.Secret{ Secret: *mres.SyncedOutputSecretRef, AccountName: ctx.AccountName, - ProjectName: ctx.ProjectName, EnvironmentName: ctx.EnvironmentName, ResourceMetadata: common.ResourceMetadata{ DisplayName: umres.GetName(), @@ -368,5 +365,5 @@ func (d *domain) ResyncManagedResource(ctx ResourceContext, name string) error { if err != nil { return errors.NewE(err) } - return d.resyncK8sResource(ctx, mres.ProjectName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) + return d.resyncK8sResource(ctx, mres.EnvironmentName, mres.SyncStatus.Action, &mres.ManagedResource, mres.RecordVersion) } diff --git a/apps/console/internal/domain/names.go b/apps/console/internal/domain/names.go index 1a4c136dd..9c026686e 100644 --- a/apps/console/internal/domain/names.go +++ b/apps/console/internal/domain/names.go @@ -27,15 +27,11 @@ func checkResourceName[T repos.Entity](ctx context.Context, filters repos.Filter }, nil } -func (d *domain) CheckNameAvailability(ctx context.Context, accountName string, projectName *string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) { +func (d *domain) CheckNameAvailability(ctx context.Context, accountName string, environmentName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) { errEnvironmentRequired := func() error { return errors.Newf("param environmentName is required for resource type %q", resType) } - errProjectRequired := func() error { - return errors.Newf("param projectName is required for resource type %q", resType) - } - if !fn.IsValidK8sResourceName(name) { return &CheckNameAvailabilityOutput{ Result: false, @@ -50,39 +46,31 @@ func (d *domain) CheckNameAvailability(ctx context.Context, accountName string, return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.vpnDeviceRepo) } - case entities.ResourceTypeProject: - { - return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.projectRepo) - } - - case entities.ResourceTypeProjectManagedService: - { - if projectName == nil { - return nil, errProjectRequired() - } - return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.ProjectName: projectName, fields.MetadataName: name}, d.pmsRepo) - } - + //case entities.ResourceTypeProject: + // { + // return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.projectRepo) + // } + + //case entities.ResourceTypeProjectManagedService: + // { + // if projectName == nil { + // return nil, errProjectRequired() + // } + // return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.ProjectName: projectName, fields.MetadataName: name}, d.pmsRepo) + // } + // case entities.ResourceTypeEnvironment: { - if projectName == nil { - return nil, errProjectRequired() - } - return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.ProjectName: projectName, fields.MetadataName: name}, d.environmentRepo) + return checkResourceName(ctx, repos.Filter{fields.AccountName: accountName, fields.MetadataName: name}, d.environmentRepo) } default: { - if projectName == nil { - return nil, errProjectRequired() - } - if environmentName == nil { return nil, errEnvironmentRequired() } filter := repos.Filter{ fields.AccountName: accountName, - fields.ProjectName: projectName, fields.EnvironmentName: environmentName, fields.MetadataName: name, } diff --git a/apps/console/internal/domain/project-managed-service.go b/apps/console/internal/domain/project-managed-service.go index d6f29cd97..5293a300b 100644 --- a/apps/console/internal/domain/project-managed-service.go +++ b/apps/console/internal/domain/project-managed-service.go @@ -1,318 +1,318 @@ package domain -import ( - "crypto/md5" - "encoding/hex" - "fmt" - - "github.com/kloudlite/api/apps/console/internal/entities" - "github.com/kloudlite/api/common/fields" - - fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/pkg/errors" - "github.com/kloudlite/api/pkg/repos" - t "github.com/kloudlite/api/pkg/types" - "github.com/kloudlite/operator/operators/resource-watcher/types" -) - -func (d *domain) ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) { - if err := d.canReadResourcesInProject(ctx, projectName); err != nil { - return nil, errors.NewE(err) - } - - f := repos.Filter{ - fields.ProjectName: projectName, - fields.AccountName: ctx.AccountName, - } - - pr, err := d.pmsRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(f, mf), pagination) - if err != nil { - return nil, errors.NewE(err) - } - - return pr, nil -} - -func (d *domain) findProjectManagedService(ctx ConsoleContext, projectName string, svcName string) (*entities.ProjectManagedService, error) { - pmsvc, err := d.pmsRepo.FindOne(ctx, repos.Filter{ - fields.ProjectName: projectName, - fields.AccountName: ctx.AccountName, - fields.MetadataName: svcName, - }) - if err != nil { - return nil, errors.NewE(err) - } - - if pmsvc == nil { - return nil, errors.Newf("pmsvc with name %q not found", projectName) - } - return pmsvc, nil -} - -func (d *domain) GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) { - if err := d.canReadResourcesInProject(ctx, projectName); err != nil { - return nil, errors.NewE(err) - } - - c, err := d.findProjectManagedService(ctx, projectName, serviceName) - if err != nil { - return nil, errors.NewE(err) - } - - return c, nil -} - -func (d *domain) applyProjectManagedService(ctx ConsoleContext, pmsvc *entities.ProjectManagedService) error { - addTrackingId(&pmsvc.ProjectManagedService, pmsvc.Id) - return d.applyK8sResource(ctx, pmsvc.ProjectName, &pmsvc.ProjectManagedService, pmsvc.RecordVersion) -} - -func (d *domain) CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { - return nil, errors.NewE(err) - } - - service.Namespace = d.getProjectTargetNamespace(projectName) - service.IncrementRecordVersion() - - if service.Spec.TargetNamespace == "" { - service.Spec.TargetNamespace = d.getPMSTargetNamespace(projectName, service.Name, entities.ResourceTypeProjectManagedService) - } - - service.CreatedBy = common.CreatedOrUpdatedBy{ - UserId: ctx.UserId, - UserName: ctx.UserName, - UserEmail: ctx.UserEmail, - } - - service.LastUpdatedBy = service.CreatedBy - - existing, err := d.pmsRepo.FindOne(ctx, repos.Filter{ - fields.ProjectName: projectName, - fields.AccountName: ctx.AccountName, - fields.MetadataName: service.Name, - }) - if err != nil { - return nil, errors.NewE(err) - } - - if existing != nil { - return nil, errors.Newf("project managed service with name %q already exists", projectName) - } - - service.AccountName = ctx.AccountName - service.ProjectName = projectName - service.SyncStatus = t.GenSyncStatus(t.SyncActionApply, service.RecordVersion) - - service.EnsureGVK() - - if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { - return nil, errors.NewE(err) - } - - pms, err := d.pmsRepo.Create(ctx, &service) - if err != nil { - return nil, errors.NewE(err) - } - - if _, err := d.upsertProjectResourceMapping(ctx, projectName, pms); err != nil { - return nil, errors.NewE(err) - } - - if err := d.applyProjectManagedService(ctx, pms); err != nil { - return nil, errors.NewE(err) - } - - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, pms.ProjectName, entities.ResourceTypeProjectManagedService, pms.Name, PublishAdd) - - return pms, nil -} - -func (d *domain) getPMSTargetNamespace(projectName string, msvcName string, msvcType entities.ResourceType) string { - msvcNamespace := fmt.Sprintf("pmsvc-%s-%s-%s", projectName, msvcName, msvcType) - hash := md5.Sum([]byte(msvcNamespace)) - return fmt.Sprintf("pmsvc-%s", hex.EncodeToString(hash[:])) -} - -func (d *domain) UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { - return nil, errors.NewE(err) - } - - pmsvc, err := d.findProjectManagedService(ctx, projectName, service.Name) - if err != nil { - return nil, errors.NewE(err) - } - - if pmsvc == nil { - return nil, errors.Newf("no project manage service found") - } - - service.Namespace = "trest" // this is just to make it pass validation - service.EnsureGVK() - if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { - return nil, errors.NewE(err) - } - - if pmsvc.IsMarkedForDeletion() { - return nil, errors.Newf("cluster managed service %q (projectName=%q) is marked for deletion", service.Name, projectName) - } - - patchForUpdate := common.PatchForUpdate( - ctx, - &service, - common.PatchOpts{ - XPatch: repos.Document{ - fc.ProjectManagedServiceSpecMsvcSpecServiceTemplateSpec: service.Spec.MSVCSpec.ServiceTemplate.Spec, - }, - }) - - upmsvc, err := d.pmsRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: service.Name, - }, - patchForUpdate, - ) - if err != nil { - return nil, errors.NewE(err) - } - - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, service.Name, PublishUpdate) - - if err := d.applyProjectManagedService(ctx, upmsvc); err != nil { - return nil, errors.NewE(err) - } - - return upmsvc, nil -} - -func (d *domain) DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { - return errors.NewE(err) - } - - upmsvc, err := d.pmsRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }, - common.PatchForMarkDeletion(), - ) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, name, PublishUpdate) - - return d.deleteK8sResource(ctx, projectName, &upmsvc.ProjectManagedService) -} - -// RestartProjectManagedService implements Domain. -func (d *domain) RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { - return errors.NewE(err) - } - - pms, err := d.findProjectManagedService(ctx, projectName, name) - if err != nil { - return errors.NewE(err) - } - - if err := d.restartK8sResource(ctx, projectName, pms.Spec.TargetNamespace, pms.GetEnsuredLabels()); err != nil { - return err - } - - return nil -} - -func (d *domain) OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error { - upmsvc, err := d.pmsRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }, - common.PatchForErrorFromAgent( - errMsg, - common.PatchOpts{ - MessageTimestamp: opts.MessageTimestamp, - }, - ), - ) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishDelete) - - return errors.NewE(err) -} - -func (d *domain) OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error { - err := d.pmsRepo.DeleteOne( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: service.Name, - }, - ) - if err != nil { - return errors.NewE(err) - } - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, projectName, entities.ResourceTypeProjectManagedService, service.Name, PublishDelete) - return nil -} - -func (d *domain) OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { - svc, err := d.findProjectManagedService(ctx, projectName, service.Name) - if err != nil { - return errors.NewE(err) - } - - if svc == nil { - return errors.Newf("no project manage service found") - } - - recordVersion, err := d.MatchRecordVersion(service.Annotations, svc.RecordVersion) - if err != nil { - return d.ResyncProjectManagedService(ctx, service.ProjectName, service.Name) - } - - upmsvc, err := d.pmsRepo.PatchById( - ctx, - svc.Id, - common.PatchForSyncFromAgent( - &service, - recordVersion, - status, - common.PatchOpts{ - MessageTimestamp: opts.MessageTimestamp, - XPatch: repos.Document{ - fc.ProjectManagedServiceSyncedOutputSecretRef: service.SyncedOutputSecretRef, - }, - })) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishProjectResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishUpdate) - - return nil -} - -func (d *domain) ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error { - if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { - return errors.NewE(err) - } - - a, err := d.findProjectManagedService(ctx, projectName, name) - if err != nil { - return errors.NewE(err) - } - - return d.resyncK8sResource(ctx, a.ProjectName, a.SyncStatus.Action, &a.ProjectManagedService, a.RecordVersion) -} +//import ( +// "crypto/md5" +// "encoding/hex" +// "fmt" +// +// "github.com/kloudlite/api/apps/console/internal/entities" +// "github.com/kloudlite/api/common/fields" +// +// fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" +// "github.com/kloudlite/api/common" +// "github.com/kloudlite/api/pkg/errors" +// "github.com/kloudlite/api/pkg/repos" +// t "github.com/kloudlite/api/pkg/types" +// "github.com/kloudlite/operator/operators/resource-watcher/types" +//) +// +//func (d *domain) ListProjectManagedServices(ctx ConsoleContext, projectName string, mf map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ProjectManagedService], error) { +// if err := d.canReadResourcesInProject(ctx, projectName); err != nil { +// return nil, errors.NewE(err) +// } +// +// f := repos.Filter{ +// fields.ProjectName: projectName, +// fields.AccountName: ctx.AccountName, +// } +// +// pr, err := d.pmsRepo.FindPaginated(ctx, d.secretRepo.MergeMatchFilters(f, mf), pagination) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// return pr, nil +//} +// +//func (d *domain) findProjectManagedService(ctx ConsoleContext, projectName string, svcName string) (*entities.ProjectManagedService, error) { +// pmsvc, err := d.pmsRepo.FindOne(ctx, repos.Filter{ +// fields.ProjectName: projectName, +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: svcName, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if pmsvc == nil { +// return nil, errors.Newf("pmsvc with name %q not found", projectName) +// } +// return pmsvc, nil +//} +// +//func (d *domain) GetProjectManagedService(ctx ConsoleContext, projectName string, serviceName string) (*entities.ProjectManagedService, error) { +// if err := d.canReadResourcesInProject(ctx, projectName); err != nil { +// return nil, errors.NewE(err) +// } +// +// c, err := d.findProjectManagedService(ctx, projectName, serviceName) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// return c, nil +//} +// +//func (d *domain) applyProjectManagedService(ctx ConsoleContext, pmsvc *entities.ProjectManagedService) error { +// addTrackingId(&pmsvc.ProjectManagedService, pmsvc.Id) +// return d.applyK8sResource(ctx, pmsvc.ProjectName, &pmsvc.ProjectManagedService, pmsvc.RecordVersion) +//} +// +//func (d *domain) CreateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { +// if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +// return nil, errors.NewE(err) +// } +// +// service.Namespace = d.getProjectTargetNamespace(projectName) +// service.IncrementRecordVersion() +// +// if service.Spec.TargetNamespace == "" { +// service.Spec.TargetNamespace = d.getPMSTargetNamespace(projectName, service.Name, entities.ResourceTypeProjectManagedService) +// } +// +// service.CreatedBy = common.CreatedOrUpdatedBy{ +// UserId: ctx.UserId, +// UserName: ctx.UserName, +// UserEmail: ctx.UserEmail, +// } +// +// service.LastUpdatedBy = service.CreatedBy +// +// existing, err := d.pmsRepo.FindOne(ctx, repos.Filter{ +// fields.ProjectName: projectName, +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: service.Name, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if existing != nil { +// return nil, errors.Newf("project managed service with name %q already exists", projectName) +// } +// +// service.AccountName = ctx.AccountName +// service.ProjectName = projectName +// service.SyncStatus = t.GenSyncStatus(t.SyncActionApply, service.RecordVersion) +// +// service.EnsureGVK() +// +// if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { +// return nil, errors.NewE(err) +// } +// +// pms, err := d.pmsRepo.Create(ctx, &service) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if _, err := d.upsertProjectResourceMapping(ctx, projectName, pms); err != nil { +// return nil, errors.NewE(err) +// } +// +// if err := d.applyProjectManagedService(ctx, pms); err != nil { +// return nil, errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, pms.ProjectName, entities.ResourceTypeProjectManagedService, pms.Name, PublishAdd) +// +// return pms, nil +//} +// +//func (d *domain) getPMSTargetNamespace(projectName string, msvcName string, msvcType entities.ResourceType) string { +// msvcNamespace := fmt.Sprintf("pmsvc-%s-%s-%s", projectName, msvcName, msvcType) +// hash := md5.Sum([]byte(msvcNamespace)) +// return fmt.Sprintf("pmsvc-%s", hex.EncodeToString(hash[:])) +//} +// +//func (d *domain) UpdateProjectManagedService(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) (*entities.ProjectManagedService, error) { +// if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +// return nil, errors.NewE(err) +// } +// +// pmsvc, err := d.findProjectManagedService(ctx, projectName, service.Name) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if pmsvc == nil { +// return nil, errors.Newf("no project manage service found") +// } +// +// service.Namespace = "trest" // this is just to make it pass validation +// service.EnsureGVK() +// if err := d.k8sClient.ValidateObject(ctx, &service.ProjectManagedService); err != nil { +// return nil, errors.NewE(err) +// } +// +// if pmsvc.IsMarkedForDeletion() { +// return nil, errors.Newf("cluster managed service %q (projectName=%q) is marked for deletion", service.Name, projectName) +// } +// +// patchForUpdate := common.PatchForUpdate( +// ctx, +// &service, +// common.PatchOpts{ +// XPatch: repos.Document{ +// fc.ProjectManagedServiceSpecMsvcSpecServiceTemplateSpec: service.Spec.MSVCSpec.ServiceTemplate.Spec, +// }, +// }) +// +// upmsvc, err := d.pmsRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: service.Name, +// }, +// patchForUpdate, +// ) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, service.Name, PublishUpdate) +// +// if err := d.applyProjectManagedService(ctx, upmsvc); err != nil { +// return nil, errors.NewE(err) +// } +// +// return upmsvc, nil +//} +// +//func (d *domain) DeleteProjectManagedService(ctx ConsoleContext, projectName string, name string) error { +// if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +// return errors.NewE(err) +// } +// +// upmsvc, err := d.pmsRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }, +// common.PatchForMarkDeletion(), +// ) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, name, PublishUpdate) +// +// return d.deleteK8sResource(ctx, projectName, &upmsvc.ProjectManagedService) +//} +// +//// RestartProjectManagedService implements Domain. +//func (d *domain) RestartProjectManagedService(ctx ConsoleContext, projectName string, name string) error { +// if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +// return errors.NewE(err) +// } +// +// pms, err := d.findProjectManagedService(ctx, projectName, name) +// if err != nil { +// return errors.NewE(err) +// } +// +// if err := d.restartK8sResource(ctx, projectName, pms.Spec.TargetNamespace, pms.GetEnsuredLabels()); err != nil { +// return err +// } +// +// return nil +//} +// +//func (d *domain) OnProjectManagedServiceApplyError(ctx ConsoleContext, projectName, name, errMsg string, opts UpdateAndDeleteOpts) error { +// upmsvc, err := d.pmsRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }, +// common.PatchForErrorFromAgent( +// errMsg, +// common.PatchOpts{ +// MessageTimestamp: opts.MessageTimestamp, +// }, +// ), +// ) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishDelete) +// +// return errors.NewE(err) +//} +// +//func (d *domain) OnProjectManagedServiceDeleteMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService) error { +// err := d.pmsRepo.DeleteOne( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: service.Name, +// }, +// ) +// if err != nil { +// return errors.NewE(err) +// } +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, projectName, entities.ResourceTypeProjectManagedService, service.Name, PublishDelete) +// return nil +//} +// +//func (d *domain) OnProjectManagedServiceUpdateMessage(ctx ConsoleContext, projectName string, service entities.ProjectManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { +// svc, err := d.findProjectManagedService(ctx, projectName, service.Name) +// if err != nil { +// return errors.NewE(err) +// } +// +// if svc == nil { +// return errors.Newf("no project manage service found") +// } +// +// recordVersion, err := d.MatchRecordVersion(service.Annotations, svc.RecordVersion) +// if err != nil { +// return d.ResyncProjectManagedService(ctx, service.ProjectName, service.Name) +// } +// +// upmsvc, err := d.pmsRepo.PatchById( +// ctx, +// svc.Id, +// common.PatchForSyncFromAgent( +// &service, +// recordVersion, +// status, +// common.PatchOpts{ +// MessageTimestamp: opts.MessageTimestamp, +// XPatch: repos.Document{ +// fc.ProjectManagedServiceSyncedOutputSecretRef: service.SyncedOutputSecretRef, +// }, +// })) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishEnvironmentResourceEvent(ctx, upmsvc.ProjectName, entities.ResourceTypeProjectManagedService, upmsvc.Name, PublishUpdate) +// +// return nil +//} +// +//func (d *domain) ResyncProjectManagedService(ctx ConsoleContext, projectName, name string) error { +// if err := d.canMutateResourcesInProject(ctx, projectName); err != nil { +// return errors.NewE(err) +// } +// +// a, err := d.findProjectManagedService(ctx, projectName, name) +// if err != nil { +// return errors.NewE(err) +// } +// +// return d.resyncK8sResource(ctx, a.ProjectName, a.SyncStatus.Action, &a.ProjectManagedService, a.RecordVersion) +//} diff --git a/apps/console/internal/domain/project.go b/apps/console/internal/domain/project.go index 0ab042930..d4efeea78 100644 --- a/apps/console/internal/domain/project.go +++ b/apps/console/internal/domain/project.go @@ -1,446 +1,446 @@ package domain -import ( - "context" - "crypto/md5" - "encoding/hex" - "fmt" - - "github.com/kloudlite/api/grpc-interfaces/infra" - - "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/pkg/errors" - fn "github.com/kloudlite/api/pkg/functions" - "github.com/kloudlite/operator/operators/resource-watcher/types" - "github.com/kloudlite/operator/pkg/constants" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/kloudlite/api/apps/console/internal/entities" - fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" - iamT "github.com/kloudlite/api/apps/iam/types" - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" - "github.com/kloudlite/api/pkg/repos" - t "github.com/kloudlite/api/pkg/types" -) - -func (d *domain) getClusterAttachedToProject(ctx K8sContext, projectName string) (*string, error) { - cacheKey := fmt.Sprintf("account_name_%s-project_name_%s", ctx.GetAccountName(), projectName) - - clusterName, err := d.consoleCacheStore.Get(ctx, cacheKey) - if err != nil && !d.consoleCacheStore.ErrKeyNotFound(err) { - return nil, err - } - - if len(clusterName) == 0 { - proj, err := d.projectRepo.FindOne(ctx, repos.Filter{ - fields.AccountName: ctx.GetAccountName(), - fields.MetadataName: projectName, - }) - if err != nil { - return nil, errors.NewE(err) - } - if proj == nil { - return nil, errors.Newf("no cluster attached to project") - } - - defer func() { - if err := d.consoleCacheStore.Set(ctx, cacheKey, []byte(fn.DefaultIfNil(proj.ClusterName))); err != nil { - d.logger.Infof("failed to set project cluster map: %v", err) - } - }() - - return proj.ClusterName, nil - } - - if clusterName == nil { - return nil, nil - } - - return fn.New(string(clusterName)), nil -} - -func (d *domain) clusterStatus(ctx ConsoleContext, projectName string) (*infra.ClusterExistsOut, error) { - prj, err := d.findProject(ctx, projectName) - if err != nil { - return nil, errors.NewE(err) - } - - clusterExistStatus, err := d.infraClient.ClusterExists(ctx, &infra.ClusterExistsIn{ - UserId: string(ctx.UserId), - UserName: ctx.UserName, - UserEmail: ctx.UserEmail, - AccountName: ctx.AccountName, - ClusterName: *prj.ClusterName, - }) - if err != nil { - return nil, errors.NewE(err) - } - - return clusterExistStatus, nil -} - -func (d *domain) ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(userId), - ResourceRefs: []string{ - iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), - }, - Action: string(iamT.ListProjects), - }) - if err != nil { - return nil, errors.NewE(err) - } - - if !co.Status { - return nil, errors.Newf("unauthorized to get project") - } - - filter := repos.Filter{fields.AccountName: accountName} - - // return d.projectRepo.Find(ctx, repos.Query{Filter: filter}) - return d.projectRepo.FindPaginated(ctx, d.projectRepo.MergeMatchFilters(filter, search), pagination) -} - -func (d *domain) findProject(ctx ConsoleContext, name string) (*entities.Project, error) { - prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }) - if err != nil { - return nil, errors.NewE(err) - } - if prj == nil { - return nil, errors.Newf("no project with name=%q found", name) - } - return prj, nil -} - -func (d *domain) findProjectByTargetNs(ctx ConsoleContext, targetNamespace string) (*entities.Project, error) { - prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ - fields.AccountName: ctx.AccountName, - fc.ProjectSpecTargetNamespace: targetNamespace, - }) - if err != nil { - return nil, errors.NewE(err) - } - if prj == nil { - return nil, errors.Newf("no project with targetNamespace=%q found", targetNamespace) - } - return prj, nil -} - -func (d *domain) GetProject(ctx ConsoleContext, name string) (*entities.Project, error) { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, name), - }, - Action: string(iamT.GetProject), - }) - if err != nil { - return nil, errors.NewE(err) - } - - if !co.Status { - return nil, errors.Newf("unauthorized to get project") - } - - return d.findProject(ctx, name) -} - -// mutations - -func (d *domain) CreateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - }, - Action: string(iamT.CreateProject), - }) - if err != nil { - return nil, errors.NewE(err) - } - - if !co.Status { - return nil, errors.Newf("unauthorized to create Project") - } - - project.EnsureGVK() - if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { - return nil, errors.NewE(err) - } - - project.IncrementRecordVersion() - - // TODO: check if provided cluster is exists in account - - project.CreatedBy = common.CreatedOrUpdatedBy{ - UserId: ctx.UserId, - UserName: ctx.UserName, - UserEmail: ctx.UserEmail, - } - project.LastUpdatedBy = project.CreatedBy - - project.AccountName = ctx.AccountName - project.SyncStatus = t.GenSyncStatus(t.SyncActionApply, project.RecordVersion) - if project.Spec.TargetNamespace == "" { - project.Spec.TargetNamespace = d.getProjectTargetNamespace(project.Name) - } - - prj, err := d.projectRepo.Create(ctx, &project) - if err != nil { - if d.projectRepo.ErrAlreadyExists(err) { - // TODO: better insights into error, when it is being caused by duplicated indexes - return nil, errors.NewE(err) - } - return nil, errors.NewE(err) - } - - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, prj.Name, PublishAdd) - - if err := d.applyK8sResource(ctx, prj.Name, &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, - ObjectMeta: metav1.ObjectMeta{ - Name: prj.Spec.TargetNamespace, - Annotations: map[string]string{ - constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", - }, - Labels: map[string]string{ - constants.ProjectNameKey: prj.Name, - }, - }, - }, prj.RecordVersion); err != nil { - return nil, errors.NewE(err) - } - - if err := d.applyK8sResource(ctx, prj.Name, &prj.Project, prj.RecordVersion); err != nil { - return nil, errors.NewE(err) - } - - return prj, nil -} - -func (d *domain) getProjectTargetNamespace(projectName string) string { - hash := md5.Sum([]byte(projectName)) - return fmt.Sprintf("prj-%s", hex.EncodeToString(hash[:])) -} - -func (d *domain) DeleteProject(ctx ConsoleContext, name string) error { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - }, - Action: string(iamT.DeleteProject), - }) - if err != nil { - return errors.NewE(err) - } - - if !co.Status { - return errors.Newf("unauthorized to delete project") - } - - cluster, err := d.clusterStatus(ctx, name) - if err != nil { - return errors.NewE(err) - } - - if !cluster.Exists { - err := d.projectRepo.DeleteOne( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }, - ) - if err != nil { - return errors.NewE(err) - } - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, name, PublishDelete) - return nil - } - - uproj, err := d.projectRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }, - common.PatchForMarkDeletion(), - ) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, name, PublishUpdate) - - return d.deleteK8sResource(ctx, uproj.Name, &uproj.Project) -} - -func (d *domain) UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, project.Name), - }, - Action: string(iamT.UpdateProject), - }) - if err != nil { - return nil, errors.NewE(err) - } - - if !co.Status { - return nil, errors.Newf("unauthorized to update project %q", project.Name) - } - - project.EnsureGVK() - if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { - return nil, errors.NewE(err) - } - - patchForUpdate := common.PatchForUpdate( - ctx, - &project, - common.PatchOpts{ - XPatch: repos.Document{ - fc.ProjectSpec: project.Spec, - }, - }) - - upProject, err := d.projectRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: project.Name, - }, - patchForUpdate, - ) - if err != nil { - return nil, errors.NewE(err) - } - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, project.Name, PublishUpdate) - - if err := d.applyK8sResource(ctx, upProject.Name, &upProject.Project, upProject.RecordVersion); err != nil { - return nil, errors.NewE(err) - } - - return upProject, nil -} - -func (d *domain) OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error { - err := d.projectRepo.DeleteOne( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: project.Name, - }, - ) - if err != nil { - return errors.NewE(err) - } - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, project.Name, PublishDelete) - return nil -} - -func (d *domain) OnProjectUpdateMessage(ctx ConsoleContext, project entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { - proj, err := d.findProject(ctx, project.Name) - if err != nil { - return errors.NewE(err) - } - - if proj == nil { - return errors.Newf("no project found") - } - - recordVersion, err := d.MatchRecordVersion(project.Annotations, proj.RecordVersion) - if err != nil { - return nil - } - - uproject, err := d.projectRepo.PatchById( - ctx, - proj.Id, - common.PatchForSyncFromAgent( - &project, - recordVersion, - status, - common.PatchOpts{ - MessageTimestamp: opts.MessageTimestamp, - })) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, uproject.Name, PublishUpdate) - - return nil -} - -func (d *domain) OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { - uproject, err := d.projectRepo.Patch( - ctx, - repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.MetadataName: name, - }, - common.PatchForErrorFromAgent( - errMsg, - common.PatchOpts{ - MessageTimestamp: opts.MessageTimestamp, - }, - ), - ) - if err != nil { - return errors.NewE(err) - } - - d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, uproject.Name, PublishDelete) - - return errors.NewE(err) -} - -func (d *domain) ResyncProject(ctx ConsoleContext, name string) error { - co, err := d.iamClient.Can(ctx, &iam.CanIn{ - UserId: string(ctx.UserId), - ResourceRefs: []string{ - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), - iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, name), - }, - Action: string(iamT.UpdateProject), - }) - if err != nil { - return errors.NewE(err) - } - - if !co.Status { - return errors.Newf("unauthorized to update project %q", name) - } - - project, err := d.findProject(ctx, name) - if err != nil { - return errors.NewE(err) - } - - if err := d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &corev1.Namespace{ - TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, - ObjectMeta: metav1.ObjectMeta{ - Name: project.Spec.TargetNamespace, - Annotations: map[string]string{ - constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", - }, - Labels: map[string]string{ - constants.ProjectNameKey: project.Name, - }, - }, - }, 0); err != nil { - return errors.NewE(err) - } - - return d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &project.Project, project.RecordVersion) -} +// import ( +// "context" +// "crypto/md5" +// "encoding/hex" +// "fmt" +// +// "github.com/kloudlite/api/grpc-interfaces/infra" +// +// "github.com/kloudlite/api/common/fields" +// "github.com/kloudlite/api/pkg/errors" +// fn "github.com/kloudlite/api/pkg/functions" +// "github.com/kloudlite/operator/operators/resource-watcher/types" +// "github.com/kloudlite/operator/pkg/constants" +// corev1 "k8s.io/api/core/v1" +// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +// +// "github.com/kloudlite/api/apps/console/internal/entities" +// fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" +// iamT "github.com/kloudlite/api/apps/iam/types" +// "github.com/kloudlite/api/common" +// "github.com/kloudlite/api/grpc-interfaces/kloudlite.io/rpc/iam" +// "github.com/kloudlite/api/pkg/repos" +// t "github.com/kloudlite/api/pkg/types" +// ) +// +// func (d *domain) getClusterAttachedToProject(ctx K8sContext, projectName string) (*string, error) { +// cacheKey := fmt.Sprintf("account_name_%s-project_name_%s", ctx.GetAccountName(), projectName) +// +// clusterName, err := d.consoleCacheStore.Get(ctx, cacheKey) +// if err != nil && !d.consoleCacheStore.ErrKeyNotFound(err) { +// return nil, err +// } +// +// if len(clusterName) == 0 { +// proj, err := d.projectRepo.FindOne(ctx, repos.Filter{ +// fields.AccountName: ctx.GetAccountName(), +// fields.MetadataName: projectName, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// if proj == nil { +// return nil, errors.Newf("no cluster attached to project") +// } +// +// defer func() { +// if err := d.consoleCacheStore.Set(ctx, cacheKey, []byte(fn.DefaultIfNil(proj.ClusterName))); err != nil { +// d.logger.Infof("failed to set project cluster map: %v", err) +// } +// }() +// +// return proj.ClusterName, nil +// } +// +// if clusterName == nil { +// return nil, nil +// } +// +// return fn.New(string(clusterName)), nil +// } +// +// func (d *domain) clusterStatus(ctx ConsoleContext, projectName string) (*infra.ClusterExistsOut, error) { +// prj, err := d.findProject(ctx, projectName) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// clusterExistStatus, err := d.infraClient.ClusterExists(ctx, &infra.ClusterExistsIn{ +// UserId: string(ctx.UserId), +// UserName: ctx.UserName, +// UserEmail: ctx.UserEmail, +// AccountName: ctx.AccountName, +// ClusterName: *prj.ClusterName, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// return clusterExistStatus, nil +// } +// +// func (d *domain) ListProjects(ctx context.Context, userId repos.ID, accountName string, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.Project], error) { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(userId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(accountName, iamT.ResourceAccount, accountName), +// }, +// Action: string(iamT.ListProjects), +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if !co.Status { +// return nil, errors.Newf("unauthorized to get project") +// } +// +// filter := repos.Filter{fields.AccountName: accountName} +// +// // return d.projectRepo.Find(ctx, repos.Query{Filter: filter}) +// return d.projectRepo.FindPaginated(ctx, d.projectRepo.MergeMatchFilters(filter, search), pagination) +// } +// +// func (d *domain) findProject(ctx ConsoleContext, name string) (*entities.Project, error) { +// prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// if prj == nil { +// return nil, errors.Newf("no project with name=%q found", name) +// } +// return prj, nil +// } +// +// func (d *domain) findProjectByTargetNs(ctx ConsoleContext, targetNamespace string) (*entities.Project, error) { +// prj, err := d.projectRepo.FindOne(ctx, repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fc.ProjectSpecTargetNamespace: targetNamespace, +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// if prj == nil { +// return nil, errors.Newf("no project with targetNamespace=%q found", targetNamespace) +// } +// return prj, nil +// } +// +// func (d *domain) GetProject(ctx ConsoleContext, name string) (*entities.Project, error) { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, name), +// }, +// Action: string(iamT.GetProject), +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if !co.Status { +// return nil, errors.Newf("unauthorized to get project") +// } +// +// return d.findProject(ctx, name) +// } +// +// // mutations +// +// func (d *domain) CreateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// }, +// Action: string(iamT.CreateProject), +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if !co.Status { +// return nil, errors.Newf("unauthorized to create Project") +// } +// +// project.EnsureGVK() +// if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { +// return nil, errors.NewE(err) +// } +// +// project.IncrementRecordVersion() +// +// // TODO: check if provided cluster is exists in account +// +// project.CreatedBy = common.CreatedOrUpdatedBy{ +// UserId: ctx.UserId, +// UserName: ctx.UserName, +// UserEmail: ctx.UserEmail, +// } +// project.LastUpdatedBy = project.CreatedBy +// +// project.AccountName = ctx.AccountName +// project.SyncStatus = t.GenSyncStatus(t.SyncActionApply, project.RecordVersion) +// if project.Spec.TargetNamespace == "" { +// project.Spec.TargetNamespace = d.getProjectTargetNamespace(project.Name) +// } +// +// prj, err := d.projectRepo.Create(ctx, &project) +// if err != nil { +// if d.projectRepo.ErrAlreadyExists(err) { +// // TODO: better insights into error, when it is being caused by duplicated indexes +// return nil, errors.NewE(err) +// } +// return nil, errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, prj.Name, PublishAdd) +// +// if err := d.applyK8sResource(ctx, prj.Name, &corev1.Namespace{ +// TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, +// ObjectMeta: metav1.ObjectMeta{ +// Name: prj.Spec.TargetNamespace, +// Annotations: map[string]string{ +// constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", +// }, +// Labels: map[string]string{ +// constants.ProjectNameKey: prj.Name, +// }, +// }, +// }, prj.RecordVersion); err != nil { +// return nil, errors.NewE(err) +// } +// +// if err := d.applyK8sResource(ctx, prj.Name, &prj.Project, prj.RecordVersion); err != nil { +// return nil, errors.NewE(err) +// } +// +// return prj, nil +// } +// +// func (d *domain) getProjectTargetNamespace(projectName string) string { +// hash := md5.Sum([]byte(projectName)) +// return fmt.Sprintf("prj-%s", hex.EncodeToString(hash[:])) +// } +// +// func (d *domain) DeleteProject(ctx ConsoleContext, name string) error { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// }, +// Action: string(iamT.DeleteProject), +// }) +// if err != nil { +// return errors.NewE(err) +// } +// +// if !co.Status { +// return errors.Newf("unauthorized to delete project") +// } +// +// cluster, err := d.clusterStatus(ctx, name) +// if err != nil { +// return errors.NewE(err) +// } +// +// if !cluster.Exists { +// err := d.projectRepo.DeleteOne( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }, +// ) +// if err != nil { +// return errors.NewE(err) +// } +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, name, PublishDelete) +// return nil +// } +// +// uproj, err := d.projectRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }, +// common.PatchForMarkDeletion(), +// ) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, name, PublishUpdate) +// +// return d.deleteK8sResource(ctx, uproj.Name, &uproj.Project) +// } +// +// func (d *domain) UpdateProject(ctx ConsoleContext, project entities.Project) (*entities.Project, error) { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, project.Name), +// }, +// Action: string(iamT.UpdateProject), +// }) +// if err != nil { +// return nil, errors.NewE(err) +// } +// +// if !co.Status { +// return nil, errors.Newf("unauthorized to update project %q", project.Name) +// } +// +// project.EnsureGVK() +// if err := d.k8sClient.ValidateObject(ctx, &project.Project); err != nil { +// return nil, errors.NewE(err) +// } +// +// patchForUpdate := common.PatchForUpdate( +// ctx, +// &project, +// common.PatchOpts{ +// XPatch: repos.Document{ +// fc.ProjectSpec: project.Spec, +// }, +// }) +// +// upProject, err := d.projectRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: project.Name, +// }, +// patchForUpdate, +// ) +// if err != nil { +// return nil, errors.NewE(err) +// } +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, project.Name, PublishUpdate) +// +// if err := d.applyK8sResource(ctx, upProject.Name, &upProject.Project, upProject.RecordVersion); err != nil { +// return nil, errors.NewE(err) +// } +// +// return upProject, nil +// } +// +// func (d *domain) OnProjectDeleteMessage(ctx ConsoleContext, project entities.Project) error { +// err := d.projectRepo.DeleteOne( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: project.Name, +// }, +// ) +// if err != nil { +// return errors.NewE(err) +// } +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, project.Name, PublishDelete) +// return nil +// } +// +// func (d *domain) OnProjectUpdateMessage(ctx ConsoleContext, project entities.Project, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { +// proj, err := d.findProject(ctx, project.Name) +// if err != nil { +// return errors.NewE(err) +// } +// +// if proj == nil { +// return errors.Newf("no project found") +// } +// +// recordVersion, err := d.MatchRecordVersion(project.Annotations, proj.RecordVersion) +// if err != nil { +// return nil +// } +// +// uproject, err := d.projectRepo.PatchById( +// ctx, +// proj.Id, +// common.PatchForSyncFromAgent( +// &project, +// recordVersion, +// status, +// common.PatchOpts{ +// MessageTimestamp: opts.MessageTimestamp, +// })) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, uproject.Name, PublishUpdate) +// +// return nil +// } +// +// func (d *domain) OnProjectApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error { +// uproject, err := d.projectRepo.Patch( +// ctx, +// repos.Filter{ +// fields.AccountName: ctx.AccountName, +// fields.MetadataName: name, +// }, +// common.PatchForErrorFromAgent( +// errMsg, +// common.PatchOpts{ +// MessageTimestamp: opts.MessageTimestamp, +// }, +// ), +// ) +// if err != nil { +// return errors.NewE(err) +// } +// +// d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeProject, uproject.Name, PublishDelete) +// +// return errors.NewE(err) +// } +// +// func (d *domain) ResyncProject(ctx ConsoleContext, name string) error { +// co, err := d.iamClient.Can(ctx, &iam.CanIn{ +// UserId: string(ctx.UserId), +// ResourceRefs: []string{ +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceAccount, ctx.AccountName), +// iamT.NewResourceRef(ctx.AccountName, iamT.ResourceProject, name), +// }, +// Action: string(iamT.UpdateProject), +// }) +// if err != nil { +// return errors.NewE(err) +// } +// +// if !co.Status { +// return errors.Newf("unauthorized to update project %q", name) +// } +// +// project, err := d.findProject(ctx, name) +// if err != nil { +// return errors.NewE(err) +// } +// +// if err := d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &corev1.Namespace{ +// TypeMeta: metav1.TypeMeta{APIVersion: "v1", Kind: "Namespace"}, +// ObjectMeta: metav1.ObjectMeta{ +// Name: project.Spec.TargetNamespace, +// Annotations: map[string]string{ +// constants.DescriptionKey: "This namespace is managed (created/updated/deleted) by kloudlite.io control plane. This namespace belongs to a project", +// }, +// Labels: map[string]string{ +// constants.ProjectNameKey: project.Name, +// }, +// }, +// }, 0); err != nil { +// return errors.NewE(err) +// } +// +// return d.resyncK8sResource(ctx, project.Name, project.SyncStatus.Action, &project.Project, project.RecordVersion) +// } diff --git a/apps/console/internal/domain/resource-mapping.go b/apps/console/internal/domain/resource-mapping.go index bad82173a..028acde56 100644 --- a/apps/console/internal/domain/resource-mapping.go +++ b/apps/console/internal/domain/resource-mapping.go @@ -14,6 +14,7 @@ type resource interface { GetResourceType() entities.ResourceType } +// just a compile-time validation, that these types satisfies resource var ( _ resource = (*entities.App)(nil) _ resource = (*entities.Config)(nil) @@ -21,13 +22,11 @@ var ( _ resource = (*entities.Router)(nil) _ resource = (*entities.ManagedResource)(nil) _ resource = (*entities.ImagePullSecret)(nil) - _ resource = (*entities.Project)(nil) _ resource = (*entities.Environment)(nil) - _ resource = (*entities.ProjectManagedService)(nil) ) func (d *domain) upsertEnvironmentResourceMapping(ctx ResourceContext, res resource) (*entities.ResourceMapping, error) { - clusterName, err := d.getClusterAttachedToProject(ctx, ctx.ProjectName) + clusterName, err := d.getClusterAttachedToEnvironment(ctx, ctx.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -39,7 +38,6 @@ func (d *domain) upsertEnvironmentResourceMapping(ctx ResourceContext, res resou return d.resourceMappingRepo.Upsert(ctx, repos.Filter{ fields.ClusterName: clusterName, fields.AccountName: ctx.AccountName, - fields.ProjectName: ctx.ProjectName, fields.EnvironmentName: ctx.EnvironmentName, fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyEnvironment, @@ -56,61 +54,15 @@ func (d *domain) upsertEnvironmentResourceMapping(ctx ResourceContext, res resou AccountName: ctx.AccountName, ClusterName: *clusterName, - ProjectName: ctx.ProjectName, EnvironmentName: ctx.EnvironmentName, }) } -func (d *domain) upsertProjectResourceMapping(ctx ConsoleContext, projectName string, res resource) (*entities.ResourceMapping, error) { - clusterName, err := d.getClusterAttachedToProject(ctx, projectName) - if err != nil { - return nil, errors.NewE(err) - } - if clusterName == nil { - // silent exit - return nil, nil - } - - return d.resourceMappingRepo.Upsert(ctx, repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ClusterName: *clusterName, - fields.ProjectName: projectName, - fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyProject, - fc.ResourceMappingResourceType: res.GetResourceType(), - fc.ResourceMappingResourceName: res.GetName(), - fc.ResourceMappingResourceNamespace: res.GetNamespace(), - }, &entities.ResourceMapping{ - ResourceHeirarchy: entities.ResourceHeirarchyProject, - - ResourceType: res.GetResourceType(), - ResourceName: res.GetName(), - ResourceNamespace: res.GetNamespace(), - - AccountName: ctx.AccountName, - ClusterName: *clusterName, - - ProjectName: projectName, - }) -} - func (d *domain) GetEnvironmentResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) { - return d.resourceMappingRepo.FindOne(ctx, repos.Filter{ - fields.AccountName: ctx.AccountName, - fields.ClusterName: clusterName, - // fields.ProjectName: "", - // fields.EnvironmentName: "", - fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyEnvironment, - fc.ResourceMappingResourceType: resType, - fc.ResourceMappingResourceName: name, - fc.ResourceMappingResourceNamespace: namespace, - }) -} - -func (d *domain) GetProjectResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) { return d.resourceMappingRepo.FindOne(ctx, repos.Filter{ fields.AccountName: ctx.AccountName, fields.ClusterName: clusterName, - fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyProject, + fc.ResourceMappingResourceHeirarchy: entities.ResourceHeirarchyEnvironment, fc.ResourceMappingResourceType: resType, fc.ResourceMappingResourceName: name, fc.ResourceMappingResourceNamespace: namespace, diff --git a/apps/console/internal/domain/router.go b/apps/console/internal/domain/router.go index 8279b354f..f284e5c1b 100644 --- a/apps/console/internal/domain/router.go +++ b/apps/console/internal/domain/router.go @@ -52,7 +52,7 @@ func (d *domain) CreateRouter(ctx ResourceContext, router entities.Router) (*ent return nil, errors.NewE(err) } - namespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + namespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, err } @@ -73,7 +73,6 @@ func (d *domain) CreateRouter(ctx ResourceContext, router entities.Router) (*ent router.LastUpdatedBy = router.CreatedBy router.AccountName = ctx.AccountName - router.ProjectName = ctx.ProjectName router.EnvironmentName = ctx.EnvironmentName router.SyncStatus = t.GenSyncStatus(t.SyncActionApply, router.RecordVersion) @@ -101,7 +100,7 @@ func (d *domain) createAndApplyRouter(ctx ResourceContext, router *entities.Rout } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, nrouter.Name, PublishAdd) - if err := d.applyK8sResource(ctx, nrouter.ProjectName, &nrouter.Router, nrouter.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, nrouter.EnvironmentName, &nrouter.Router, nrouter.RecordVersion); err != nil { return nrouter, errors.NewE(err) } @@ -144,7 +143,7 @@ func (d *domain) UpdateRouter(ctx ResourceContext, router entities.Router) (*ent } d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, upRouter.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, upRouter.ProjectName, &upRouter.Router, upRouter.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, upRouter.EnvironmentName, &upRouter.Router, upRouter.RecordVersion); err != nil { return upRouter, errors.NewE(err) } @@ -167,7 +166,7 @@ func (d *domain) DeleteRouter(ctx ResourceContext, name string) error { d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeRouter, urouter.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, urouter.ProjectName, &urouter.Router); err != nil { + if err := d.deleteK8sResource(ctx, urouter.EnvironmentName, &urouter.Router); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.routerRepo.DeleteById(ctx, urouter.Id) } @@ -201,7 +200,7 @@ func (d *domain) OnRouterUpdateMessage(ctx ResourceContext, router entities.Rout recordVersion, err := d.MatchRecordVersion(router.Annotations, xRouter.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xRouter.ProjectName, xRouter.SyncStatus.Action, &xRouter.Router, xRouter.RecordVersion) + return d.resyncK8sResource(ctx, xRouter.EnvironmentName, xRouter.SyncStatus.Action, &xRouter.Router, xRouter.RecordVersion) } urouter, err := d.routerRepo.PatchById( @@ -244,5 +243,5 @@ func (d *domain) ResyncRouter(ctx ResourceContext, name string) error { return errors.NewE(err) } - return d.resyncK8sResource(ctx, router.ProjectName, router.SyncStatus.Action, &router.Router, router.RecordVersion) + return d.resyncK8sResource(ctx, router.EnvironmentName, router.SyncStatus.Action, &router.Router, router.RecordVersion) } diff --git a/apps/console/internal/domain/secret.go b/apps/console/internal/domain/secret.go index f918e973d..336d46851 100644 --- a/apps/console/internal/domain/secret.go +++ b/apps/console/internal/domain/secret.go @@ -74,7 +74,7 @@ func (d *domain) GetSecretEntries(ctx ResourceContext, keyrefs []SecretKeyRef) ( } for k, v := range secrets[i].StringData { - m[k] = string(v) + m[k] = v } data[secrets[i].Name] = m @@ -96,7 +96,7 @@ func (d *domain) CreateSecret(ctx ResourceContext, secret entities.Secret) (*ent return nil, errors.NewE(err) } - targetNamespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.ProjectName, ctx.EnvironmentName) + targetNamespace, err := d.envTargetNamespace(ctx.ConsoleContext, ctx.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -114,7 +114,6 @@ func (d *domain) CreateSecret(ctx ResourceContext, secret entities.Secret) (*ent secret.LastUpdatedBy = secret.CreatedBy secret.AccountName = ctx.AccountName - secret.ProjectName = ctx.ProjectName secret.EnvironmentName = ctx.EnvironmentName secret.SyncStatus = t.GenSyncStatus(t.SyncActionApply, secret.RecordVersion) @@ -142,7 +141,7 @@ func (d *domain) createAndApplySecret(ctx ResourceContext, secret *entities.Secr return nil, errors.NewE(err) } - if err := d.applyK8sResource(ctx, nsecret.ProjectName, &nsecret.Secret, nsecret.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, nsecret.EnvironmentName, &nsecret.Secret, nsecret.RecordVersion); err != nil { return nsecret, errors.NewE(err) } @@ -191,7 +190,7 @@ func (d *domain) UpdateSecret(ctx ResourceContext, secret entities.Secret) (*ent d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, upSecret.Name, PublishUpdate) - if err := d.applyK8sResource(ctx, upSecret.ProjectName, &upSecret.Secret, upSecret.RecordVersion); err != nil { + if err := d.applyK8sResource(ctx, upSecret.EnvironmentName, &upSecret.Secret, upSecret.RecordVersion); err != nil { return upSecret, errors.NewE(err) } @@ -214,7 +213,7 @@ func (d *domain) DeleteSecret(ctx ResourceContext, name string) error { d.resourceEventPublisher.PublishResourceEvent(ctx, entities.ResourceTypeSecret, usecret.Name, PublishUpdate) - if err := d.deleteK8sResource(ctx, usecret.ProjectName, &usecret.Secret); err != nil { + if err := d.deleteK8sResource(ctx, "", &usecret.Secret); err != nil { if errors.Is(err, ErrNoClusterAttached) { return d.secretRepo.DeleteById(ctx, usecret.Id) } @@ -245,7 +244,7 @@ func (d *domain) OnSecretUpdateMessage(ctx ResourceContext, secretIn entities.Se recordVersion, err := d.MatchRecordVersion(secretIn.Annotations, xSecret.RecordVersion) if err != nil { - return d.resyncK8sResource(ctx, xSecret.ProjectName, xSecret.SyncStatus.Action, &xSecret.Secret, xSecret.RecordVersion) + return d.resyncK8sResource(ctx, xSecret.EnvironmentName, xSecret.SyncStatus.Action, &xSecret.Secret, xSecret.RecordVersion) } usecret, err := d.secretRepo.PatchById( @@ -290,5 +289,5 @@ func (d *domain) ResyncSecret(ctx ResourceContext, name string) error { return errors.NewE(err) } - return d.resyncK8sResource(ctx, secret.ProjectName, secret.SyncStatus.Action, &secret.Secret, secret.RecordVersion) + return d.resyncK8sResource(ctx, secret.EnvironmentName, secret.SyncStatus.Action, &secret.Secret, secret.RecordVersion) } diff --git a/apps/console/internal/domain/vpn-device.go b/apps/console/internal/domain/vpn-device.go index a2d7d00bb..1c22c9f44 100644 --- a/apps/console/internal/domain/vpn-device.go +++ b/apps/console/internal/domain/vpn-device.go @@ -38,20 +38,20 @@ func (d *domain) getClusterFromDevice(ctx ConsoleContext, device *entities.Conso return "", errors.Newf("device is nil") } - if device.ProjectName == nil && device.ClusterName != nil { + if device.ClusterName != nil { return *device.ClusterName, nil } - if device.ProjectName == nil { - return "", errors.NewE(errors.Newf("project name is nil")) + if device.EnvironmentName == nil { + return "", errors.NewE(errors.Newf("environment name is nil")) } - cluster, err := d.getClusterAttachedToProject(ctx, *device.ProjectName) + cluster, err := d.getClusterAttachedToEnvironment(ctx, *device.EnvironmentName) if err != nil { return "", errors.NewE(err) } if cluster == nil { - return "", errors.NewE(errors.Newf("no cluster attached to project %s", *device.ProjectName)) + return "", errors.NewE(errors.Newf("no cluster attached to env %s", *device.EnvironmentName)) } return *cluster, nil } @@ -63,13 +63,13 @@ func (d *domain) updateVpnOnCluster(ctx ConsoleContext, ndev, xdev *entities.Con return errors.NewE(err) } - if (ndev.ProjectName != nil && ndev.EnvironmentName != nil) || ndev.ClusterName != nil { + if (ndev.EnvironmentName != nil) || ndev.ClusterName != nil { if err := d.applyVPNDevice(ctx, ndev); err != nil { return errors.NewE(err) } } - if (xdev.ProjectName != nil && (ndev.ProjectName == nil || *xdev.ProjectName != *ndev.ProjectName)) || + if (xdev.EnvironmentName != nil && (ndev.EnvironmentName == nil || *xdev.EnvironmentName != *ndev.EnvironmentName)) || (xdev.ClusterName != nil && (ndev.ClusterName == nil || *xdev.ClusterName != *ndev.ClusterName)) { xdev.Spec.Disabled = true if err := d.applyVPNDevice(ctx, xdev); err != nil { @@ -126,8 +126,8 @@ func (d *domain) GetVPNDevice(ctx ConsoleContext, name string) (*entities.Consol } func (d *domain) applyVPNDevice(ctx ConsoleContext, device *entities.ConsoleVPNDevice) error { - if device.ProjectName != nil { - if err := d.applyK8sResource(ctx, *device.ProjectName, &device.Device, device.RecordVersion); err != nil { + if device.EnvironmentName != nil { + if err := d.applyK8sResource(ctx, *device.EnvironmentName, &device.Device, device.RecordVersion); err != nil { return errors.NewE(err) } @@ -168,8 +168,8 @@ func (d *domain) CreateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPND device.SyncStatus = t.GenSyncStatus(t.SyncActionApply, device.RecordVersion) - if device.ProjectName != nil && device.EnvironmentName != nil { - s, err := d.envTargetNamespace(ctx, *device.ProjectName, *device.EnvironmentName) + if device.EnvironmentName != nil { + s, err := d.envTargetNamespace(ctx, *device.EnvironmentName) if err != nil { return nil, errors.NewE(err) } @@ -204,7 +204,7 @@ func (d *domain) CreateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPND d.resourceEventPublisher.PublishConsoleEvent(ctx, entities.ResourceTypeVPNDevice, nDevice.Name, PublishAdd) - if device.ProjectName == nil || device.EnvironmentName == nil { + if device.EnvironmentName == nil { return nDevice, nil } @@ -246,7 +246,7 @@ func (d *domain) ActivateVPNDeviceOnNamespace(ctx ConsoleContext, devName string return nil } -func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice, projectName, envName, clusterName *string) (*entities.ConsoleVPNDevice, error) { +func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice, envName, clusterName *string) (*entities.ConsoleVPNDevice, error) { if err := d.canPerformActionInDevice(ctx, iamT.UpdateVPNDevice, device.Name); err != nil { return nil, errors.NewE(err) } @@ -264,14 +264,14 @@ func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPND linkedClusters = append(linkedClusters, *clusterName) } - if projectName != nil && envName != nil { - activeNamespace, err := d.envTargetNamespace(ctx, *projectName, *envName) + if envName != nil { + activeNamespace, err := d.envTargetNamespace(ctx, *envName) if err != nil { return nil, errors.NewE(err) } device.Spec.ActiveNamespace = &activeNamespace - cName, err := d.getClusterAttachedToProject(ctx, *projectName) + cName, err := d.getClusterAttachedToEnvironment(ctx, *envName) if err != nil { return nil, errors.NewE(err) } @@ -285,7 +285,7 @@ func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPND if clusterName != nil { device.ClusterName = clusterName - device.ProjectName = nil + device.EnvironmentName = nil device.EnvironmentName = nil } @@ -295,7 +295,6 @@ func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPND common.PatchOpts{ XPatch: repos.Document{ fc.ConsoleVPNDeviceSpec: device.Spec, - fields.ProjectName: device.ProjectName, fields.EnvironmentName: device.EnvironmentName, fields.ClusterName: device.ClusterName, fc.ConsoleVPNDeviceLinkedClusters: linkedClusters, @@ -320,7 +319,7 @@ func (d *domain) updateVpnDevice(ctx ConsoleContext, device entities.ConsoleVPND } func (d *domain) UpdateVPNDevice(ctx ConsoleContext, device entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) { - return d.updateVpnDevice(ctx, device, device.ProjectName, device.EnvironmentName, nil) + return d.updateVpnDevice(ctx, device, device.EnvironmentName, nil) } func (d *domain) DeleteVPNDevice(ctx ConsoleContext, name string) error { @@ -391,16 +390,15 @@ func (d *domain) UpdateVpnDevicePorts(ctx ConsoleContext, devName string, ports return nil } -func (d *domain) ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, projectName string, envName string) error { +func (d *domain) ActivateVpnDeviceOnEnvironment(ctx ConsoleContext, devName string, envName string) error { xdevice, err := d.findVPNDevice(ctx, devName) if err != nil { return errors.NewE(err) } - xdevice.ProjectName = &projectName xdevice.EnvironmentName = &envName - _, err = d.updateVpnDevice(ctx, *xdevice, xdevice.ProjectName, xdevice.EnvironmentName, nil) + _, err = d.updateVpnDevice(ctx, *xdevice, xdevice.EnvironmentName, nil) if err != nil { return errors.NewE(err) } @@ -420,7 +418,7 @@ func (d *domain) ActivateVpnDeviceOnCluster(ctx ConsoleContext, devName string, // TODO: check if cluster exists in account xdevice.ClusterName = &clusterName - _, err = d.updateVpnDevice(ctx, *xdevice, nil, nil, &clusterName) + _, err = d.updateVpnDevice(ctx, *xdevice, nil, &clusterName) if err != nil { return errors.NewE(err) } @@ -436,8 +434,8 @@ func (d *domain) OnVPNDeviceUpdateMessage(ctx ConsoleContext, device entities.Co recordVersion, err := d.MatchRecordVersion(device.Annotations, xdevice.RecordVersion) if err != nil { - if xdevice.ProjectName != nil { - return d.resyncK8sResource(ctx, *xdevice.ProjectName, xdevice.SyncStatus.Action, &xdevice.Device, xdevice.RecordVersion) + if xdevice.EnvironmentName != nil { + return d.resyncK8sResource(ctx, *xdevice.EnvironmentName, xdevice.SyncStatus.Action, &xdevice.Device, xdevice.RecordVersion) } } @@ -470,8 +468,8 @@ func (d *domain) OnVPNDeviceDeleteMessage(ctx ConsoleContext, device entities.Co } var linkedClusters []string - if device.ProjectName != nil { - clusterName, err := d.getClusterAttachedToProject(ctx, *device.ProjectName) + if device.EnvironmentName != nil { + clusterName, err := d.getClusterAttachedToEnvironment(ctx, *device.EnvironmentName) if err != nil { return errors.NewE(err) } diff --git a/apps/console/internal/entities/app.go b/apps/console/internal/entities/app.go index 74cf2fe87..d268b6791 100644 --- a/apps/console/internal/entities/app.go +++ b/apps/console/internal/entities/app.go @@ -17,7 +17,6 @@ type App struct { CIBuildId *repos.ID `json:"ciBuildId,omitempty" graphql:"scalar-type=ID"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` common.ResourceMetadata `json:",inline"` diff --git a/apps/console/internal/entities/config.go b/apps/console/internal/entities/config.go index ff001a5ea..671bd6a2f 100644 --- a/apps/console/internal/entities/config.go +++ b/apps/console/internal/entities/config.go @@ -15,7 +15,6 @@ type Config struct { corev1.ConfigMap `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` common.ResourceMetadata `json:",inline"` @@ -45,7 +44,6 @@ var ConfigIndexes = []repos.IndexField{ Field: []repos.IndexKey{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, diff --git a/apps/console/internal/entities/environment.go b/apps/console/internal/entities/environment.go index 6e537880e..68c98c0db 100644 --- a/apps/console/internal/entities/environment.go +++ b/apps/console/internal/entities/environment.go @@ -16,7 +16,8 @@ type Environment struct { crdsv1.Environment `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` + // ProjectName string `json:"projectName" graphql:"noinput"` + ClusterName string `json:"clusterName"` common.ResourceMetadata `json:",inline"` SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` @@ -46,21 +47,23 @@ var EnvironmentIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, + //{Key: fields.ProjectName, Value: repos.IndexAsc}, + {Key: fields.ClusterName, Value: repos.IndexAsc}, }, Unique: true, }, { Field: []repos.IndexKey{ {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fc.EnvironmentSpecProjectName, Value: repos.IndexAsc}, {Key: fc.EnvironmentSpecTargetNamespace, Value: repos.IndexAsc}, }, Unique: true, }, - { - Field: []repos.IndexKey{ - {Key: fc.EnvironmentSpecProjectName, Value: repos.IndexAsc}, - }, - }, +} + +func EnvironmentDBFilter(accountName string, envName string) repos.Filter { + return repos.Filter{ + fc.AccountName: accountName, + fc.MetadataName: envName, + } } diff --git a/apps/console/internal/entities/field-constants/generated_constants.go b/apps/console/internal/entities/field-constants/generated_constants.go index 5bc0ddb79..55745983d 100644 --- a/apps/console/internal/entities/field-constants/generated_constants.go +++ b/apps/console/internal/entities/field-constants/generated_constants.go @@ -52,7 +52,6 @@ const ( // constant vars generated for struct Environment const ( EnvironmentSpec = "spec" - EnvironmentSpecProjectName = "spec.projectName" EnvironmentSpecRouting = "spec.routing" EnvironmentSpecRoutingMode = "spec.routing.mode" EnvironmentSpecRoutingPrivateIngressClass = "spec.routing.privateIngressClass" @@ -112,29 +111,6 @@ const ( ManagedResourceSyncedOutputSecretRefType = "syncedOutputSecretRef.type" ) -// constant vars generated for struct Project -const ( - ProjectSpec = "spec" - ProjectSpecTargetNamespace = "spec.targetNamespace" -) - -// constant vars generated for struct ProjectManagedService -const ( - ProjectManagedServiceOutput = "output" - ProjectManagedServiceOutputCredentialsRef = "output.credentialsRef" - ProjectManagedServiceOutputCredentialsRefName = "output.credentialsRef.name" - ProjectManagedServiceSpec = "spec" - ProjectManagedServiceSpecMsvcSpec = "spec.msvcSpec" - ProjectManagedServiceSpecMsvcSpecNodeSelector = "spec.msvcSpec.nodeSelector" - ProjectManagedServiceSpecMsvcSpecServiceTemplate = "spec.msvcSpec.serviceTemplate" - ProjectManagedServiceSpecMsvcSpecServiceTemplateApiVersion = "spec.msvcSpec.serviceTemplate.apiVersion" - ProjectManagedServiceSpecMsvcSpecServiceTemplateKind = "spec.msvcSpec.serviceTemplate.kind" - ProjectManagedServiceSpecMsvcSpecServiceTemplateSpec = "spec.msvcSpec.serviceTemplate.spec" - ProjectManagedServiceSpecMsvcSpecTolerations = "spec.msvcSpec.tolerations" - ProjectManagedServiceSpecTargetNamespace = "spec.targetNamespace" - ProjectManagedServiceSyncedOutputSecretRef = "syncedOutputSecretRef" -) - // constant vars generated for struct ResourceMapping const ( ResourceMappingBaseEntity = "BaseEntity" diff --git a/apps/console/internal/entities/image-pull-secret.go b/apps/console/internal/entities/image-pull-secret.go index 8ba6d3c17..d0c3c4987 100644 --- a/apps/console/internal/entities/image-pull-secret.go +++ b/apps/console/internal/entities/image-pull-secret.go @@ -32,7 +32,6 @@ type ImagePullSecret struct { GeneratedK8sSecret corev1.Secret `json:"generatedK8sSecret,omitempty" graphql:"ignore" struct-json-path:",ignore-nesting"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` common.ResourceMetadata `json:",inline"` @@ -81,7 +80,6 @@ var ImagePullSecretIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/console/internal/entities/mres.go b/apps/console/internal/entities/mres.go index a51d762d7..426b58765 100644 --- a/apps/console/internal/entities/mres.go +++ b/apps/console/internal/entities/mres.go @@ -15,7 +15,6 @@ type ManagedResource struct { crdsv1.ManagedResource `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` // SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"noinput" struct-json-path:",ignore-nesting"` @@ -49,7 +48,6 @@ var MresIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/console/internal/entities/project-managed-service.go b/apps/console/internal/entities/project-managed-service.go index dd5a3a9a0..3493cd64c 100644 --- a/apps/console/internal/entities/project-managed-service.go +++ b/apps/console/internal/entities/project-managed-service.go @@ -1,54 +1,44 @@ package entities -import ( - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/pkg/repos" - t "github.com/kloudlite/api/pkg/types" - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "github.com/kloudlite/operator/pkg/operator" - corev1 "k8s.io/api/core/v1" -) - -type ProjectManagedService struct { - repos.BaseEntity `json:",inline" graphql:"noinput"` - crdsv1.ProjectManagedService `json:",inline"` - - AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` - - SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"ignore" struct-json-path:",ignore-nesting"` - - common.ResourceMetadata `json:",inline"` - SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` -} - -func (s *ProjectManagedService) GetDisplayName() string { - return s.ResourceMetadata.DisplayName -} - -func (s *ProjectManagedService) GetStatus() operator.Status { - return s.ProjectManagedService.Status -} - -// GetResourceType implements domain.resource. -func (*ProjectManagedService) GetResourceType() ResourceType { - return ResourceTypeProjectManagedService -} - -var ProjectManagedServiceIndices = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: fields.Id, Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: fields.MetadataName, Value: repos.IndexAsc}, - {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, - }, - Unique: true, - }, -} +//type ProjectManagedService struct { +// repos.BaseEntity `json:",inline" graphql:"noinput"` +// crdsv1.ProjectManagedService `json:",inline"` +// +// AccountName string `json:"accountName" graphql:"noinput"` +// ProjectName string `json:"projectName" graphql:"noinput"` +// +// SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"ignore" struct-json-path:",ignore-nesting"` +// +// common.ResourceMetadata `json:",inline"` +// SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +//} +// +//func (s *ProjectManagedService) GetDisplayName() string { +// return s.ResourceMetadata.DisplayName +//} +// +//func (s *ProjectManagedService) GetStatus() operator.Status { +// return s.ProjectManagedService.Status +//} +// +//// GetResourceType implements domain.resource. +//func (*ProjectManagedService) GetResourceType() ResourceType { +// return ResourceTypeProjectManagedService +//} +// +//var ProjectManagedServiceIndices = []repos.IndexField{ +// { +// Field: []repos.IndexKey{ +// {Key: fields.Id, Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +// { +// Field: []repos.IndexKey{ +// {Key: fields.MetadataName, Value: repos.IndexAsc}, +// {Key: fields.AccountName, Value: repos.IndexAsc}, +// {Key: fields.ProjectName, Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +//} diff --git a/apps/console/internal/entities/project.go b/apps/console/internal/entities/project.go index e848f84ab..cd87b635f 100644 --- a/apps/console/internal/entities/project.go +++ b/apps/console/internal/entities/project.go @@ -1,65 +1,65 @@ package entities -import ( - fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" - "github.com/kloudlite/api/common" - "github.com/kloudlite/api/common/fields" - "github.com/kloudlite/api/pkg/repos" - t "github.com/kloudlite/api/pkg/types" - crdsv1 "github.com/kloudlite/operator/apis/crds/v1" - "github.com/kloudlite/operator/pkg/operator" -) - -type Project struct { - repos.BaseEntity `json:",inline" graphql:"noinput"` - - crdsv1.Project `json:",inline"` - - common.ResourceMetadata `json:",inline"` - - AccountName string `json:"accountName" graphql:"noinput"` - ClusterName *string `json:"clusterName"` - - SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` -} - -func (p *Project) GetDisplayName() string { - return p.ResourceMetadata.DisplayName -} - -func (p *Project) GetStatus() operator.Status { - return p.Project.Status -} - -func (p *Project) GetResourceType() ResourceType { - return ResourceTypeProject -} - -var ProjectIndexes = []repos.IndexField{ - { - Field: []repos.IndexKey{ - {Key: fields.Id, Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: fields.MetadataName, Value: repos.IndexAsc}, - {Key: fields.AccountName, Value: repos.IndexAsc}, - }, - Unique: true, - }, - { - Field: []repos.IndexKey{ - {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fc.ProjectSpecTargetNamespace, Value: repos.IndexAsc}, - }, - Unique: true, - }, - - { - Field: []repos.IndexKey{ - {Key: fields.ClusterName, Value: repos.IndexAsc}, - }, - }, -} +//import ( +// fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" +// "github.com/kloudlite/api/common" +// "github.com/kloudlite/api/common/fields" +// "github.com/kloudlite/api/pkg/repos" +// t "github.com/kloudlite/api/pkg/types" +// crdsv1 "github.com/kloudlite/operator/apis/crds/v1" +// "github.com/kloudlite/operator/pkg/operator" +//) +// +//type Project struct { +// repos.BaseEntity `json:",inline" graphql:"noinput"` +// +// crdsv1.Project `json:",inline"` +// +// common.ResourceMetadata `json:",inline"` +// +// AccountName string `json:"accountName" graphql:"noinput"` +// ClusterName *string `json:"clusterName"` +// +// SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` +//} +// +//func (p *Project) GetDisplayName() string { +// return p.ResourceMetadata.DisplayName +//} +// +//func (p *Project) GetStatus() operator.Status { +// return p.Project.Status +//} +// +//func (p *Project) GetResourceType() ResourceType { +// return ResourceTypeProject +//} +// +//var ProjectIndexes = []repos.IndexField{ +// { +// Field: []repos.IndexKey{ +// {Key: fields.Id, Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +// { +// Field: []repos.IndexKey{ +// {Key: fields.MetadataName, Value: repos.IndexAsc}, +// {Key: fields.AccountName, Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +// { +// Field: []repos.IndexKey{ +// {Key: fields.AccountName, Value: repos.IndexAsc}, +// {Key: fc.ProjectSpecTargetNamespace, Value: repos.IndexAsc}, +// }, +// Unique: true, +// }, +// +// { +// Field: []repos.IndexKey{ +// {Key: fields.ClusterName, Value: repos.IndexAsc}, +// }, +// }, +//} diff --git a/apps/console/internal/entities/resource-mapping.go b/apps/console/internal/entities/resource-mapping.go index 37f88c189..65988b80e 100644 --- a/apps/console/internal/entities/resource-mapping.go +++ b/apps/console/internal/entities/resource-mapping.go @@ -9,7 +9,6 @@ import ( type ResourceType string const ( - ResourceTypeProject ResourceType = "project" ResourceTypeEnvironment ResourceType = "environment" ResourceTypeApp ResourceType = "app" ResourceTypeConfig ResourceType = "config" @@ -24,7 +23,6 @@ const ( type ResourceHeirarchy string const ( - ResourceHeirarchyProject ResourceHeirarchy = "project" ResourceHeirarchyEnvironment ResourceHeirarchy = "environment" ) @@ -40,7 +38,7 @@ type ResourceMapping struct { AccountName string `json:"accountName"` ClusterName string `json:"clusterName"` - ProjectName string `json:"projectName"` + // ProjectName string `json:"projectName"` EnvironmentName string `json:"environmentName"` } diff --git a/apps/console/internal/entities/router.go b/apps/console/internal/entities/router.go index 3632b1c85..56c1826a8 100644 --- a/apps/console/internal/entities/router.go +++ b/apps/console/internal/entities/router.go @@ -14,7 +14,6 @@ type Router struct { crdsv1.Router `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` common.ResourceMetadata `json:",inline"` @@ -45,7 +44,6 @@ var RouterIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/console/internal/entities/secret.go b/apps/console/internal/entities/secret.go index bab91e25e..e43e4ce8d 100644 --- a/apps/console/internal/entities/secret.go +++ b/apps/console/internal/entities/secret.go @@ -14,7 +14,6 @@ type Secret struct { corev1.Secret `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName string `json:"projectName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` common.ResourceMetadata `json:",inline"` @@ -47,7 +46,6 @@ var SecretIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/gateway/Dockerfile b/apps/gateway/Dockerfile index 9827f933b..6dcbd9249 100644 --- a/apps/gateway/Dockerfile +++ b/apps/gateway/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /home/node RUN --mount=type=bind,source=package.json,target=package.json \ --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \ --mount=type=cache,target=/root/.local/share/pnpm/store \ - pnpm i + pnpm i --frozen-lockfile USER node COPY --chown=node . ./ COPY . ./ From 5639f0c54837beb7c27f9d81263d6db6a2e2a830 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Tue, 30 Apr 2024 13:33:21 +0530 Subject: [PATCH 3/4] feat: removes project also from graphql query and mutations - cluster managed services, `spec.targetNamespace` is not required via grpahql now --- .tools/nvim/__http__/console/apps.graphql.yml | 45 +- .../__http__/console/environments.graphql.yml | 11 +- .../internal/app/graph/generated/generated.go | 1706 ++++++----------- .../internal/app/graph/schema.graphqls | 129 +- .../internal/app/graph/schema.resolvers.go | 112 +- .../consolevpndevice.graphqls | 2 - apps/console/internal/domain/environment.go | 9 +- apps/console/internal/entities/app.go | 1 - apps/console/internal/entities/environment.go | 2 - .../field-constants/generated_constants.go | 1 - apps/console/internal/entities/mres.go | 1 - .../internal/entities/resource-mapping.go | 18 +- apps/console/internal/entities/vpn-device.go | 1 - .../internal/app/graph/generated/generated.go | 88 +- .../internal/app/graph/model/models_gen.go | 3 +- .../internal/app/graph/schema.resolvers.go | 12 +- .../struct-to-graphql/common-types.graphqls | 1 - .../globalvpndevice.graphqls | 2 + apps/tenant-agent/main.go | 3 +- 19 files changed, 824 insertions(+), 1323 deletions(-) diff --git a/.tools/nvim/__http__/console/apps.graphql.yml b/.tools/nvim/__http__/console/apps.graphql.yml index b3d9f3609..c5c909fe8 100644 --- a/.tools/nvim/__http__/console/apps.graphql.yml +++ b/.tools/nvim/__http__/console/apps.graphql.yml @@ -5,8 +5,8 @@ global: label: List Apps query: |+ #graphql - query Core_listApps($projectName: String!, $envName: String!) { - core_listApps(projectName: $projectName, envName: $envName) { + query Core_listApps($envName: String!) { + core_listApps(envName: $envName) { edges { node { id @@ -20,13 +20,6 @@ query: |+ #graphql name annotations } - build { - id - source { - repository - branch - } - } syncStatus { state action @@ -34,7 +27,6 @@ query: |+ #graphql syncScheduledAt recordVersion } - projectName recordVersion kind displayName @@ -44,14 +36,13 @@ query: |+ #graphql } } variables: - projectName: "{{.projectName}}" - envName: "{{.environmentName}}" + envName: "{{.envName}}" --- label: Get App query: |+ #graphql - query Core_getApp($project: ProjectId!, $scope: WorkspaceOrEnvId!, $name: String!) { - core_getApp(project: $project, scope: $scope, name: $name) { + query Core_getApp($scope: WorkspaceOrEnvId!, $name: String!) { + core_getApp(scope: $scope, name: $name) { metadata { name deletionTimestamp @@ -79,8 +70,8 @@ variables: label: Create App query: |+ #graphql - mutation Core_createApp($projectName: String!, $envName: String!, $app: AppIn!) { - core_createApp(projectName: $projectName, envName: $envName, app: $app) { + mutation Core_createApp($envName: String!, $app: AppIn!) { + core_createApp(envName: $envName, app: $app) { metadata { name } @@ -99,13 +90,11 @@ query: |+ #graphql } } variables: - projectName: "{{.projectName}}" envName: "{{.envName}}" app: displayName: "sample app" metadata: name: "{{.name}}" - # name: "SAMPLE2" spec: services: - type: tcp @@ -119,8 +108,8 @@ variables: label: Update App query: |+ #graphql - mutation Core_updateApp($projectName: String!, $envName: String!, $app: AppIn!) { - core_updateApp(projectName: $projectName, envName: $envName, app: $app) { + mutation Core_updateApp($envName: String!, $app: AppIn!) { + core_updateApp(envName: $envName, app: $app) { metadata { name generation @@ -133,7 +122,6 @@ query: |+ #graphql } } variables: - projectName: "{{.projectName}}" envName: "{{.envName}}" app: displayName: "sample app" @@ -153,23 +141,20 @@ variables: label: Delete App query: |+ #graphql - mutation Core_deleteApp($projectName: String!, $envName: String!, $appName: String!) { - core_deleteApp(projectName: $projectName, envName: $envName, appName: $appName) + mutation Core_deleteApp($envName: String!, $appName: String!) { + core_deleteApp(envName: $envName, appName: $appName) } variables: - projectName: "{{.projectName}}" envName: "{{.envName}}" appName: "{{.name}}" ---- --- label: restart app -query: |+ - query Query($projectName: String!, $envName: String!, $appName: String!) { - core_restartApp(projectName: $projectName, envName: $envName, appName: $appName) +query: |+ #graphql + query Query($envName: String!, $appName: String!) { + core_restartApp(envName: $envName, appName: $appName) } variables: - projectName: "{{.projectName}}" envName: "{{.envName}}" - appName: "nginx" + appName: "{{.name}}" --- diff --git a/.tools/nvim/__http__/console/environments.graphql.yml b/.tools/nvim/__http__/console/environments.graphql.yml index b9fa84ebc..22d3b3828 100644 --- a/.tools/nvim/__http__/console/environments.graphql.yml +++ b/.tools/nvim/__http__/console/environments.graphql.yml @@ -6,8 +6,8 @@ global: label: List Environments query: |+ #graphql - query Core_listEnvironments($projectName: String!) { - core_listEnvironments(projectName: $projectName) { + query Core_listEnvironments { + core_listEnvironments() { edges { cursor node { @@ -52,15 +52,13 @@ query: |+ #graphql totalCount } } -variables: - projectName: "{{.projectName}}" --- label: Create Environment query: |+ #graphql - mutation Core_createEnvironment($projectName: String!, $env: EnvironmentIn!) { - core_createEnvironment(projectName: $projectName, env: $env) { + mutation Core_createEnvironment($env: EnvironmentIn!) { + core_createEnvironment(env: $env) { apiVersion kind spec { @@ -76,7 +74,6 @@ query: |+ #graphql } } variables: - projectName: "{{.projectName}}" env: displayName: Display Name of a sample environment clusterName: "{{.gcpClusterName}}" diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index 003de27ea..73d76ce1b 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -181,7 +181,6 @@ type ComplexityRoot struct { LinkedClusters func(childComplexity int) int MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int - ProjectName func(childComplexity int) int RecordVersion func(childComplexity int) int Spec func(childComplexity int) int Status func(childComplexity int) int @@ -633,32 +632,32 @@ type ComplexityRoot struct { } Mutation struct { - CoreCloneEnvironment func(childComplexity int, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) int - CoreCreateApp func(childComplexity int, projectName string, envName string, app entities.App) int - CoreCreateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int - CoreCreateEnvironment func(childComplexity int, projectName string, env entities.Environment) int - CoreCreateImagePullSecret func(childComplexity int, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) int - CoreCreateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int - CoreCreateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int - CoreCreateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreCloneEnvironment func(childComplexity int, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) int + CoreCreateApp func(childComplexity int, envName string, app entities.App) int + CoreCreateConfig func(childComplexity int, envName string, config entities.Config) int + CoreCreateEnvironment func(childComplexity int, env entities.Environment) int + CoreCreateImagePullSecret func(childComplexity int, envName string, imagePullSecretIn entities.ImagePullSecret) int + CoreCreateManagedResource func(childComplexity int, envName string, mres entities.ManagedResource) int + CoreCreateRouter func(childComplexity int, envName string, router entities.Router) int + CoreCreateSecret func(childComplexity int, envName string, secret entities.Secret) int CoreCreateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int - CoreDeleteApp func(childComplexity int, projectName string, envName string, appName string) int - CoreDeleteConfig func(childComplexity int, projectName string, envName string, configName string) int - CoreDeleteEnvironment func(childComplexity int, projectName string, envName string) int - CoreDeleteImagePullSecret func(childComplexity int, projectName string, envName string, secretName string) int - CoreDeleteManagedResource func(childComplexity int, projectName string, envName string, mresName string) int - CoreDeleteRouter func(childComplexity int, projectName string, envName string, routerName string) int - CoreDeleteSecret func(childComplexity int, projectName string, envName string, secretName string) int + CoreDeleteApp func(childComplexity int, envName string, appName string) int + CoreDeleteConfig func(childComplexity int, envName string, configName string) int + CoreDeleteEnvironment func(childComplexity int, envName string) int + CoreDeleteImagePullSecret func(childComplexity int, envName string, secretName string) int + CoreDeleteManagedResource func(childComplexity int, envName string, mresName string) int + CoreDeleteRouter func(childComplexity int, envName string, routerName string) int + CoreDeleteSecret func(childComplexity int, envName string, secretName string) int CoreDeleteVPNDevice func(childComplexity int, deviceName string) int - CoreInterceptApp func(childComplexity int, projectName string, envName string, appname string, deviceName string, intercept bool) int - CoreUpdateApp func(childComplexity int, projectName string, envName string, app entities.App) int - CoreUpdateConfig func(childComplexity int, projectName string, envName string, config entities.Config) int - CoreUpdateEnvironment func(childComplexity int, projectName string, env entities.Environment) int - CoreUpdateManagedResource func(childComplexity int, projectName string, envName string, mres entities.ManagedResource) int - CoreUpdateRouter func(childComplexity int, projectName string, envName string, router entities.Router) int - CoreUpdateSecret func(childComplexity int, projectName string, envName string, secret entities.Secret) int + CoreInterceptApp func(childComplexity int, envName string, appname string, deviceName string, intercept bool) int + CoreUpdateApp func(childComplexity int, envName string, app entities.App) int + CoreUpdateConfig func(childComplexity int, envName string, config entities.Config) int + CoreUpdateEnvironment func(childComplexity int, env entities.Environment) int + CoreUpdateManagedResource func(childComplexity int, envName string, mres entities.ManagedResource) int + CoreUpdateRouter func(childComplexity int, envName string, router entities.Router) int + CoreUpdateSecret func(childComplexity int, envName string, secret entities.Secret) int CoreUpdateVPNDevice func(childComplexity int, vpnDevice entities.ConsoleVPNDevice) int - CoreUpdateVPNDeviceEnv func(childComplexity int, deviceName string, projectName string, envName string) int + CoreUpdateVPNDeviceEnv func(childComplexity int, deviceName string, envName string) int CoreUpdateVPNDevicePorts func(childComplexity int, deviceName string, ports []*v11.Port) int CoreUpdateVpnClusterName func(childComplexity int, deviceName string, clusterName string) int CoreUpdateVpnDeviceNs func(childComplexity int, deviceName string, ns string) int @@ -677,36 +676,36 @@ type ComplexityRoot struct { } Query struct { - CoreCheckNameAvailability func(childComplexity int, projectName *string, envName *string, resType entities.ResourceType, name string) int - CoreGetApp func(childComplexity int, projectName string, envName string, name string) int - CoreGetConfig func(childComplexity int, projectName string, envName string, name string) int - CoreGetConfigValues func(childComplexity int, projectName string, envName string, queries []*domain.ConfigKeyRef) int - CoreGetEnvironment func(childComplexity int, projectName string, name string) int - CoreGetImagePullSecret func(childComplexity int, projectName string, envName string, name string) int - CoreGetManagedResouceOutputKeyValues func(childComplexity int, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) int - CoreGetManagedResouceOutputKeys func(childComplexity int, projectName string, envName string, name string) int - CoreGetManagedResource func(childComplexity int, projectName string, envName string, name string) int - CoreGetRouter func(childComplexity int, projectName string, envName string, name string) int - CoreGetSecret func(childComplexity int, projectName string, envName string, name string) int - CoreGetSecretValues func(childComplexity int, projectName string, envName string, queries []*domain.SecretKeyRef) int + CoreCheckNameAvailability func(childComplexity int, envName *string, resType entities.ResourceType, name string) int + CoreGetApp func(childComplexity int, envName string, name string) int + CoreGetConfig func(childComplexity int, envName string, name string) int + CoreGetConfigValues func(childComplexity int, envName string, queries []*domain.ConfigKeyRef) int + CoreGetEnvironment func(childComplexity int, name string) int + CoreGetImagePullSecret func(childComplexity int, envName string, name string) int + CoreGetManagedResouceOutputKeyValues func(childComplexity int, envName string, keyrefs []*domain.ManagedResourceKeyRef) int + CoreGetManagedResouceOutputKeys func(childComplexity int, envName string, name string) int + CoreGetManagedResource func(childComplexity int, envName string, name string) int + CoreGetRouter func(childComplexity int, envName string, name string) int + CoreGetSecret func(childComplexity int, envName string, name string) int + CoreGetSecretValues func(childComplexity int, envName string, queries []*domain.SecretKeyRef) int CoreGetVPNDevice func(childComplexity int, name string) int - CoreListApps func(childComplexity int, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) int - CoreListConfigs func(childComplexity int, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) int - CoreListEnvironments func(childComplexity int, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) int - CoreListImagePullSecrets func(childComplexity int, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) int - CoreListManagedResources func(childComplexity int, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) int - CoreListRouters func(childComplexity int, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) int - CoreListSecrets func(childComplexity int, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) int + CoreListApps func(childComplexity int, envName string, search *model.SearchApps, pq *repos.CursorPagination) int + CoreListConfigs func(childComplexity int, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) int + CoreListEnvironments func(childComplexity int, search *model.SearchEnvironments, pq *repos.CursorPagination) int + CoreListImagePullSecrets func(childComplexity int, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) int + CoreListManagedResources func(childComplexity int, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) int + CoreListRouters func(childComplexity int, envName string, search *model.SearchRouters, pq *repos.CursorPagination) int + CoreListSecrets func(childComplexity int, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) int CoreListVPNDevices func(childComplexity int, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) int CoreListVPNDevicesForUser func(childComplexity int) int - CoreRestartApp func(childComplexity int, projectName string, envName string, appName string) int - CoreResyncApp func(childComplexity int, projectName string, envName string, name string) int - CoreResyncConfig func(childComplexity int, projectName string, envName string, name string) int - CoreResyncEnvironment func(childComplexity int, projectName string, name string) int - CoreResyncImagePullSecret func(childComplexity int, projectName string, envName string, name string) int - CoreResyncManagedResource func(childComplexity int, projectName string, envName string, name string) int - CoreResyncRouter func(childComplexity int, projectName string, envName string, name string) int - CoreResyncSecret func(childComplexity int, projectName string, envName string, name string) int + CoreRestartApp func(childComplexity int, envName string, appName string) int + CoreResyncApp func(childComplexity int, envName string, name string) int + CoreResyncConfig func(childComplexity int, envName string, name string) int + CoreResyncEnvironment func(childComplexity int, name string) int + CoreResyncImagePullSecret func(childComplexity int, envName string, name string) int + CoreResyncManagedResource func(childComplexity int, envName string, name string) int + CoreResyncRouter func(childComplexity int, envName string, name string) int + CoreResyncSecret func(childComplexity int, envName string, name string) int __resolve__service func(childComplexity int) int __resolve_entities func(childComplexity int, representations []map[string]interface{}) int } @@ -869,64 +868,64 @@ type MetadataResolver interface { Labels(ctx context.Context, obj *v13.ObjectMeta) (map[string]interface{}, error) } type MutationResolver interface { - CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) - CoreUpdateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) - CoreDeleteEnvironment(ctx context.Context, projectName string, envName string) (bool, error) - CoreCloneEnvironment(ctx context.Context, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) (*entities.Environment, error) - CoreCreateImagePullSecret(ctx context.Context, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) - CoreDeleteImagePullSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) - CoreCreateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) - CoreUpdateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) - CoreDeleteApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) - CoreInterceptApp(ctx context.Context, projectName string, envName string, appname string, deviceName string, intercept bool) (bool, error) - CoreCreateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) - CoreUpdateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) - CoreDeleteConfig(ctx context.Context, projectName string, envName string, configName string) (bool, error) - CoreCreateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) - CoreUpdateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) - CoreDeleteSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) - CoreCreateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) - CoreUpdateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) - CoreDeleteRouter(ctx context.Context, projectName string, envName string, routerName string) (bool, error) - CoreCreateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) - CoreUpdateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) - CoreDeleteManagedResource(ctx context.Context, projectName string, envName string, mresName string) (bool, error) + CoreCreateEnvironment(ctx context.Context, env entities.Environment) (*entities.Environment, error) + CoreUpdateEnvironment(ctx context.Context, env entities.Environment) (*entities.Environment, error) + CoreDeleteEnvironment(ctx context.Context, envName string) (bool, error) + CoreCloneEnvironment(ctx context.Context, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v1.EnvironmentRoutingMode) (*entities.Environment, error) + CoreCreateImagePullSecret(ctx context.Context, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) + CoreDeleteImagePullSecret(ctx context.Context, envName string, secretName string) (bool, error) + CoreCreateApp(ctx context.Context, envName string, app entities.App) (*entities.App, error) + CoreUpdateApp(ctx context.Context, envName string, app entities.App) (*entities.App, error) + CoreDeleteApp(ctx context.Context, envName string, appName string) (bool, error) + CoreInterceptApp(ctx context.Context, envName string, appname string, deviceName string, intercept bool) (bool, error) + CoreCreateConfig(ctx context.Context, envName string, config entities.Config) (*entities.Config, error) + CoreUpdateConfig(ctx context.Context, envName string, config entities.Config) (*entities.Config, error) + CoreDeleteConfig(ctx context.Context, envName string, configName string) (bool, error) + CoreCreateSecret(ctx context.Context, envName string, secret entities.Secret) (*entities.Secret, error) + CoreUpdateSecret(ctx context.Context, envName string, secret entities.Secret) (*entities.Secret, error) + CoreDeleteSecret(ctx context.Context, envName string, secretName string) (bool, error) + CoreCreateRouter(ctx context.Context, envName string, router entities.Router) (*entities.Router, error) + CoreUpdateRouter(ctx context.Context, envName string, router entities.Router) (*entities.Router, error) + CoreDeleteRouter(ctx context.Context, envName string, routerName string) (bool, error) + CoreCreateManagedResource(ctx context.Context, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) + CoreUpdateManagedResource(ctx context.Context, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) + CoreDeleteManagedResource(ctx context.Context, envName string, mresName string) (bool, error) CoreCreateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) CoreUpdateVPNDevice(ctx context.Context, vpnDevice entities.ConsoleVPNDevice) (*entities.ConsoleVPNDevice, error) CoreUpdateVPNDevicePorts(ctx context.Context, deviceName string, ports []*v11.Port) (bool, error) - CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, projectName string, envName string) (bool, error) + CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, envName string) (bool, error) CoreUpdateVpnDeviceNs(ctx context.Context, deviceName string, ns string) (bool, error) CoreUpdateVpnClusterName(ctx context.Context, deviceName string, clusterName string) (bool, error) CoreDeleteVPNDevice(ctx context.Context, deviceName string) (bool, error) } type QueryResolver interface { - CoreCheckNameAvailability(ctx context.Context, projectName *string, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) - CoreListEnvironments(ctx context.Context, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) - CoreGetEnvironment(ctx context.Context, projectName string, name string) (*entities.Environment, error) - CoreResyncEnvironment(ctx context.Context, projectName string, name string) (bool, error) - CoreListImagePullSecrets(ctx context.Context, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) - CoreGetImagePullSecret(ctx context.Context, projectName string, envName string, name string) (*entities.ImagePullSecret, error) - CoreResyncImagePullSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreListApps(ctx context.Context, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) - CoreGetApp(ctx context.Context, projectName string, envName string, name string) (*entities.App, error) - CoreResyncApp(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreRestartApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) - CoreGetConfigValues(ctx context.Context, projectName string, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) - CoreListConfigs(ctx context.Context, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) - CoreGetConfig(ctx context.Context, projectName string, envName string, name string) (*entities.Config, error) - CoreResyncConfig(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreGetSecretValues(ctx context.Context, projectName string, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) - CoreListSecrets(ctx context.Context, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) - CoreGetSecret(ctx context.Context, projectName string, envName string, name string) (*entities.Secret, error) - CoreResyncSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreListRouters(ctx context.Context, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) - CoreGetRouter(ctx context.Context, projectName string, envName string, name string) (*entities.Router, error) - CoreResyncRouter(ctx context.Context, projectName string, envName string, name string) (bool, error) - CoreGetManagedResouceOutputKeys(ctx context.Context, projectName string, envName string, name string) ([]string, error) - CoreGetManagedResouceOutputKeyValues(ctx context.Context, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) - CoreListManagedResources(ctx context.Context, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) - CoreGetManagedResource(ctx context.Context, projectName string, envName string, name string) (*entities.ManagedResource, error) - CoreResyncManagedResource(ctx context.Context, projectName string, envName string, name string) (bool, error) + CoreCheckNameAvailability(ctx context.Context, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) + CoreListEnvironments(ctx context.Context, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) + CoreGetEnvironment(ctx context.Context, name string) (*entities.Environment, error) + CoreResyncEnvironment(ctx context.Context, name string) (bool, error) + CoreListImagePullSecrets(ctx context.Context, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) + CoreGetImagePullSecret(ctx context.Context, envName string, name string) (*entities.ImagePullSecret, error) + CoreResyncImagePullSecret(ctx context.Context, envName string, name string) (bool, error) + CoreListApps(ctx context.Context, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) + CoreGetApp(ctx context.Context, envName string, name string) (*entities.App, error) + CoreResyncApp(ctx context.Context, envName string, name string) (bool, error) + CoreRestartApp(ctx context.Context, envName string, appName string) (bool, error) + CoreGetConfigValues(ctx context.Context, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) + CoreListConfigs(ctx context.Context, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) + CoreGetConfig(ctx context.Context, envName string, name string) (*entities.Config, error) + CoreResyncConfig(ctx context.Context, envName string, name string) (bool, error) + CoreGetSecretValues(ctx context.Context, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) + CoreListSecrets(ctx context.Context, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) + CoreGetSecret(ctx context.Context, envName string, name string) (*entities.Secret, error) + CoreResyncSecret(ctx context.Context, envName string, name string) (bool, error) + CoreListRouters(ctx context.Context, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) + CoreGetRouter(ctx context.Context, envName string, name string) (*entities.Router, error) + CoreResyncRouter(ctx context.Context, envName string, name string) (bool, error) + CoreGetManagedResouceOutputKeys(ctx context.Context, envName string, name string) ([]string, error) + CoreGetManagedResouceOutputKeyValues(ctx context.Context, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) + CoreListManagedResources(ctx context.Context, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) + CoreGetManagedResource(ctx context.Context, envName string, name string) (*entities.ManagedResource, error) + CoreResyncManagedResource(ctx context.Context, envName string, name string) (bool, error) CoreListVPNDevices(ctx context.Context, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) (*model.ConsoleVPNDevicePaginatedRecords, error) CoreListVPNDevicesForUser(ctx context.Context) ([]*entities.ConsoleVPNDevice, error) CoreGetVPNDevice(ctx context.Context, name string) (*entities.ConsoleVPNDevice, error) @@ -962,7 +961,6 @@ type ConfigInResolver interface { } type ConsoleVPNDeviceInResolver interface { Metadata(ctx context.Context, obj *entities.ConsoleVPNDevice, data *v13.ObjectMeta) error - Spec(ctx context.Context, obj *entities.ConsoleVPNDevice, data *model.GithubComKloudliteOperatorApisWireguardV1DeviceSpecIn) error } type EnvironmentInResolver interface { @@ -1481,13 +1479,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ConsoleVPNDevice.ObjectMeta(childComplexity), true - case "ConsoleVPNDevice.projectName": - if e.complexity.ConsoleVPNDevice.ProjectName == nil { - break - } - - return e.complexity.ConsoleVPNDevice.ProjectName(childComplexity), true - case "ConsoleVPNDevice.recordVersion": if e.complexity.ConsoleVPNDevice.RecordVersion == nil { break @@ -3421,7 +3412,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCloneEnvironment(childComplexity, args["projectName"].(string), args["sourceEnvName"].(string), args["destinationEnvName"].(string), args["displayName"].(string), args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)), true + return e.complexity.Mutation.CoreCloneEnvironment(childComplexity, args["sourceEnvName"].(string), args["destinationEnvName"].(string), args["displayName"].(string), args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)), true case "Mutation.core_createApp": if e.complexity.Mutation.CoreCreateApp == nil { @@ -3433,7 +3424,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["app"].(entities.App)), true + return e.complexity.Mutation.CoreCreateApp(childComplexity, args["envName"].(string), args["app"].(entities.App)), true case "Mutation.core_createConfig": if e.complexity.Mutation.CoreCreateConfig == nil { @@ -3445,7 +3436,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["config"].(entities.Config)), true + return e.complexity.Mutation.CoreCreateConfig(childComplexity, args["envName"].(string), args["config"].(entities.Config)), true case "Mutation.core_createEnvironment": if e.complexity.Mutation.CoreCreateEnvironment == nil { @@ -3457,7 +3448,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.Environment)), true + return e.complexity.Mutation.CoreCreateEnvironment(childComplexity, args["env"].(entities.Environment)), true case "Mutation.core_createImagePullSecret": if e.complexity.Mutation.CoreCreateImagePullSecret == nil { @@ -3469,7 +3460,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["imagePullSecretIn"].(entities.ImagePullSecret)), true + return e.complexity.Mutation.CoreCreateImagePullSecret(childComplexity, args["envName"].(string), args["imagePullSecretIn"].(entities.ImagePullSecret)), true case "Mutation.core_createManagedResource": if e.complexity.Mutation.CoreCreateManagedResource == nil { @@ -3481,7 +3472,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true + return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["envName"].(string), args["mres"].(entities.ManagedResource)), true case "Mutation.core_createRouter": if e.complexity.Mutation.CoreCreateRouter == nil { @@ -3493,7 +3484,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["router"].(entities.Router)), true + return e.complexity.Mutation.CoreCreateRouter(childComplexity, args["envName"].(string), args["router"].(entities.Router)), true case "Mutation.core_createSecret": if e.complexity.Mutation.CoreCreateSecret == nil { @@ -3505,7 +3496,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreCreateSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secret"].(entities.Secret)), true + return e.complexity.Mutation.CoreCreateSecret(childComplexity, args["envName"].(string), args["secret"].(entities.Secret)), true case "Mutation.core_createVPNDevice": if e.complexity.Mutation.CoreCreateVPNDevice == nil { @@ -3529,7 +3520,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appName"].(string)), true + return e.complexity.Mutation.CoreDeleteApp(childComplexity, args["envName"].(string), args["appName"].(string)), true case "Mutation.core_deleteConfig": if e.complexity.Mutation.CoreDeleteConfig == nil { @@ -3541,7 +3532,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["configName"].(string)), true + return e.complexity.Mutation.CoreDeleteConfig(childComplexity, args["envName"].(string), args["configName"].(string)), true case "Mutation.core_deleteEnvironment": if e.complexity.Mutation.CoreDeleteEnvironment == nil { @@ -3553,7 +3544,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteEnvironment(childComplexity, args["projectName"].(string), args["envName"].(string)), true + return e.complexity.Mutation.CoreDeleteEnvironment(childComplexity, args["envName"].(string)), true case "Mutation.core_deleteImagePullSecret": if e.complexity.Mutation.CoreDeleteImagePullSecret == nil { @@ -3565,7 +3556,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secretName"].(string)), true + return e.complexity.Mutation.CoreDeleteImagePullSecret(childComplexity, args["envName"].(string), args["secretName"].(string)), true case "Mutation.core_deleteManagedResource": if e.complexity.Mutation.CoreDeleteManagedResource == nil { @@ -3577,7 +3568,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mresName"].(string)), true + return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["envName"].(string), args["mresName"].(string)), true case "Mutation.core_deleteRouter": if e.complexity.Mutation.CoreDeleteRouter == nil { @@ -3589,7 +3580,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["routerName"].(string)), true + return e.complexity.Mutation.CoreDeleteRouter(childComplexity, args["envName"].(string), args["routerName"].(string)), true case "Mutation.core_deleteSecret": if e.complexity.Mutation.CoreDeleteSecret == nil { @@ -3601,7 +3592,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreDeleteSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secretName"].(string)), true + return e.complexity.Mutation.CoreDeleteSecret(childComplexity, args["envName"].(string), args["secretName"].(string)), true case "Mutation.core_deleteVPNDevice": if e.complexity.Mutation.CoreDeleteVPNDevice == nil { @@ -3625,7 +3616,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreInterceptApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appname"].(string), args["deviceName"].(string), args["intercept"].(bool)), true + return e.complexity.Mutation.CoreInterceptApp(childComplexity, args["envName"].(string), args["appname"].(string), args["deviceName"].(string), args["intercept"].(bool)), true case "Mutation.core_updateApp": if e.complexity.Mutation.CoreUpdateApp == nil { @@ -3637,7 +3628,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["app"].(entities.App)), true + return e.complexity.Mutation.CoreUpdateApp(childComplexity, args["envName"].(string), args["app"].(entities.App)), true case "Mutation.core_updateConfig": if e.complexity.Mutation.CoreUpdateConfig == nil { @@ -3649,7 +3640,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["config"].(entities.Config)), true + return e.complexity.Mutation.CoreUpdateConfig(childComplexity, args["envName"].(string), args["config"].(entities.Config)), true case "Mutation.core_updateEnvironment": if e.complexity.Mutation.CoreUpdateEnvironment == nil { @@ -3661,7 +3652,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateEnvironment(childComplexity, args["projectName"].(string), args["env"].(entities.Environment)), true + return e.complexity.Mutation.CoreUpdateEnvironment(childComplexity, args["env"].(entities.Environment)), true case "Mutation.core_updateManagedResource": if e.complexity.Mutation.CoreUpdateManagedResource == nil { @@ -3673,7 +3664,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["mres"].(entities.ManagedResource)), true + return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["envName"].(string), args["mres"].(entities.ManagedResource)), true case "Mutation.core_updateRouter": if e.complexity.Mutation.CoreUpdateRouter == nil { @@ -3685,7 +3676,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["router"].(entities.Router)), true + return e.complexity.Mutation.CoreUpdateRouter(childComplexity, args["envName"].(string), args["router"].(entities.Router)), true case "Mutation.core_updateSecret": if e.complexity.Mutation.CoreUpdateSecret == nil { @@ -3697,7 +3688,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["secret"].(entities.Secret)), true + return e.complexity.Mutation.CoreUpdateSecret(childComplexity, args["envName"].(string), args["secret"].(entities.Secret)), true case "Mutation.core_updateVPNDevice": if e.complexity.Mutation.CoreUpdateVPNDevice == nil { @@ -3721,7 +3712,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.CoreUpdateVPNDeviceEnv(childComplexity, args["deviceName"].(string), args["projectName"].(string), args["envName"].(string)), true + return e.complexity.Mutation.CoreUpdateVPNDeviceEnv(childComplexity, args["deviceName"].(string), args["envName"].(string)), true case "Mutation.core_updateVPNDevicePorts": if e.complexity.Mutation.CoreUpdateVPNDevicePorts == nil { @@ -3811,7 +3802,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreCheckNameAvailability(childComplexity, args["projectName"].(*string), args["envName"].(*string), args["resType"].(entities.ResourceType), args["name"].(string)), true + return e.complexity.Query.CoreCheckNameAvailability(childComplexity, args["envName"].(*string), args["resType"].(entities.ResourceType), args["name"].(string)), true case "Query.core_getApp": if e.complexity.Query.CoreGetApp == nil { @@ -3823,7 +3814,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetApp(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getConfig": if e.complexity.Query.CoreGetConfig == nil { @@ -3835,7 +3826,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetConfig(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getConfigValues": if e.complexity.Query.CoreGetConfigValues == nil { @@ -3847,7 +3838,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetConfigValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["queries"].([]*domain.ConfigKeyRef)), true + return e.complexity.Query.CoreGetConfigValues(childComplexity, args["envName"].(string), args["queries"].([]*domain.ConfigKeyRef)), true case "Query.core_getEnvironment": if e.complexity.Query.CoreGetEnvironment == nil { @@ -3859,7 +3850,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetEnvironment(childComplexity, args["name"].(string)), true case "Query.core_getImagePullSecret": if e.complexity.Query.CoreGetImagePullSecret == nil { @@ -3871,7 +3862,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetImagePullSecret(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getManagedResouceOutputKeyValues": if e.complexity.Query.CoreGetManagedResouceOutputKeyValues == nil { @@ -3883,7 +3874,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetManagedResouceOutputKeyValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["keyrefs"].([]*domain.ManagedResourceKeyRef)), true + return e.complexity.Query.CoreGetManagedResouceOutputKeyValues(childComplexity, args["envName"].(string), args["keyrefs"].([]*domain.ManagedResourceKeyRef)), true case "Query.core_getManagedResouceOutputKeys": if e.complexity.Query.CoreGetManagedResouceOutputKeys == nil { @@ -3895,7 +3886,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetManagedResouceOutputKeys(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetManagedResouceOutputKeys(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getManagedResource": if e.complexity.Query.CoreGetManagedResource == nil { @@ -3907,7 +3898,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetManagedResource(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getRouter": if e.complexity.Query.CoreGetRouter == nil { @@ -3919,7 +3910,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetRouter(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getSecret": if e.complexity.Query.CoreGetSecret == nil { @@ -3931,7 +3922,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreGetSecret(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getSecretValues": if e.complexity.Query.CoreGetSecretValues == nil { @@ -3943,7 +3934,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreGetSecretValues(childComplexity, args["projectName"].(string), args["envName"].(string), args["queries"].([]*domain.SecretKeyRef)), true + return e.complexity.Query.CoreGetSecretValues(childComplexity, args["envName"].(string), args["queries"].([]*domain.SecretKeyRef)), true case "Query.core_getVPNDevice": if e.complexity.Query.CoreGetVPNDevice == nil { @@ -3967,7 +3958,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListApps(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchApps), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListApps(childComplexity, args["envName"].(string), args["search"].(*model.SearchApps), args["pq"].(*repos.CursorPagination)), true case "Query.core_listConfigs": if e.complexity.Query.CoreListConfigs == nil { @@ -3979,7 +3970,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListConfigs(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchConfigs), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListConfigs(childComplexity, args["envName"].(string), args["search"].(*model.SearchConfigs), args["pq"].(*repos.CursorPagination)), true case "Query.core_listEnvironments": if e.complexity.Query.CoreListEnvironments == nil { @@ -3991,7 +3982,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListEnvironments(childComplexity, args["projectName"].(string), args["search"].(*model.SearchEnvironments), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListEnvironments(childComplexity, args["search"].(*model.SearchEnvironments), args["pq"].(*repos.CursorPagination)), true case "Query.core_listImagePullSecrets": if e.complexity.Query.CoreListImagePullSecrets == nil { @@ -4003,7 +3994,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListImagePullSecrets(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchImagePullSecrets), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListImagePullSecrets(childComplexity, args["envName"].(string), args["search"].(*model.SearchImagePullSecrets), args["pq"].(*repos.CursorPagination)), true case "Query.core_listManagedResources": if e.complexity.Query.CoreListManagedResources == nil { @@ -4015,7 +4006,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListManagedResources(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchManagedResources), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListManagedResources(childComplexity, args["envName"].(string), args["search"].(*model.SearchManagedResources), args["pq"].(*repos.CursorPagination)), true case "Query.core_listRouters": if e.complexity.Query.CoreListRouters == nil { @@ -4027,7 +4018,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListRouters(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchRouters), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListRouters(childComplexity, args["envName"].(string), args["search"].(*model.SearchRouters), args["pq"].(*repos.CursorPagination)), true case "Query.core_listSecrets": if e.complexity.Query.CoreListSecrets == nil { @@ -4039,7 +4030,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreListSecrets(childComplexity, args["projectName"].(string), args["envName"].(string), args["search"].(*model.SearchSecrets), args["pq"].(*repos.CursorPagination)), true + return e.complexity.Query.CoreListSecrets(childComplexity, args["envName"].(string), args["search"].(*model.SearchSecrets), args["pq"].(*repos.CursorPagination)), true case "Query.core_listVPNDevices": if e.complexity.Query.CoreListVPNDevices == nil { @@ -4070,7 +4061,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreRestartApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["appName"].(string)), true + return e.complexity.Query.CoreRestartApp(childComplexity, args["envName"].(string), args["appName"].(string)), true case "Query.core_resyncApp": if e.complexity.Query.CoreResyncApp == nil { @@ -4082,7 +4073,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncApp(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncApp(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncConfig": if e.complexity.Query.CoreResyncConfig == nil { @@ -4094,7 +4085,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncConfig(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncConfig(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncEnvironment": if e.complexity.Query.CoreResyncEnvironment == nil { @@ -4106,7 +4097,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncEnvironment(childComplexity, args["projectName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncEnvironment(childComplexity, args["name"].(string)), true case "Query.core_resyncImagePullSecret": if e.complexity.Query.CoreResyncImagePullSecret == nil { @@ -4118,7 +4109,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncImagePullSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncImagePullSecret(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncManagedResource": if e.complexity.Query.CoreResyncManagedResource == nil { @@ -4130,7 +4121,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncRouter": if e.complexity.Query.CoreResyncRouter == nil { @@ -4142,7 +4133,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncRouter(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncRouter(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncSecret": if e.complexity.Query.CoreResyncSecret == nil { @@ -4154,7 +4145,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.CoreResyncSecret(childComplexity, args["projectName"].(string), args["envName"].(string), args["name"].(string)), true + return e.complexity.Query.CoreResyncSecret(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query._service": if e.complexity.Query.__resolve__service == nil { @@ -4709,7 +4700,6 @@ directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION enum ConsoleResType { - # project app config secret @@ -4790,50 +4780,50 @@ input CoreSearchVPNDevices { } type Query { - core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount + core_checkNameAvailability(envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount # core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount # core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount # core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount - core_resyncEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_listEnvironments(search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getEnvironment(name: String!): Environment @isLoggedInAndVerified @hasAccount + core_resyncEnvironment(name: String!): Boolean! @isLoggedInAndVerified @hasAccount # get image pull secrets - core_listImagePullSecrets(projectName: String!, envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getImagePullSecret(projectName: String!, envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount - core_resyncImagePullSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_listApps(projectName: String!, envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getApp(projectName: String!, envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount - core_resyncApp(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_restartApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getConfigValues(projectName: String!, envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount - core_listConfigs(projectName: String!, envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getConfig(projectName: String!, envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount - core_resyncConfig(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getSecretValues(projectName: String!, envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount - core_listSecrets(projectName: String!, envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getSecret(projectName: String!, envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount - core_resyncSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_listRouters(projectName: String!, envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getRouter(projectName: String!, envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount - core_resyncRouter(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getManagedResouceOutputKeys(projectName: String!, envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount - core_getManagedResouceOutputKeyValues(projectName: String!, envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount - core_listManagedResources(projectName: String!, envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount - core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount - core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - # core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount - # core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - # core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_listImagePullSecrets(envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getImagePullSecret(envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_resyncImagePullSecret(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listApps(envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getApp(envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount + core_resyncApp(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartApp(envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getConfigValues(envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listConfigs(envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getConfig(envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount + core_resyncConfig(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getSecretValues(envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listSecrets(envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getSecret(envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount + core_resyncSecret(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listRouters(envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getRouter(envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount + core_resyncRouter(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getManagedResouceOutputKeys(envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount + core_getManagedResouceOutputKeyValues(envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount + core_listManagedResources(envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getManagedResource(envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount + core_resyncManagedResource(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + # core_listProjectManagedServices(search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProjectManagedService( name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_resyncProjectManagedService(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_restartProjectManagedService(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount @@ -4845,46 +4835,46 @@ type Mutation { # core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount # core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount - core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount - core_deleteEnvironment(projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_cloneEnvironment(projectName: String!, sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount + core_createEnvironment(env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_updateEnvironment(env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_deleteEnvironment(envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_cloneEnvironment(sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount # image pull secrets - core_createImagePullSecret(projectName: String!, envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount - core_deleteImagePullSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createImagePullSecret(envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_deleteImagePullSecret(envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount - core_updateApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount - core_deleteApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_interceptApp(projectName: String!, envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount + core_createApp(envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_updateApp(envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_deleteApp(envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_interceptApp(envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount - core_createConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount - core_updateConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount - core_deleteConfig(projectName: String!, envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createConfig(envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_updateConfig(envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_deleteConfig(envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount - core_updateSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount - core_deleteSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createSecret(envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_updateSecret(envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_deleteSecret(envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount - core_updateRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount - core_deleteRouter(projectName: String!, envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createRouter(envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_updateRouter(envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_deleteRouter(envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount - core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount - core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createManagedResource(envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_updateManagedResource(envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_deleteManagedResource(envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount - # core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevicePorts(deviceName: String!,ports: [PortIn!]!): Boolean! @isLoggedInAndVerified @hasAccount - core_updateVPNDeviceEnv(deviceName: String!,projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVPNDeviceEnv(deviceName: String!,envName: String!): Boolean! @isLoggedInAndVerified @hasAccount core_updateVpnDeviceNs(deviceName: String!,ns: String!): Boolean! @isLoggedInAndVerified @hasAccount core_updateVpnClusterName(deviceName: String!,clusterName: String!): Boolean! @isLoggedInAndVerified @hasAccount @@ -5639,7 +5629,6 @@ input ConfigKeyValueRefIn { linkedClusters: [String!] markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String recordVersion: Int! spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec status: Github__com___kloudlite___operator___pkg___operator__Status @@ -5666,7 +5655,6 @@ input ConsoleVPNDeviceIn { environmentName: String kind: String metadata: MetadataIn - projectName: String spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn } @@ -6086,50 +6074,41 @@ func (ec *executionContext) field_Mutation_core_cloneEnvironment_args(ctx contex var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["sourceEnvName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sourceEnvName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["sourceEnvName"] = arg1 - var arg2 string + args["sourceEnvName"] = arg0 + var arg1 string if tmp, ok := rawArgs["destinationEnvName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("destinationEnvName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["destinationEnvName"] = arg2 - var arg3 string + args["destinationEnvName"] = arg1 + var arg2 string if tmp, ok := rawArgs["displayName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("displayName")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["displayName"] = arg3 - var arg4 v1.EnvironmentRoutingMode + args["displayName"] = arg2 + var arg3 v1.EnvironmentRoutingMode if tmp, ok := rawArgs["environmentRoutingMode"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("environmentRoutingMode")) - arg4, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx, tmp) + arg3, err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode2githubᚗcomᚋkloudliteᚋoperatorᚋapisᚋcrdsᚋv1ᚐEnvironmentRoutingMode(ctx, tmp) if err != nil { return nil, err } } - args["environmentRoutingMode"] = arg4 + args["environmentRoutingMode"] = arg3 return args, nil } @@ -6137,32 +6116,23 @@ func (ec *executionContext) field_Mutation_core_createApp_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.App + args["envName"] = arg0 + var arg1 entities.App if tmp, ok := rawArgs["app"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg2, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) + arg1, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) if err != nil { return nil, err } } - args["app"] = arg2 + args["app"] = arg1 return args, nil } @@ -6170,56 +6140,38 @@ func (ec *executionContext) field_Mutation_core_createConfig_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Config + args["envName"] = arg0 + var arg1 entities.Config if tmp, ok := rawArgs["config"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - arg2, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) + arg1, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) if err != nil { return nil, err } } - args["config"] = arg2 + args["config"] = arg1 return args, nil } func (ec *executionContext) field_Mutation_core_createEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 entities.Environment + var arg0 entities.Environment if tmp, ok := rawArgs["env"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg1, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) + arg0, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) if err != nil { return nil, err } } - args["env"] = arg1 + args["env"] = arg0 return args, nil } @@ -6227,32 +6179,23 @@ func (ec *executionContext) field_Mutation_core_createImagePullSecret_args(ctx c var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.ImagePullSecret + args["envName"] = arg0 + var arg1 entities.ImagePullSecret if tmp, ok := rawArgs["imagePullSecretIn"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imagePullSecretIn")) - arg2, err = ec.unmarshalNImagePullSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, tmp) + arg1, err = ec.unmarshalNImagePullSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐImagePullSecret(ctx, tmp) if err != nil { return nil, err } } - args["imagePullSecretIn"] = arg2 + args["imagePullSecretIn"] = arg1 return args, nil } @@ -6260,32 +6203,23 @@ func (ec *executionContext) field_Mutation_core_createManagedResource_args(ctx c var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.ManagedResource + args["envName"] = arg0 + var arg1 entities.ManagedResource if tmp, ok := rawArgs["mres"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) - arg2, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) + arg1, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) if err != nil { return nil, err } } - args["mres"] = arg2 + args["mres"] = arg1 return args, nil } @@ -6293,32 +6227,23 @@ func (ec *executionContext) field_Mutation_core_createRouter_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Router + args["envName"] = arg0 + var arg1 entities.Router if tmp, ok := rawArgs["router"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) - arg2, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) + arg1, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) if err != nil { return nil, err } } - args["router"] = arg2 + args["router"] = arg1 return args, nil } @@ -6326,32 +6251,23 @@ func (ec *executionContext) field_Mutation_core_createSecret_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Secret + args["envName"] = arg0 + var arg1 entities.Secret if tmp, ok := rawArgs["secret"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) - arg2, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) + arg1, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) if err != nil { return nil, err } } - args["secret"] = arg2 + args["secret"] = arg1 return args, nil } @@ -6374,32 +6290,23 @@ func (ec *executionContext) field_Mutation_core_deleteApp_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["appName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["appName"] = arg2 + args["appName"] = arg1 return args, nil } @@ -6407,32 +6314,23 @@ func (ec *executionContext) field_Mutation_core_deleteConfig_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["configName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("configName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["configName"] = arg2 + args["configName"] = arg1 return args, nil } @@ -6440,23 +6338,14 @@ func (ec *executionContext) field_Mutation_core_deleteEnvironment_args(ctx conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 + args["envName"] = arg0 return args, nil } @@ -6464,32 +6353,23 @@ func (ec *executionContext) field_Mutation_core_deleteImagePullSecret_args(ctx c var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["secretName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["secretName"] = arg2 + args["secretName"] = arg1 return args, nil } @@ -6497,32 +6377,23 @@ func (ec *executionContext) field_Mutation_core_deleteManagedResource_args(ctx c var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["mresName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["mresName"] = arg2 + args["mresName"] = arg1 return args, nil } @@ -6530,32 +6401,23 @@ func (ec *executionContext) field_Mutation_core_deleteRouter_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["routerName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("routerName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["routerName"] = arg2 + args["routerName"] = arg1 return args, nil } @@ -6563,32 +6425,23 @@ func (ec *executionContext) field_Mutation_core_deleteSecret_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["secretName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secretName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["secretName"] = arg2 + args["secretName"] = arg1 return args, nil } @@ -6611,50 +6464,41 @@ func (ec *executionContext) field_Mutation_core_interceptApp_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["appname"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appname")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["appname"] = arg2 - var arg3 string + args["appname"] = arg1 + var arg2 string if tmp, ok := rawArgs["deviceName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceName")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["deviceName"] = arg3 - var arg4 bool + args["deviceName"] = arg2 + var arg3 bool if tmp, ok := rawArgs["intercept"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("intercept")) - arg4, err = ec.unmarshalNBoolean2bool(ctx, tmp) + arg3, err = ec.unmarshalNBoolean2bool(ctx, tmp) if err != nil { return nil, err } } - args["intercept"] = arg4 + args["intercept"] = arg3 return args, nil } @@ -6662,32 +6506,23 @@ func (ec *executionContext) field_Mutation_core_updateApp_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.App + args["envName"] = arg0 + var arg1 entities.App if tmp, ok := rawArgs["app"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("app")) - arg2, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) + arg1, err = ec.unmarshalNAppIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, tmp) if err != nil { return nil, err } } - args["app"] = arg2 + args["app"] = arg1 return args, nil } @@ -6695,56 +6530,38 @@ func (ec *executionContext) field_Mutation_core_updateConfig_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Config + args["envName"] = arg0 + var arg1 entities.Config if tmp, ok := rawArgs["config"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("config")) - arg2, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) + arg1, err = ec.unmarshalNConfigIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, tmp) if err != nil { return nil, err } } - args["config"] = arg2 + args["config"] = arg1 return args, nil } func (ec *executionContext) field_Mutation_core_updateEnvironment_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 entities.Environment + var arg0 entities.Environment if tmp, ok := rawArgs["env"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("env")) - arg1, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) + arg0, err = ec.unmarshalNEnvironmentIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, tmp) if err != nil { return nil, err } } - args["env"] = arg1 + args["env"] = arg0 return args, nil } @@ -6752,32 +6569,23 @@ func (ec *executionContext) field_Mutation_core_updateManagedResource_args(ctx c var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.ManagedResource + args["envName"] = arg0 + var arg1 entities.ManagedResource if tmp, ok := rawArgs["mres"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mres")) - arg2, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) + arg1, err = ec.unmarshalNManagedResourceIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐManagedResource(ctx, tmp) if err != nil { return nil, err } } - args["mres"] = arg2 + args["mres"] = arg1 return args, nil } @@ -6785,32 +6593,23 @@ func (ec *executionContext) field_Mutation_core_updateRouter_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Router + args["envName"] = arg0 + var arg1 entities.Router if tmp, ok := rawArgs["router"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("router")) - arg2, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) + arg1, err = ec.unmarshalNRouterIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, tmp) if err != nil { return nil, err } } - args["router"] = arg2 + args["router"] = arg1 return args, nil } @@ -6818,32 +6617,23 @@ func (ec *executionContext) field_Mutation_core_updateSecret_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.Secret + args["envName"] = arg0 + var arg1 entities.Secret if tmp, ok := rawArgs["secret"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("secret")) - arg2, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) + arg1, err = ec.unmarshalNSecretIn2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐSecret(ctx, tmp) if err != nil { return nil, err } } - args["secret"] = arg2 + args["secret"] = arg1 return args, nil } @@ -6860,23 +6650,14 @@ func (ec *executionContext) field_Mutation_core_updateVPNDeviceEnv_args(ctx cont } args["deviceName"] = arg0 var arg1 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg1 - var arg2 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg2 + args["envName"] = arg1 return args, nil } @@ -7001,41 +6782,32 @@ func (ec *executionContext) field_Query_core_checkNameAvailability_args(ctx cont var err error args := map[string]interface{}{} var arg0 *string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 *string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 entities.ResourceType + args["envName"] = arg0 + var arg1 entities.ResourceType if tmp, ok := rawArgs["resType"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("resType")) - arg2, err = ec.unmarshalNConsoleResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐResourceType(ctx, tmp) + arg1, err = ec.unmarshalNConsoleResType2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐResourceType(ctx, tmp) if err != nil { return nil, err } } - args["resType"] = arg2 - var arg3 string + args["resType"] = arg1 + var arg2 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg3, err = ec.unmarshalNString2string(ctx, tmp) + arg2, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg3 + args["name"] = arg2 return args, nil } @@ -7043,32 +6815,23 @@ func (ec *executionContext) field_Query_core_getApp_args(ctx context.Context, ra var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7076,32 +6839,23 @@ func (ec *executionContext) field_Query_core_getConfigValues_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 []*domain.ConfigKeyRef + args["envName"] = arg0 + var arg1 []*domain.ConfigKeyRef if tmp, ok := rawArgs["queries"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) - arg2, err = ec.unmarshalOConfigKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx, tmp) + arg1, err = ec.unmarshalOConfigKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyRef(ctx, tmp) if err != nil { return nil, err } } - args["queries"] = arg2 + args["queries"] = arg1 return args, nil } @@ -7109,32 +6863,23 @@ func (ec *executionContext) field_Query_core_getConfig_args(ctx context.Context, var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7142,23 +6887,14 @@ func (ec *executionContext) field_Query_core_getEnvironment_args(ctx context.Con var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 + args["name"] = arg0 return args, nil } @@ -7166,32 +6902,23 @@ func (ec *executionContext) field_Query_core_getImagePullSecret_args(ctx context var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7199,32 +6926,23 @@ func (ec *executionContext) field_Query_core_getManagedResouceOutputKeyValues_ar var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 []*domain.ManagedResourceKeyRef + args["envName"] = arg0 + var arg1 []*domain.ManagedResourceKeyRef if tmp, ok := rawArgs["keyrefs"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyrefs")) - arg2, err = ec.unmarshalOManagedResourceKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx, tmp) + arg1, err = ec.unmarshalOManagedResourceKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐManagedResourceKeyRef(ctx, tmp) if err != nil { return nil, err } } - args["keyrefs"] = arg2 + args["keyrefs"] = arg1 return args, nil } @@ -7232,32 +6950,23 @@ func (ec *executionContext) field_Query_core_getManagedResouceOutputKeys_args(ct var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7265,32 +6974,23 @@ func (ec *executionContext) field_Query_core_getManagedResource_args(ctx context var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7298,32 +6998,23 @@ func (ec *executionContext) field_Query_core_getRouter_args(ctx context.Context, var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7331,32 +7022,23 @@ func (ec *executionContext) field_Query_core_getSecretValues_args(ctx context.Co var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 []*domain.SecretKeyRef + args["envName"] = arg0 + var arg1 []*domain.SecretKeyRef if tmp, ok := rawArgs["queries"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) - arg2, err = ec.unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx, tmp) + arg1, err = ec.unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx, tmp) if err != nil { return nil, err } } - args["queries"] = arg2 + args["queries"] = arg1 return args, nil } @@ -7364,32 +7046,23 @@ func (ec *executionContext) field_Query_core_getSecret_args(ctx context.Context, var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7412,102 +7085,174 @@ func (ec *executionContext) field_Query_core_listApps_args(ctx context.Context, var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["projectName"] = arg0 - var arg1 string + args["envName"] = arg0 + var arg1 *model.SearchApps + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchApps(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_listConfigs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 *model.SearchApps + args["envName"] = arg0 + var arg1 *model.SearchConfigs if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchApps(ctx, tmp) + arg1, err = ec.unmarshalOSearchConfigs2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchConfigs(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg1 + var arg2 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg2 return args, nil } -func (ec *executionContext) field_Query_core_listConfigs_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_listEnvironments_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.SearchEnvironments + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg0, err = ec.unmarshalOSearchEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchEnvironments(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg0 + var arg1 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_listImagePullSecrets_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["projectName"] = arg0 - var arg1 string + args["envName"] = arg0 + var arg1 *model.SearchImagePullSecrets + if tmp, ok := rawArgs["search"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) + arg1, err = ec.unmarshalOSearchImagePullSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchImagePullSecrets(ctx, tmp) + if err != nil { + return nil, err + } + } + args["search"] = arg1 + var arg2 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_core_listManagedResources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 *model.SearchConfigs + args["envName"] = arg0 + var arg1 *model.SearchManagedResources if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchConfigs2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchConfigs(ctx, tmp) + arg1, err = ec.unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchManagedResources(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg1 + var arg2 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg2 return args, nil } -func (ec *executionContext) field_Query_core_listEnvironments_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_listRouters_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["projectName"] = arg0 - var arg1 *model.SearchEnvironments + args["envName"] = arg0 + var arg1 *model.SearchRouters if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg1, err = ec.unmarshalOSearchEnvironments2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchEnvironments(ctx, tmp) + arg1, err = ec.unmarshalOSearchRouters2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchRouters(ctx, tmp) if err != nil { return nil, err } @@ -7525,171 +7270,36 @@ func (ec *executionContext) field_Query_core_listEnvironments_args(ctx context.C return args, nil } -func (ec *executionContext) field_Query_core_listImagePullSecrets_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 *model.SearchImagePullSecrets - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchImagePullSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchImagePullSecrets(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg2 - var arg3 *repos.CursorPagination - if tmp, ok := rawArgs["pq"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pq"] = arg3 - return args, nil -} - -func (ec *executionContext) field_Query_core_listManagedResources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 *model.SearchManagedResources - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchManagedResources(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg2 - var arg3 *repos.CursorPagination - if tmp, ok := rawArgs["pq"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pq"] = arg3 - return args, nil -} - -func (ec *executionContext) field_Query_core_listRouters_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 *model.SearchRouters - if tmp, ok := rawArgs["search"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchRouters2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchRouters(ctx, tmp) - if err != nil { - return nil, err - } - } - args["search"] = arg2 - var arg3 *repos.CursorPagination - if tmp, ok := rawArgs["pq"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) - if err != nil { - return nil, err - } - } - args["pq"] = arg3 - return args, nil -} - func (ec *executionContext) field_Query_core_listSecrets_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 *model.SearchSecrets + args["envName"] = arg0 + var arg1 *model.SearchSecrets if tmp, ok := rawArgs["search"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) - arg2, err = ec.unmarshalOSearchSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchSecrets(ctx, tmp) + arg1, err = ec.unmarshalOSearchSecrets2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchSecrets(ctx, tmp) if err != nil { return nil, err } } - args["search"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg1 + var arg2 *repos.CursorPagination if tmp, ok := rawArgs["pq"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) - arg3, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + arg2, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg2 return args, nil } @@ -7721,32 +7331,23 @@ func (ec *executionContext) field_Query_core_restartApp_args(ctx context.Context var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["appName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["appName"] = arg2 + args["appName"] = arg1 return args, nil } @@ -7754,32 +7355,23 @@ func (ec *executionContext) field_Query_core_resyncApp_args(ctx context.Context, var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7787,32 +7379,23 @@ func (ec *executionContext) field_Query_core_resyncConfig_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7820,23 +7403,14 @@ func (ec *executionContext) field_Query_core_resyncEnvironment_args(ctx context. var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 + args["name"] = arg0 return args, nil } @@ -7844,32 +7418,23 @@ func (ec *executionContext) field_Query_core_resyncImagePullSecret_args(ctx cont var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7877,32 +7442,23 @@ func (ec *executionContext) field_Query_core_resyncManagedResource_args(ctx cont var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7910,32 +7466,23 @@ func (ec *executionContext) field_Query_core_resyncRouter_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -7943,32 +7490,23 @@ func (ec *executionContext) field_Query_core_resyncSecret_args(ctx context.Conte var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["projectName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["projectName"] = arg0 - var arg1 string if tmp, ok := rawArgs["envName"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 string + args["envName"] = arg0 + var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -11193,47 +10731,6 @@ func (ec *executionContext) fieldContext_ConsoleVPNDevice_metadata(ctx context.C return fc, nil } -func (ec *executionContext) _ConsoleVPNDevice_projectName(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ConsoleVPNDevice_projectName(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.ProjectName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ConsoleVPNDevice_projectName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ConsoleVPNDevice", - 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) _ConsoleVPNDevice_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.ConsoleVPNDevice) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) if err != nil { @@ -11648,8 +11145,6 @@ func (ec *executionContext) fieldContext_ConsoleVPNDeviceEdge_node(ctx context.C return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": @@ -23638,7 +23133,7 @@ func (ec *executionContext) _Mutation_core_createEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + return ec.resolvers.Mutation().CoreCreateEnvironment(rctx, fc.Args["env"].(entities.Environment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -23750,7 +23245,7 @@ func (ec *executionContext) _Mutation_core_updateEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) + return ec.resolvers.Mutation().CoreUpdateEnvironment(rctx, fc.Args["env"].(entities.Environment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -23862,7 +23357,7 @@ func (ec *executionContext) _Mutation_core_deleteEnvironment(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string)) + return ec.resolvers.Mutation().CoreDeleteEnvironment(rctx, fc.Args["envName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -23943,7 +23438,7 @@ func (ec *executionContext) _Mutation_core_cloneEnvironment(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCloneEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["sourceEnvName"].(string), fc.Args["destinationEnvName"].(string), fc.Args["displayName"].(string), fc.Args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)) + return ec.resolvers.Mutation().CoreCloneEnvironment(rctx, fc.Args["sourceEnvName"].(string), fc.Args["destinationEnvName"].(string), fc.Args["displayName"].(string), fc.Args["environmentRoutingMode"].(v1.EnvironmentRoutingMode)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24055,7 +23550,7 @@ func (ec *executionContext) _Mutation_core_createImagePullSecret(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["imagePullSecretIn"].(entities.ImagePullSecret)) + return ec.resolvers.Mutation().CoreCreateImagePullSecret(rctx, fc.Args["envName"].(string), fc.Args["imagePullSecretIn"].(entities.ImagePullSecret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24169,7 +23664,7 @@ func (ec *executionContext) _Mutation_core_deleteImagePullSecret(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + return ec.resolvers.Mutation().CoreDeleteImagePullSecret(rctx, fc.Args["envName"].(string), fc.Args["secretName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24250,7 +23745,7 @@ func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + return ec.resolvers.Mutation().CoreCreateApp(rctx, fc.Args["envName"].(string), fc.Args["app"].(entities.App)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24368,7 +23863,7 @@ func (ec *executionContext) _Mutation_core_updateApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["app"].(entities.App)) + return ec.resolvers.Mutation().CoreUpdateApp(rctx, fc.Args["envName"].(string), fc.Args["app"].(entities.App)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24486,7 +23981,7 @@ func (ec *executionContext) _Mutation_core_deleteApp(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + return ec.resolvers.Mutation().CoreDeleteApp(rctx, fc.Args["envName"].(string), fc.Args["appName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24567,7 +24062,7 @@ func (ec *executionContext) _Mutation_core_interceptApp(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreInterceptApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appname"].(string), fc.Args["deviceName"].(string), fc.Args["intercept"].(bool)) + return ec.resolvers.Mutation().CoreInterceptApp(rctx, fc.Args["envName"].(string), fc.Args["appname"].(string), fc.Args["deviceName"].(string), fc.Args["intercept"].(bool)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24648,7 +24143,7 @@ func (ec *executionContext) _Mutation_core_createConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + return ec.resolvers.Mutation().CoreCreateConfig(rctx, fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24762,7 +24257,7 @@ func (ec *executionContext) _Mutation_core_updateConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) + return ec.resolvers.Mutation().CoreUpdateConfig(rctx, fc.Args["envName"].(string), fc.Args["config"].(entities.Config)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24876,7 +24371,7 @@ func (ec *executionContext) _Mutation_core_deleteConfig(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["configName"].(string)) + return ec.resolvers.Mutation().CoreDeleteConfig(rctx, fc.Args["envName"].(string), fc.Args["configName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -24957,7 +24452,7 @@ func (ec *executionContext) _Mutation_core_createSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + return ec.resolvers.Mutation().CoreCreateSecret(rctx, fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25075,7 +24570,7 @@ func (ec *executionContext) _Mutation_core_updateSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) + return ec.resolvers.Mutation().CoreUpdateSecret(rctx, fc.Args["envName"].(string), fc.Args["secret"].(entities.Secret)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25193,7 +24688,7 @@ func (ec *executionContext) _Mutation_core_deleteSecret(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["secretName"].(string)) + return ec.resolvers.Mutation().CoreDeleteSecret(rctx, fc.Args["envName"].(string), fc.Args["secretName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25274,7 +24769,7 @@ func (ec *executionContext) _Mutation_core_createRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + return ec.resolvers.Mutation().CoreCreateRouter(rctx, fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25388,7 +24883,7 @@ func (ec *executionContext) _Mutation_core_updateRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) + return ec.resolvers.Mutation().CoreUpdateRouter(rctx, fc.Args["envName"].(string), fc.Args["router"].(entities.Router)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25502,7 +24997,7 @@ func (ec *executionContext) _Mutation_core_deleteRouter(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["routerName"].(string)) + return ec.resolvers.Mutation().CoreDeleteRouter(rctx, fc.Args["envName"].(string), fc.Args["routerName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25583,7 +25078,7 @@ func (ec *executionContext) _Mutation_core_createManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + return ec.resolvers.Mutation().CoreCreateManagedResource(rctx, fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25699,7 +25194,7 @@ func (ec *executionContext) _Mutation_core_updateManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) + return ec.resolvers.Mutation().CoreUpdateManagedResource(rctx, fc.Args["envName"].(string), fc.Args["mres"].(entities.ManagedResource)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25815,7 +25310,7 @@ func (ec *executionContext) _Mutation_core_deleteManagedResource(ctx context.Con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["mresName"].(string)) + return ec.resolvers.Mutation().CoreDeleteManagedResource(rctx, fc.Args["envName"].(string), fc.Args["mresName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25969,8 +25464,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createVPNDevice(ctx conte return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": @@ -26089,8 +25582,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevice(ctx conte return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": @@ -26217,7 +25708,7 @@ func (ec *executionContext) _Mutation_core_updateVPNDeviceEnv(ctx context.Contex resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["projectName"].(string), fc.Args["envName"].(string)) + return ec.resolvers.Mutation().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["envName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26787,7 +26278,7 @@ func (ec *executionContext) _Query_core_checkNameAvailability(ctx context.Contex resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["projectName"].(*string), fc.Args["envName"].(*string), fc.Args["resType"].(entities.ResourceType), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreCheckNameAvailability(rctx, fc.Args["envName"].(*string), fc.Args["resType"].(entities.ResourceType), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedIn == nil { @@ -26874,7 +26365,7 @@ func (ec *executionContext) _Query_core_listEnvironments(ctx context.Context, fi resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListEnvironments(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchEnvironments), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListEnvironments(rctx, fc.Args["search"].(*model.SearchEnvironments), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -26960,7 +26451,7 @@ func (ec *executionContext) _Query_core_getEnvironment(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetEnvironment(rctx, fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27072,7 +26563,7 @@ func (ec *executionContext) _Query_core_resyncEnvironment(ctx context.Context, f resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncEnvironment(rctx, fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27153,7 +26644,7 @@ func (ec *executionContext) _Query_core_listImagePullSecrets(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListImagePullSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchImagePullSecrets), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListImagePullSecrets(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchImagePullSecrets), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27239,7 +26730,7 @@ func (ec *executionContext) _Query_core_getImagePullSecret(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetImagePullSecret(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27353,7 +26844,7 @@ func (ec *executionContext) _Query_core_resyncImagePullSecret(ctx context.Contex resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncImagePullSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncImagePullSecret(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27434,7 +26925,7 @@ func (ec *executionContext) _Query_core_listApps(ctx context.Context, field grap resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListApps(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListApps(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27520,7 +27011,7 @@ func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphq resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetApp(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27638,7 +27129,7 @@ func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncApp(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27719,7 +27210,7 @@ func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field gr resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["appName"].(string)) + return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["envName"].(string), fc.Args["appName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27800,7 +27291,7 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) + return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27886,7 +27377,7 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -27972,7 +27463,7 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28086,7 +27577,7 @@ func (ec *executionContext) _Query_core_resyncConfig(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncConfig(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28167,7 +27658,7 @@ func (ec *executionContext) _Query_core_getSecretValues(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetSecretValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) + return ec.resolvers.Query().CoreGetSecretValues(rctx, fc.Args["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28253,7 +27744,7 @@ func (ec *executionContext) _Query_core_listSecrets(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchSecrets), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListSecrets(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchSecrets), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28339,7 +27830,7 @@ func (ec *executionContext) _Query_core_getSecret(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetSecret(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28457,7 +27948,7 @@ func (ec *executionContext) _Query_core_resyncSecret(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncSecret(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28538,7 +28029,7 @@ func (ec *executionContext) _Query_core_listRouters(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchRouters), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListRouters(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchRouters), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28624,7 +28115,7 @@ func (ec *executionContext) _Query_core_getRouter(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetRouter(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28738,7 +28229,7 @@ func (ec *executionContext) _Query_core_resyncRouter(ctx context.Context, field resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncRouter(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28819,7 +28310,7 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeys(ctx context. resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResouceOutputKeys(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetManagedResouceOutputKeys(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28900,7 +28391,7 @@ func (ec *executionContext) _Query_core_getManagedResouceOutputKeyValues(ctx con resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResouceOutputKeyValues(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) + return ec.resolvers.Query().CoreGetManagedResouceOutputKeyValues(rctx, fc.Args["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28989,7 +28480,7 @@ func (ec *executionContext) _Query_core_listManagedResources(ctx context.Context resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["search"].(*model.SearchManagedResources), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListManagedResources(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchManagedResources), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -29075,7 +28566,7 @@ func (ec *executionContext) _Query_core_getManagedResource(ctx context.Context, resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetManagedResource(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -29191,7 +28682,7 @@ func (ec *executionContext) _Query_core_resyncManagedResource(ctx context.Contex resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["projectName"].(string), fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncManagedResource(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -29431,8 +28922,6 @@ func (ec *executionContext) fieldContext_Query_core_listVPNDevicesForUser(ctx co return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": @@ -29540,8 +29029,6 @@ func (ec *executionContext) fieldContext_Query_core_getVPNDevice(ctx context.Con return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ConsoleVPNDevice_projectName(ctx, field) case "recordVersion": return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": @@ -34324,7 +33811,7 @@ func (ec *executionContext) unmarshalInputConsoleVPNDeviceIn(ctx context.Context asMap[k] = v } - fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "environmentName", "kind", "metadata", "projectName", "spec"} + fieldsInOrder := [...]string{"apiVersion", "clusterName", "displayName", "environmentName", "kind", "metadata", "spec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -34387,15 +33874,6 @@ func (ec *executionContext) unmarshalInputConsoleVPNDeviceIn(ctx context.Context if err = ec.resolvers.ConsoleVPNDeviceIn().Metadata(ctx, &it, data); err != nil { return it, err } - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - it.ProjectName = data case "spec": var err error @@ -38439,8 +37917,6 @@ func (ec *executionContext) _ConsoleVPNDevice(ctx context.Context, sel ast.Selec out.Values[i] = ec._ConsoleVPNDevice_markedForDeletion(ctx, field, obj) case "metadata": out.Values[i] = ec._ConsoleVPNDevice_metadata(ctx, field, obj) - case "projectName": - out.Values[i] = ec._ConsoleVPNDevice_projectName(ctx, field, obj) case "recordVersion": out.Values[i] = ec._ConsoleVPNDevice_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -46109,7 +45585,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { if v == nil { return nil, nil } @@ -46117,7 +45593,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/apps/console/internal/app/graph/schema.graphqls b/apps/console/internal/app/graph/schema.graphqls index 2bec68b57..ecd6eac15 100644 --- a/apps/console/internal/app/graph/schema.graphqls +++ b/apps/console/internal/app/graph/schema.graphqls @@ -3,13 +3,11 @@ directive @isLoggedInAndVerified on FIELD_DEFINITION directive @hasAccount on FIELD_DEFINITION enum ConsoleResType { - # project app config secret router managed_service - project_managed_service managed_resource environment vpn_device @@ -34,7 +32,6 @@ input SearchImagePullSecrets { input SearchEnvironments { text: MatchFilterIn - projectName: MatchFilterIn isReady: MatchFilterIn markedForDeletion: MatchFilterIn } @@ -84,50 +81,50 @@ input CoreSearchVPNDevices { } type Query { - core_checkNameAvailability(projectName: String, envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount + core_checkNameAvailability(envName: String, resType: ConsoleResType!, name: String!): ConsoleCheckNameAvailabilityOutput! @isLoggedIn @hasAccount # core_listProjects(search: SearchProjects, pq: CursorPaginationIn): ProjectPaginatedRecords @isLoggedInAndVerified @hasAccount # core_getProject(name: String!): Project @isLoggedInAndVerified @hasAccount # core_resyncProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_listEnvironments(projectName: String!, search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getEnvironment(projectName: String!, name: String!): Environment @isLoggedInAndVerified @hasAccount - core_resyncEnvironment(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_listEnvironments(search: SearchEnvironments, pq: CursorPaginationIn): EnvironmentPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getEnvironment(name: String!): Environment @isLoggedInAndVerified @hasAccount + core_resyncEnvironment(name: String!): Boolean! @isLoggedInAndVerified @hasAccount # get image pull secrets - core_listImagePullSecrets(projectName: String!, envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getImagePullSecret(projectName: String!, envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount - core_resyncImagePullSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_listApps(projectName: String!, envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getApp(projectName: String!, envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount - core_resyncApp(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_restartApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getConfigValues(projectName: String!, envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount - core_listConfigs(projectName: String!, envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getConfig(projectName: String!, envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount - core_resyncConfig(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getSecretValues(projectName: String!, envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount - core_listSecrets(projectName: String!, envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getSecret(projectName: String!, envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount - core_resyncSecret(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_listRouters(projectName: String!, envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount - core_getRouter(projectName: String!, envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount - core_resyncRouter(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - core_getManagedResouceOutputKeys(projectName: String!, envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount - core_getManagedResouceOutputKeyValues(projectName: String!, envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount - core_listManagedResources(projectName: String!, envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount - core_getManagedResource(projectName: String!, envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount - core_resyncManagedResource(projectName: String!, envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - - # core_listProjectManagedServices(projectName: String!, search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount - # core_getProjectManagedService(projectName: String!, name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_resyncProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount - # core_restartProjectManagedService(projectName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_listImagePullSecrets(envName: String!, search: SearchImagePullSecrets, pq: CursorPaginationIn): ImagePullSecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getImagePullSecret(envName: String!, name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_resyncImagePullSecret(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listApps(envName: String!, search: SearchApps, pq: CursorPaginationIn): AppPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getApp(envName: String!, name: String!): App @isLoggedInAndVerified @hasAccount + core_resyncApp(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_restartApp(envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getConfigValues(envName: String!, queries: [ConfigKeyRefIn]): [ConfigKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listConfigs(envName: String!, search: SearchConfigs, pq: CursorPaginationIn): ConfigPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getConfig(envName: String!, name: String!): Config @isLoggedInAndVerified @hasAccount + core_resyncConfig(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getSecretValues(envName: String!, queries: [SecretKeyRefIn!]): [SecretKeyValueRef!] @isLoggedInAndVerified @hasAccount + core_listSecrets(envName: String!, search: SearchSecrets, pq: CursorPaginationIn): SecretPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getSecret(envName: String!, name: String!): Secret @isLoggedInAndVerified @hasAccount + core_resyncSecret(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_listRouters(envName: String!, search: SearchRouters, pq: CursorPaginationIn): RouterPaginatedRecords @isLoggedInAndVerified @hasAccount + core_getRouter(envName: String!, name: String!): Router @isLoggedInAndVerified @hasAccount + core_resyncRouter(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + core_getManagedResouceOutputKeys(envName: String!, name: String!): [String!]! @isLoggedInAndVerified @hasAccount + core_getManagedResouceOutputKeyValues(envName: String!, keyrefs: [ManagedResourceKeyRefIn]): [ManagedResourceKeyValueRef!]! @isLoggedInAndVerified @hasAccount + core_listManagedResources(envName: String!, search: SearchManagedResources, pq: CursorPaginationIn): ManagedResourcePaginatedRecords @isLoggedInAndVerified @hasAccount + core_getManagedResource(envName: String!, name: String!): ManagedResource @isLoggedInAndVerified @hasAccount + core_resyncManagedResource(envName: String!, name: String!): Boolean! @isLoggedInAndVerified @hasAccount + + # core_listProjectManagedServices(search: SearchProjectManagedService, pq: CursorPaginationIn): ProjectManagedServicePaginatedRecords @isLoggedInAndVerified @hasAccount + # core_getProjectManagedService( name: String!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_resyncProjectManagedService(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_restartProjectManagedService(name: String!): Boolean! @isLoggedInAndVerified @hasAccount core_listVPNDevices(search: CoreSearchVPNDevices, pq: CursorPaginationIn): ConsoleVPNDevicePaginatedRecords @isLoggedInAndVerified @hasAccount core_listVPNDevicesForUser: [ConsoleVPNDevice!] @isLoggedInAndVerified @hasAccount @@ -139,46 +136,46 @@ type Mutation { # core_updateProject(project: ProjectIn!): Project @isLoggedInAndVerified @hasAccount # core_deleteProject(name: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount - core_updateEnvironment(projectName: String!, env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount - core_deleteEnvironment(projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_cloneEnvironment(projectName: String!, sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount + core_createEnvironment(env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_updateEnvironment(env: EnvironmentIn!): Environment @isLoggedInAndVerified @hasAccount + core_deleteEnvironment(envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_cloneEnvironment(sourceEnvName: String!, destinationEnvName: String!, displayName: String!, environmentRoutingMode: Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMode!): Environment @isLoggedInAndVerified @hasAccount # image pull secrets - core_createImagePullSecret(projectName: String!, envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount - core_deleteImagePullSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createImagePullSecret(envName: String!, imagePullSecretIn: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount + core_deleteImagePullSecret(envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount - core_updateApp(projectName: String!, envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount - core_deleteApp(projectName: String!, envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_interceptApp(projectName: String!, envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount + core_createApp(envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_updateApp(envName: String!, app: AppIn!): App @isLoggedInAndVerified @hasAccount + core_deleteApp(envName: String!, appName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_interceptApp(envName: String!, appname: String!, deviceName: String!, intercept: Boolean!): Boolean! @isLoggedInAndVerified @hasAccount - core_createConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount - core_updateConfig(projectName: String!, envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount - core_deleteConfig(projectName: String!, envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createConfig(envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_updateConfig(envName: String!, config: ConfigIn!): Config @isLoggedInAndVerified @hasAccount + core_deleteConfig(envName: String!, configName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount - core_updateSecret(projectName: String!, envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount - core_deleteSecret(projectName: String!, envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createSecret(envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_updateSecret(envName: String!, secret: SecretIn!): Secret @isLoggedInAndVerified @hasAccount + core_deleteSecret(envName: String!, secretName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount - core_updateRouter(projectName: String!, envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount - core_deleteRouter(projectName: String!, envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createRouter(envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_updateRouter(envName: String!, router: RouterIn!): Router @isLoggedInAndVerified @hasAccount + core_deleteRouter(envName: String!, routerName: String!): Boolean! @isLoggedInAndVerified @hasAccount - core_createManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount - core_updateManagedResource(projectName: String!, envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount - core_deleteManagedResource(projectName: String!, envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_createManagedResource(envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_updateManagedResource(envName: String!, mres: ManagedResourceIn!): ManagedResource @isLoggedInAndVerified @hasAccount + core_deleteManagedResource(envName: String!, mresName: String!): Boolean! @isLoggedInAndVerified @hasAccount - # core_createProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_updateProjectManagedService(projectName: String!, pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount - # core_deleteProjectManagedService(projectName: String!, pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount + # core_createProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(pmsvcName: String!): Boolean! @isLoggedInAndVerified @hasAccount core_createVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevice(vpnDevice: ConsoleVPNDeviceIn!): ConsoleVPNDevice @isLoggedInAndVerified @hasAccount core_updateVPNDevicePorts(deviceName: String!,ports: [PortIn!]!): Boolean! @isLoggedInAndVerified @hasAccount - core_updateVPNDeviceEnv(deviceName: String!,projectName: String!, envName: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_updateVPNDeviceEnv(deviceName: String!,envName: String!): Boolean! @isLoggedInAndVerified @hasAccount core_updateVpnDeviceNs(deviceName: String!,ns: String!): Boolean! @isLoggedInAndVerified @hasAccount core_updateVpnClusterName(deviceName: String!,clusterName: String!): Boolean! @isLoggedInAndVerified @hasAccount diff --git a/apps/console/internal/app/graph/schema.resolvers.go b/apps/console/internal/app/graph/schema.resolvers.go index 205b85a66..c523cb6d6 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -7,6 +7,7 @@ package graph import ( "context" "fmt" + "github.com/kloudlite/api/pkg/errors" "github.com/kloudlite/api/apps/console/internal/app/graph/generated" @@ -28,7 +29,7 @@ func (r *appResolver) Build(ctx context.Context, obj *entities.App) (*model.Buil } // CoreCreateEnvironment is the resolver for the core_createEnvironment field. -func (r *mutationResolver) CoreCreateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) { +func (r *mutationResolver) CoreCreateEnvironment(ctx context.Context, env entities.Environment) (*entities.Environment, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -37,7 +38,7 @@ func (r *mutationResolver) CoreCreateEnvironment(ctx context.Context, projectNam } // CoreUpdateEnvironment is the resolver for the core_updateEnvironment field. -func (r *mutationResolver) CoreUpdateEnvironment(ctx context.Context, projectName string, env entities.Environment) (*entities.Environment, error) { +func (r *mutationResolver) CoreUpdateEnvironment(ctx context.Context, env entities.Environment) (*entities.Environment, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -46,7 +47,7 @@ func (r *mutationResolver) CoreUpdateEnvironment(ctx context.Context, projectNam } // CoreDeleteEnvironment is the resolver for the core_deleteEnvironment field. -func (r *mutationResolver) CoreDeleteEnvironment(ctx context.Context, projectName string, envName string) (bool, error) { +func (r *mutationResolver) CoreDeleteEnvironment(ctx context.Context, envName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -58,7 +59,7 @@ func (r *mutationResolver) CoreDeleteEnvironment(ctx context.Context, projectNam } // CoreCloneEnvironment is the resolver for the core_cloneEnvironment field. -func (r *mutationResolver) CoreCloneEnvironment(ctx context.Context, projectName string, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v11.EnvironmentRoutingMode) (*entities.Environment, error) { +func (r *mutationResolver) CoreCloneEnvironment(ctx context.Context, sourceEnvName string, destinationEnvName string, displayName string, environmentRoutingMode v11.EnvironmentRoutingMode) (*entities.Environment, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -67,7 +68,7 @@ func (r *mutationResolver) CoreCloneEnvironment(ctx context.Context, projectName } // CoreCreateImagePullSecret is the resolver for the core_createImagePullSecret field. -func (r *mutationResolver) CoreCreateImagePullSecret(ctx context.Context, projectName string, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) { +func (r *mutationResolver) CoreCreateImagePullSecret(ctx context.Context, envName string, imagePullSecretIn entities.ImagePullSecret) (*entities.ImagePullSecret, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -77,7 +78,7 @@ func (r *mutationResolver) CoreCreateImagePullSecret(ctx context.Context, projec } // CoreDeleteImagePullSecret is the resolver for the core_deleteImagePullSecret field. -func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) { +func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, envName string, secretName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -89,7 +90,7 @@ func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, projec } // CoreCreateApp is the resolver for the core_createApp field. -func (r *mutationResolver) CoreCreateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) { +func (r *mutationResolver) CoreCreateApp(ctx context.Context, envName string, app entities.App) (*entities.App, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -98,7 +99,7 @@ func (r *mutationResolver) CoreCreateApp(ctx context.Context, projectName string } // CoreUpdateApp is the resolver for the core_updateApp field. -func (r *mutationResolver) CoreUpdateApp(ctx context.Context, projectName string, envName string, app entities.App) (*entities.App, error) { +func (r *mutationResolver) CoreUpdateApp(ctx context.Context, envName string, app entities.App) (*entities.App, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -107,7 +108,7 @@ func (r *mutationResolver) CoreUpdateApp(ctx context.Context, projectName string } // CoreDeleteApp is the resolver for the core_deleteApp field. -func (r *mutationResolver) CoreDeleteApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) { +func (r *mutationResolver) CoreDeleteApp(ctx context.Context, envName string, appName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -119,7 +120,7 @@ func (r *mutationResolver) CoreDeleteApp(ctx context.Context, projectName string } // CoreInterceptApp is the resolver for the core_interceptApp field. -func (r *mutationResolver) CoreInterceptApp(ctx context.Context, projectName string, envName string, appname string, deviceName string, intercept bool) (bool, error) { +func (r *mutationResolver) CoreInterceptApp(ctx context.Context, envName string, appname string, deviceName string, intercept bool) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -128,7 +129,7 @@ func (r *mutationResolver) CoreInterceptApp(ctx context.Context, projectName str } // CoreCreateConfig is the resolver for the core_createConfig field. -func (r *mutationResolver) CoreCreateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) { +func (r *mutationResolver) CoreCreateConfig(ctx context.Context, envName string, config entities.Config) (*entities.Config, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -137,7 +138,7 @@ func (r *mutationResolver) CoreCreateConfig(ctx context.Context, projectName str } // CoreUpdateConfig is the resolver for the core_updateConfig field. -func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, projectName string, envName string, config entities.Config) (*entities.Config, error) { +func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, envName string, config entities.Config) (*entities.Config, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -146,7 +147,7 @@ func (r *mutationResolver) CoreUpdateConfig(ctx context.Context, projectName str } // CoreDeleteConfig is the resolver for the core_deleteConfig field. -func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, projectName string, envName string, configName string) (bool, error) { +func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, envName string, configName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -158,7 +159,7 @@ func (r *mutationResolver) CoreDeleteConfig(ctx context.Context, projectName str } // CoreCreateSecret is the resolver for the core_createSecret field. -func (r *mutationResolver) CoreCreateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) { +func (r *mutationResolver) CoreCreateSecret(ctx context.Context, envName string, secret entities.Secret) (*entities.Secret, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -167,7 +168,7 @@ func (r *mutationResolver) CoreCreateSecret(ctx context.Context, projectName str } // CoreUpdateSecret is the resolver for the core_updateSecret field. -func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, projectName string, envName string, secret entities.Secret) (*entities.Secret, error) { +func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, envName string, secret entities.Secret) (*entities.Secret, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -176,7 +177,7 @@ func (r *mutationResolver) CoreUpdateSecret(ctx context.Context, projectName str } // CoreDeleteSecret is the resolver for the core_deleteSecret field. -func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, projectName string, envName string, secretName string) (bool, error) { +func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, envName string, secretName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -188,7 +189,7 @@ func (r *mutationResolver) CoreDeleteSecret(ctx context.Context, projectName str } // CoreCreateRouter is the resolver for the core_createRouter field. -func (r *mutationResolver) CoreCreateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) { +func (r *mutationResolver) CoreCreateRouter(ctx context.Context, envName string, router entities.Router) (*entities.Router, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -197,7 +198,7 @@ func (r *mutationResolver) CoreCreateRouter(ctx context.Context, projectName str } // CoreUpdateRouter is the resolver for the core_updateRouter field. -func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, projectName string, envName string, router entities.Router) (*entities.Router, error) { +func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, envName string, router entities.Router) (*entities.Router, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -206,7 +207,7 @@ func (r *mutationResolver) CoreUpdateRouter(ctx context.Context, projectName str } // CoreDeleteRouter is the resolver for the core_deleteRouter field. -func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, projectName string, envName string, routerName string) (bool, error) { +func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, envName string, routerName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -218,7 +219,7 @@ func (r *mutationResolver) CoreDeleteRouter(ctx context.Context, projectName str } // CoreCreateManagedResource is the resolver for the core_createManagedResource field. -func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { +func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -227,7 +228,7 @@ func (r *mutationResolver) CoreCreateManagedResource(ctx context.Context, projec } // CoreUpdateManagedResource is the resolver for the core_updateManagedResource field. -func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, projectName string, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { +func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, envName string, mres entities.ManagedResource) (*entities.ManagedResource, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -236,7 +237,7 @@ func (r *mutationResolver) CoreUpdateManagedResource(ctx context.Context, projec } // CoreDeleteManagedResource is the resolver for the core_deleteManagedResource field. -func (r *mutationResolver) CoreDeleteManagedResource(ctx context.Context, projectName string, envName string, mresName string) (bool, error) { +func (r *mutationResolver) CoreDeleteManagedResource(ctx context.Context, envName string, mresName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -282,9 +283,9 @@ func (r *mutationResolver) CoreUpdateVPNDevicePorts(ctx context.Context, deviceN } // CoreUpdateVPNDeviceEnv is the resolver for the core_updateVPNDeviceEnv field. -func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, projectName string, envName string) (bool, error) { +func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, envName string) (bool, error) { if envName == "" { - return false, fmt.Errorf("projectName and envName cannot be empty") + return false, fmt.Errorf("envName cannot be empty") } cc, err := toConsoleContext(ctx) @@ -342,7 +343,7 @@ func (r *mutationResolver) CoreDeleteVPNDevice(ctx context.Context, deviceName s } // CoreCheckNameAvailability is the resolver for the core_checkNameAvailability field. -func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, projectName *string, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) { +func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, envName *string, resType entities.ResourceType, name string) (*domain.CheckNameAvailabilityOutput, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, err @@ -351,7 +352,7 @@ func (r *queryResolver) CoreCheckNameAvailability(ctx context.Context, projectNa } // CoreListEnvironments is the resolver for the core_listEnvironments field. -func (r *queryResolver) CoreListEnvironments(ctx context.Context, projectName string, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) { +func (r *queryResolver) CoreListEnvironments(ctx context.Context, search *model.SearchEnvironments, pq *repos.CursorPagination) (*model.EnvironmentPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -361,9 +362,6 @@ func (r *queryResolver) CoreListEnvironments(ctx context.Context, projectName st if search.Text != nil { filter["metadata.name"] = *search.Text } - if search.ProjectName != nil { - filter["spec.projectName"] = *search.ProjectName - } if search.IsReady != nil { filter["status.isReady"] = *search.IsReady } @@ -381,7 +379,7 @@ func (r *queryResolver) CoreListEnvironments(ctx context.Context, projectName st } // CoreGetEnvironment is the resolver for the core_getEnvironment field. -func (r *queryResolver) CoreGetEnvironment(ctx context.Context, projectName string, name string) (*entities.Environment, error) { +func (r *queryResolver) CoreGetEnvironment(ctx context.Context, name string) (*entities.Environment, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -391,7 +389,7 @@ func (r *queryResolver) CoreGetEnvironment(ctx context.Context, projectName stri } // CoreResyncEnvironment is the resolver for the core_resyncEnvironment field. -func (r *queryResolver) CoreResyncEnvironment(ctx context.Context, projectName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncEnvironment(ctx context.Context, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -403,7 +401,7 @@ func (r *queryResolver) CoreResyncEnvironment(ctx context.Context, projectName s } // CoreListImagePullSecrets is the resolver for the infra_listImagePullSecrets field. -func (r *queryResolver) CoreListImagePullSecrets(ctx context.Context, projectName string, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) { +func (r *queryResolver) CoreListImagePullSecrets(ctx context.Context, envName string, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -430,7 +428,7 @@ func (r *queryResolver) CoreListImagePullSecrets(ctx context.Context, projectNam } // InfraGetImagePullSecret is the resolver for the infra_getImagePullSecret field. -func (r *queryResolver) CoreGetImagePullSecret(ctx context.Context, projectName string, envName string, name string) (*entities.ImagePullSecret, error) { +func (r *queryResolver) CoreGetImagePullSecret(ctx context.Context, envName string, name string) (*entities.ImagePullSecret, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -439,7 +437,7 @@ func (r *queryResolver) CoreGetImagePullSecret(ctx context.Context, projectName } // CoreResyncImagePullSecret is the resolver for the core_resyncImagePullSecret field. -func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -452,7 +450,7 @@ func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, projectNa } // CoreListApps is the resolver for the core_listApps field. -func (r *queryResolver) CoreListApps(ctx context.Context, projectName string, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) { +func (r *queryResolver) CoreListApps(ctx context.Context, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -479,7 +477,7 @@ func (r *queryResolver) CoreListApps(ctx context.Context, projectName string, en } // CoreGetApp is the resolver for the core_getApp field. -func (r *queryResolver) CoreGetApp(ctx context.Context, projectName string, envName string, name string) (*entities.App, error) { +func (r *queryResolver) CoreGetApp(ctx context.Context, envName string, name string) (*entities.App, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -488,7 +486,7 @@ func (r *queryResolver) CoreGetApp(ctx context.Context, projectName string, envN } // CoreResyncApp is the resolver for the core_resyncApp field. -func (r *queryResolver) CoreResyncApp(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncApp(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -500,7 +498,7 @@ func (r *queryResolver) CoreResyncApp(ctx context.Context, projectName string, e } // CoreRestartApp is the resolver for the core_restartApp field. -func (r *queryResolver) CoreRestartApp(ctx context.Context, projectName string, envName string, appName string) (bool, error) { +func (r *queryResolver) CoreRestartApp(ctx context.Context, envName string, appName string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -512,7 +510,7 @@ func (r *queryResolver) CoreRestartApp(ctx context.Context, projectName string, } // CoreGetConfigValues is the resolver for the core_getConfigValues field. -func (r *queryResolver) CoreGetConfigValues(ctx context.Context, projectName string, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) { +func (r *queryResolver) CoreGetConfigValues(ctx context.Context, envName string, queries []*domain.ConfigKeyRef) ([]*domain.ConfigKeyValueRef, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -527,7 +525,7 @@ func (r *queryResolver) CoreGetConfigValues(ctx context.Context, projectName str } // CoreListConfigs is the resolver for the core_listConfigs field. -func (r *queryResolver) CoreListConfigs(ctx context.Context, projectName string, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) { +func (r *queryResolver) CoreListConfigs(ctx context.Context, envName string, search *model.SearchConfigs, pq *repos.CursorPagination) (*model.ConfigPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -554,7 +552,7 @@ func (r *queryResolver) CoreListConfigs(ctx context.Context, projectName string, } // CoreGetConfig is the resolver for the core_getConfig field. -func (r *queryResolver) CoreGetConfig(ctx context.Context, projectName string, envName string, name string) (*entities.Config, error) { +func (r *queryResolver) CoreGetConfig(ctx context.Context, envName string, name string) (*entities.Config, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -564,7 +562,7 @@ func (r *queryResolver) CoreGetConfig(ctx context.Context, projectName string, e } // CoreResyncConfig is the resolver for the core_resyncConfig field. -func (r *queryResolver) CoreResyncConfig(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncConfig(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -576,7 +574,7 @@ func (r *queryResolver) CoreResyncConfig(ctx context.Context, projectName string } // CoreGetSecretValues is the resolver for the core_getSecretValues field. -func (r *queryResolver) CoreGetSecretValues(ctx context.Context, projectName string, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) { +func (r *queryResolver) CoreGetSecretValues(ctx context.Context, envName string, queries []*domain.SecretKeyRef) ([]*domain.SecretKeyValueRef, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -591,7 +589,7 @@ func (r *queryResolver) CoreGetSecretValues(ctx context.Context, projectName str } // CoreListSecrets is the resolver for the core_listSecrets field. -func (r *queryResolver) CoreListSecrets(ctx context.Context, projectName string, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) { +func (r *queryResolver) CoreListSecrets(ctx context.Context, envName string, search *model.SearchSecrets, pq *repos.CursorPagination) (*model.SecretPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -618,7 +616,7 @@ func (r *queryResolver) CoreListSecrets(ctx context.Context, projectName string, } // CoreGetSecret is the resolver for the core_getSecret field. -func (r *queryResolver) CoreGetSecret(ctx context.Context, projectName string, envName string, name string) (*entities.Secret, error) { +func (r *queryResolver) CoreGetSecret(ctx context.Context, envName string, name string) (*entities.Secret, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -627,7 +625,7 @@ func (r *queryResolver) CoreGetSecret(ctx context.Context, projectName string, e } // CoreResyncSecret is the resolver for the core_resyncSecret field. -func (r *queryResolver) CoreResyncSecret(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncSecret(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -639,7 +637,7 @@ func (r *queryResolver) CoreResyncSecret(ctx context.Context, projectName string } // CoreListRouters is the resolver for the core_listRouters field. -func (r *queryResolver) CoreListRouters(ctx context.Context, projectName string, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) { +func (r *queryResolver) CoreListRouters(ctx context.Context, envName string, search *model.SearchRouters, pq *repos.CursorPagination) (*model.RouterPaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -666,7 +664,7 @@ func (r *queryResolver) CoreListRouters(ctx context.Context, projectName string, } // CoreGetRouter is the resolver for the core_getRouter field. -func (r *queryResolver) CoreGetRouter(ctx context.Context, projectName string, envName string, name string) (*entities.Router, error) { +func (r *queryResolver) CoreGetRouter(ctx context.Context, envName string, name string) (*entities.Router, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -675,7 +673,7 @@ func (r *queryResolver) CoreGetRouter(ctx context.Context, projectName string, e } // CoreResyncRouter is the resolver for the core_resyncRouter field. -func (r *queryResolver) CoreResyncRouter(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncRouter(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -687,7 +685,7 @@ func (r *queryResolver) CoreResyncRouter(ctx context.Context, projectName string } // CoreGetManagedResouceOutputKeys is the resolver for the core_getManagedResouceOutputKeys field. -func (r *queryResolver) CoreGetManagedResouceOutputKeys(ctx context.Context, projectName string, envName string, name string) ([]string, error) { +func (r *queryResolver) CoreGetManagedResouceOutputKeys(ctx context.Context, envName string, name string) ([]string, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -696,7 +694,7 @@ func (r *queryResolver) CoreGetManagedResouceOutputKeys(ctx context.Context, pro } // CoreGetManagedResouceOutputKeyValues is the resolver for the core_getManagedResouceOutputKeyValues field. -func (r *queryResolver) CoreGetManagedResouceOutputKeyValues(ctx context.Context, projectName string, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) { +func (r *queryResolver) CoreGetManagedResouceOutputKeyValues(ctx context.Context, envName string, keyrefs []*domain.ManagedResourceKeyRef) ([]*domain.ManagedResourceKeyValueRef, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -711,7 +709,7 @@ func (r *queryResolver) CoreGetManagedResouceOutputKeyValues(ctx context.Context } // CoreListManagedResources is the resolver for the core_listManagedResources field. -func (r *queryResolver) CoreListManagedResources(ctx context.Context, projectName string, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) { +func (r *queryResolver) CoreListManagedResources(ctx context.Context, envName string, search *model.SearchManagedResources, pq *repos.CursorPagination) (*model.ManagedResourcePaginatedRecords, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -742,7 +740,7 @@ func (r *queryResolver) CoreListManagedResources(ctx context.Context, projectNam } // CoreGetManagedResource is the resolver for the core_getManagedResource field. -func (r *queryResolver) CoreGetManagedResource(ctx context.Context, projectName string, envName string, name string) (*entities.ManagedResource, error) { +func (r *queryResolver) CoreGetManagedResource(ctx context.Context, envName string, name string) (*entities.ManagedResource, error) { cc, err := toConsoleContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -751,7 +749,7 @@ func (r *queryResolver) CoreGetManagedResource(ctx context.Context, projectName } // CoreResyncManagedResource is the resolver for the core_resyncManagedResource field. -func (r *queryResolver) CoreResyncManagedResource(ctx context.Context, projectName string, envName string, name string) (bool, error) { +func (r *queryResolver) CoreResyncManagedResource(ctx context.Context, envName string, name string) (bool, error) { cc, err := toConsoleContext(ctx) if err != nil { return false, errors.NewE(err) @@ -814,5 +812,7 @@ func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResol // Query returns generated.QueryResolver implementation. func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } -type mutationResolver struct{ *Resolver } -type queryResolver struct{ *Resolver } +type ( + mutationResolver struct{ *Resolver } + queryResolver struct{ *Resolver } +) diff --git a/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls b/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls index bc63ed745..efa0157f4 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/consolevpndevice.graphqls @@ -12,7 +12,6 @@ type ConsoleVPNDevice @shareable { linkedClusters: [String!] markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") - projectName: String recordVersion: Int! spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec status: Github__com___kloudlite___operator___pkg___operator__Status @@ -39,7 +38,6 @@ input ConsoleVPNDeviceIn { environmentName: String kind: String metadata: MetadataIn - projectName: String spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn } diff --git a/apps/console/internal/domain/environment.go b/apps/console/internal/domain/environment.go index dc3d5e24d..32988bb56 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -1,8 +1,6 @@ package domain import ( - "crypto/md5" - "encoding/hex" "fmt" "strings" @@ -468,9 +466,10 @@ func (d *domain) CloneEnvironment(ctx ConsoleContext, sourceEnvName string, dest } func (d *domain) getEnvironmentTargetNamespace(envName string) string { - envNamespace := fmt.Sprintf("env-%s", envName) - hash := md5.Sum([]byte(envNamespace)) - return fmt.Sprintf("env-%s", hex.EncodeToString(hash[:])) + return fmt.Sprintf("env-%s", envName) + // envNamespace := fmt.Sprintf("env-%s", envName) + // hash := md5.Sum([]byte(envNamespace)) + // return fmt.Sprintf("env-%s", hex.EncodeToString(hash[:])) } func (d *domain) UpdateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) { diff --git a/apps/console/internal/entities/app.go b/apps/console/internal/entities/app.go index d268b6791..00513ea91 100644 --- a/apps/console/internal/entities/app.go +++ b/apps/console/internal/entities/app.go @@ -51,7 +51,6 @@ var AppIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - {Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.EnvironmentName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/console/internal/entities/environment.go b/apps/console/internal/entities/environment.go index 68c98c0db..64f77df93 100644 --- a/apps/console/internal/entities/environment.go +++ b/apps/console/internal/entities/environment.go @@ -16,7 +16,6 @@ type Environment struct { crdsv1.Environment `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - // ProjectName string `json:"projectName" graphql:"noinput"` ClusterName string `json:"clusterName"` common.ResourceMetadata `json:",inline"` @@ -47,7 +46,6 @@ var EnvironmentIndexes = []repos.IndexField{ {Key: fields.MetadataName, Value: repos.IndexAsc}, {Key: fields.MetadataNamespace, Value: repos.IndexAsc}, {Key: fields.AccountName, Value: repos.IndexAsc}, - //{Key: fields.ProjectName, Value: repos.IndexAsc}, {Key: fields.ClusterName, Value: repos.IndexAsc}, }, Unique: true, diff --git a/apps/console/internal/entities/field-constants/generated_constants.go b/apps/console/internal/entities/field-constants/generated_constants.go index 55745983d..376199b87 100644 --- a/apps/console/internal/entities/field-constants/generated_constants.go +++ b/apps/console/internal/entities/field-constants/generated_constants.go @@ -197,7 +197,6 @@ const ( MetadataResourceVersion = "metadata.resourceVersion" MetadataSelfLink = "metadata.selfLink" MetadataUid = "metadata.uid" - ProjectName = "projectName" RecordVersion = "recordVersion" Status = "status" StatusCheckList = "status.checkList" diff --git a/apps/console/internal/entities/mres.go b/apps/console/internal/entities/mres.go index 426b58765..827785d7b 100644 --- a/apps/console/internal/entities/mres.go +++ b/apps/console/internal/entities/mres.go @@ -17,7 +17,6 @@ type ManagedResource struct { AccountName string `json:"accountName" graphql:"noinput"` EnvironmentName string `json:"environmentName" graphql:"noinput"` - // SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"noinput" struct-json-path:",ignore-nesting"` SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"noinput"` common.ResourceMetadata `json:",inline"` diff --git a/apps/console/internal/entities/resource-mapping.go b/apps/console/internal/entities/resource-mapping.go index 65988b80e..f968c68d9 100644 --- a/apps/console/internal/entities/resource-mapping.go +++ b/apps/console/internal/entities/resource-mapping.go @@ -9,15 +9,14 @@ import ( type ResourceType string const ( - ResourceTypeEnvironment ResourceType = "environment" - ResourceTypeApp ResourceType = "app" - ResourceTypeConfig ResourceType = "config" - ResourceTypeSecret ResourceType = "secret" - ResourceTypeImagePullSecret ResourceType = "image_pull_secret" - ResourceTypeRouter ResourceType = "router" - ResourceTypeManagedResource ResourceType = "managed_resource" - ResourceTypeProjectManagedService ResourceType = "project_managed_service" - ResourceTypeVPNDevice ResourceType = "vpn_device" + ResourceTypeEnvironment ResourceType = "environment" + ResourceTypeApp ResourceType = "app" + ResourceTypeConfig ResourceType = "config" + ResourceTypeSecret ResourceType = "secret" + ResourceTypeImagePullSecret ResourceType = "image_pull_secret" + ResourceTypeRouter ResourceType = "router" + ResourceTypeManagedResource ResourceType = "managed_resource" + ResourceTypeVPNDevice ResourceType = "vpn_device" ) type ResourceHeirarchy string @@ -38,7 +37,6 @@ type ResourceMapping struct { AccountName string `json:"accountName"` ClusterName string `json:"clusterName"` - // ProjectName string `json:"projectName"` EnvironmentName string `json:"environmentName"` } diff --git a/apps/console/internal/entities/vpn-device.go b/apps/console/internal/entities/vpn-device.go index 3ffe27b91..af90d6f5b 100644 --- a/apps/console/internal/entities/vpn-device.go +++ b/apps/console/internal/entities/vpn-device.go @@ -18,7 +18,6 @@ type ConsoleVPNDevice struct { common.ResourceMetadata `json:",inline"` AccountName string `json:"accountName" graphql:"noinput"` - ProjectName *string `json:"projectName,omitempty"` EnvironmentName *string `json:"environmentName,omitempty"` ClusterName *string `json:"clusterName,omitempty"` diff --git a/apps/infra/internal/app/graph/generated/generated.go b/apps/infra/internal/app/graph/generated/generated.go index f46adb0b3..79c86b342 100644 --- a/apps/infra/internal/app/graph/generated/generated.go +++ b/apps/infra/internal/app/graph/generated/generated.go @@ -620,6 +620,7 @@ type ComplexityRoot struct { MarkedForDeletion func(childComplexity int) int ObjectMeta func(childComplexity int) int PrivateKey func(childComplexity int) int + PublicEndpoint func(childComplexity int) int PublicKey func(childComplexity int) int RecordVersion func(childComplexity int) int UpdateTime func(childComplexity int) int @@ -4040,6 +4041,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.GlobalVPNDevice.PrivateKey(childComplexity), true + case "GlobalVPNDevice.publiEndpoint": + if e.complexity.GlobalVPNDevice.PublicEndpoint == nil { + break + } + + return e.complexity.GlobalVPNDevice.PublicEndpoint(childComplexity), true + case "GlobalVPNDevice.publicKey": if e.complexity.GlobalVPNDevice.PublicKey == nil { break @@ -9058,7 +9066,6 @@ input Github__com___kloudlite___operator___apis___common____types__SecretRefIn { input Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn { msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! - targetNamespace: String! } input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn { @@ -9754,6 +9761,7 @@ input GlobalVPNIn { metadata: Metadata! @goField(name: "objectMeta") privateKey: String! publicKey: String! + publiEndpoint: String recordVersion: Int! updateTime: Date! } @@ -9772,6 +9780,7 @@ type GlobalVPNDevicePaginatedRecords @shareable { input GlobalVPNDeviceIn { globalVPNName: String! metadata: MetadataIn! + publiEndpoint: String } `, BuiltIn: false}, @@ -27060,6 +27069,47 @@ func (ec *executionContext) fieldContext_GlobalVPNDevice_publicKey(ctx context.C return fc, nil } +func (ec *executionContext) _GlobalVPNDevice_publiEndpoint(ctx context.Context, field graphql.CollectedField, obj *entities.GlobalVPNDevice) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_GlobalVPNDevice_publiEndpoint(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.PublicEndpoint, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_GlobalVPNDevice_publiEndpoint(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "GlobalVPNDevice", + 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) _GlobalVPNDevice_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.GlobalVPNDevice) (ret graphql.Marshaler) { fc, err := ec.fieldContext_GlobalVPNDevice_recordVersion(ctx, field) if err != nil { @@ -27302,6 +27352,8 @@ func (ec *executionContext) fieldContext_GlobalVPNDeviceEdge_node(ctx context.Co return ec.fieldContext_GlobalVPNDevice_privateKey(ctx, field) case "publicKey": return ec.fieldContext_GlobalVPNDevice_publicKey(ctx, field) + case "publiEndpoint": + return ec.fieldContext_GlobalVPNDevice_publiEndpoint(ctx, field) case "recordVersion": return ec.fieldContext_GlobalVPNDevice_recordVersion(ctx, field) case "updateTime": @@ -40811,6 +40863,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_createGlobalVPNDevice(ct return ec.fieldContext_GlobalVPNDevice_privateKey(ctx, field) case "publicKey": return ec.fieldContext_GlobalVPNDevice_publicKey(ctx, field) + case "publiEndpoint": + return ec.fieldContext_GlobalVPNDevice_publiEndpoint(ctx, field) case "recordVersion": return ec.fieldContext_GlobalVPNDevice_recordVersion(ctx, field) case "updateTime": @@ -40921,6 +40975,8 @@ func (ec *executionContext) fieldContext_Mutation_infra_updateGlobalVPNDevice(ct return ec.fieldContext_GlobalVPNDevice_privateKey(ctx, field) case "publicKey": return ec.fieldContext_GlobalVPNDevice_publicKey(ctx, field) + case "publiEndpoint": + return ec.fieldContext_GlobalVPNDevice_publiEndpoint(ctx, field) case "recordVersion": return ec.fieldContext_GlobalVPNDevice_recordVersion(ctx, field) case "updateTime": @@ -48634,6 +48690,8 @@ func (ec *executionContext) fieldContext_Query_infra_getGlobalVPNDevice(ctx cont return ec.fieldContext_GlobalVPNDevice_privateKey(ctx, field) case "publicKey": return ec.fieldContext_GlobalVPNDevice_publicKey(ctx, field) + case "publiEndpoint": + return ec.fieldContext_GlobalVPNDevice_publiEndpoint(ctx, field) case "recordVersion": return ec.fieldContext_GlobalVPNDevice_recordVersion(ctx, field) case "updateTime": @@ -54893,7 +54951,7 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a asMap[k] = v } - fieldsInOrder := [...]string{"msvcSpec", "targetNamespace"} + fieldsInOrder := [...]string{"msvcSpec"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -54909,15 +54967,6 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, err } it.MsvcSpec = data - case "targetNamespace": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("targetNamespace")) - data, err := ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - it.TargetNamespace = data } } @@ -55182,7 +55231,7 @@ func (ec *executionContext) unmarshalInputGlobalVPNDeviceIn(ctx context.Context, asMap[k] = v } - fieldsInOrder := [...]string{"globalVPNName", "metadata"} + fieldsInOrder := [...]string{"globalVPNName", "metadata", "publiEndpoint"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -55209,6 +55258,15 @@ func (ec *executionContext) unmarshalInputGlobalVPNDeviceIn(ctx context.Context, if err = ec.resolvers.GlobalVPNDeviceIn().Metadata(ctx, &it, data); err != nil { return it, err } + case "publiEndpoint": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("publiEndpoint")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.PublicEndpoint = data } } @@ -64267,6 +64325,8 @@ func (ec *executionContext) _GlobalVPNDevice(ctx context.Context, sel ast.Select if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "publiEndpoint": + out.Values[i] = ec._GlobalVPNDevice_publiEndpoint(ctx, field, obj) case "recordVersion": out.Values[i] = ec._GlobalVPNDevice_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -73264,7 +73324,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -73272,7 +73332,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/apps/infra/internal/app/graph/model/models_gen.go b/apps/infra/internal/app/graph/model/models_gen.go index f73e110a1..b06212e68 100644 --- a/apps/infra/internal/app/graph/model/models_gen.go +++ b/apps/infra/internal/app/graph/model/models_gen.go @@ -415,8 +415,7 @@ type GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpec struct { } type GithubComKloudliteOperatorApisCrdsV1ClusterManagedServiceSpecIn struct { - MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn `json:"msvcSpec"` - TargetNamespace string `json:"targetNamespace"` + MsvcSpec *GithubComKloudliteOperatorApisCrdsV1ManagedServiceSpecIn `json:"msvcSpec"` } type GithubComKloudliteOperatorApisCrdsV1HelmChartSpec struct { diff --git a/apps/infra/internal/app/graph/schema.resolvers.go b/apps/infra/internal/app/graph/schema.resolvers.go index b18da9f6a..0740fc6a8 100644 --- a/apps/infra/internal/app/graph/schema.resolvers.go +++ b/apps/infra/internal/app/graph/schema.resolvers.go @@ -7,14 +7,12 @@ package graph import ( "context" "encoding/base64" - - "github.com/kloudlite/api/pkg/errors" - "github.com/kloudlite/api/apps/infra/internal/app/graph/generated" "github.com/kloudlite/api/apps/infra/internal/app/graph/model" "github.com/kloudlite/api/apps/infra/internal/domain" "github.com/kloudlite/api/apps/infra/internal/entities" "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/errors" fn "github.com/kloudlite/api/pkg/functions" "github.com/kloudlite/api/pkg/repos" ) @@ -41,7 +39,7 @@ func (r *clusterResolver) AdminKubeconfig(ctx context.Context, obj *entities.Clu } // WireguardConfig is the resolver for the wireguardConfig field. -func (r *globalVPNDeviceResolver) WireguardConfig(ctx context.Context, gvpnDevice *entities.GlobalVPNDevice) (*model.EncodedValue, error) { +func (r *globalVPNDeviceResolver) WireguardConfig(ctx context.Context, obj *entities.GlobalVPNDevice) (*model.EncodedValue, error) { ictx, err := toInfraContext(ctx) if err != nil { return nil, errors.NewE(err) @@ -1021,7 +1019,5 @@ func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResol // Query returns generated.QueryResolver implementation. func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } -type ( - mutationResolver struct{ *Resolver } - queryResolver struct{ *Resolver } -) +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls index 273a4fab1..bae2e87a2 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -885,7 +885,6 @@ input Github__com___kloudlite___operator___apis___common____types__SecretRefIn { input Github__com___kloudlite___operator___apis___crds___v1__ClusterManagedServiceSpecIn { msvcSpec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn! - targetNamespace: String! } input Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpecIn { diff --git a/apps/infra/internal/app/graph/struct-to-graphql/globalvpndevice.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/globalvpndevice.graphqls index f661682da..7dd0656a6 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/globalvpndevice.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/globalvpndevice.graphqls @@ -11,6 +11,7 @@ type GlobalVPNDevice @shareable { metadata: Metadata! @goField(name: "objectMeta") privateKey: String! publicKey: String! + publiEndpoint: String recordVersion: Int! updateTime: Date! } @@ -29,5 +30,6 @@ type GlobalVPNDevicePaginatedRecords @shareable { input GlobalVPNDeviceIn { globalVPNName: String! metadata: MetadataIn! + publiEndpoint: String } diff --git a/apps/tenant-agent/main.go b/apps/tenant-agent/main.go index 6becc00e6..6ea4882f8 100644 --- a/apps/tenant-agent/main.go +++ b/apps/tenant-agent/main.go @@ -106,7 +106,8 @@ func (g *grpcHandler) handleMessage(msg t.AgentMessage) error { } if _, err := g.yamlClient.ApplyYAML(ctx, b); err != nil { - mLogger.Infof("[%d] [error-on-apply]: %s", g.inMemCounter, err.Error()) + // mLogger.Infof("[%d] [error-on-apply]: %s", g.inMemCounter, err.Error()) + mLogger.Errorf(err, "[%d] [error-on-apply]: yaml: \n%s\n", g.inMemCounter, b) mLogger.Infof("[%d] failed to process message", g.inMemCounter) return g.handleErrorOnApply(ctx, err, msg) } From 5abb24acf903051d4793a0d4a950a77a418c92e1 Mon Sep 17 00:00:00 2001 From: nxtcoder17 Date: Tue, 7 May 2024 15:48:31 +0530 Subject: [PATCH 4/4] feat: updates gql types, due to upstream changes --- apps/comms/Taskfile.yml | 2 +- .../internal/app/graph/generated/generated.go | 429 +++++++++++++++++- .../internal/app/graph/model/models_gen.go | 22 +- .../internal/app/graph/schema.resolvers.go | 7 +- .../struct-to-graphql/common-types.graphqls | 13 + .../field-constants/generated_constants.go | 2 + .../internal/app/graph/entity.resolvers.go | 1 - .../internal/app/graph/generated/generated.go | 70 ++- .../internal/app/graph/model/models_gen.go | 2 + .../internal/app/graph/schema.resolvers.go | 7 +- .../struct-to-graphql/common-types.graphqls | 2 + .../templates/cluster-kube-proxy.yml.tpl | 0 apps/infra/internal/domain/templates/types.go | 6 + .../{byoc_cluster.go => byok_cluster.go} | 13 +- .../app/graph/common-types.resolvers.go | 10 +- .../internal/app/graph/generated/generated.go | 416 ++++++++++++++++- .../internal/app/graph/model/models_gen.go | 21 +- .../internal/app/graph/schema.resolvers.go | 3 +- .../struct-to-graphql/common-types.graphqls | 13 + common/types.go | 5 + go.mod | 9 +- go.sum | 69 ++- pkg/http-server/transport.go | 27 ++ tools/README.md | 0 tools/global-vpn-kube-proxy/main.go | 0 25 files changed, 1041 insertions(+), 108 deletions(-) create mode 100644 apps/infra/internal/domain/templates/cluster-kube-proxy.yml.tpl create mode 100644 apps/infra/internal/domain/templates/types.go rename apps/infra/internal/entities/{byoc_cluster.go => byok_cluster.go} (82%) create mode 100644 pkg/http-server/transport.go create mode 100644 tools/README.md create mode 100644 tools/global-vpn-kube-proxy/main.go diff --git a/apps/comms/Taskfile.yml b/apps/comms/Taskfile.yml index 3c9b15f4b..180f157ab 100644 --- a/apps/comms/Taskfile.yml +++ b/apps/comms/Taskfile.yml @@ -27,5 +27,5 @@ tasks: - sh: '[[ -n "{{.Image}}" ]]' msg: "var Image must have a value, of format 'image_repository:image_tag'" cmds: - - task: build + - task build upx={{.upx}} - docker buildx build -f ./Containerfile -t {{.Image}} . --build-arg BINARY={{.app}} --push diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index 73d76ce1b..1d5fc0b66 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -278,6 +278,11 @@ type ComplexityRoot struct { Volumes func(childComplexity int) int } + Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings struct { + AppPort func(childComplexity int) int + DevicePort func(childComplexity int) int + } + Github__com___kloudlite___operator___apis___crds___v1__AppSpec struct { Containers func(childComplexity int) int DisplayName func(childComplexity int) int @@ -375,8 +380,9 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___apis___crds___v1__Intercept struct { - Enabled func(childComplexity int) int - ToDevice func(childComplexity int) int + Enabled func(childComplexity int) int + PortMappings func(childComplexity int) int + ToDevice func(childComplexity int) int } Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec struct { @@ -475,6 +481,7 @@ type ComplexityRoot struct { Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { Debug func(childComplexity int) int Description func(childComplexity int) int + Hide func(childComplexity int) int Name func(childComplexity int) int Title func(childComplexity int) int } @@ -1918,6 +1925,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Volumes(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.appPort": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.AppPort == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.AppPort(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.devicePort": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.DevicePort == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.DevicePort(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.containers": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Containers == nil { break @@ -2303,6 +2324,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.Enabled(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.portMappings": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.PortMappings == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.PortMappings(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.toDevice": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.ToDevice == nil { break @@ -2702,6 +2730,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.hide": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { break @@ -4547,6 +4582,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCursorPaginationIn, ec.unmarshalInputEnvironmentIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__BasicAuthIn, @@ -4705,7 +4741,6 @@ enum ConsoleResType { secret router managed_service - project_managed_service managed_resource environment vpn_device @@ -4730,7 +4765,6 @@ input SearchImagePullSecrets { input SearchEnvironments { text: MatchFilterIn - projectName: MatchFilterIn isReady: MatchFilterIn markedForDeletion: MatchFilterIn } @@ -4967,6 +5001,11 @@ type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @sharea volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] } +type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings @shareable { + appPort: Int! + devicePort: Int! +} + type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! displayName: String @@ -5065,6 +5104,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__Https @shareable { type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings!] toDevice: String! } @@ -5164,6 +5204,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -5261,6 +5302,11 @@ input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] } +input Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn { + appPort: Int! + devicePort: Int! +} + input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! displayName: String @@ -5357,6 +5403,7 @@ input Github__com___kloudlite___operator___apis___crds___v1__HttpsIn { input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn!] toDevice: String! } @@ -13688,6 +13735,94 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(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.AppPort, 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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(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.DevicePort, 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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx, field) if err != nil { @@ -13931,6 +14066,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap switch field.Name { case "enabled": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx, field) + case "portMappings": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx, field) case "toDevice": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) } @@ -16086,6 +16223,53 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(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.PortMappings, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Intercept", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "appPort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx, field) + case "devicePort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) if err != nil { @@ -18566,6 +18750,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(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.Hide, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + 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) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) if err != nil { @@ -18870,6 +19095,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field) case "description": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "hide": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field) case "name": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) case "title": @@ -34225,6 +34452,44 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, nil } +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"appPort", "devicePort"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "appPort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appPort")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.AppPort = data + case "devicePort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("devicePort")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.DevicePort = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn, error) { var it model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn asMap := map[string]interface{}{} @@ -34980,7 +35245,7 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a asMap[k] = v } - fieldsInOrder := [...]string{"enabled", "toDevice"} + fieldsInOrder := [...]string{"enabled", "portMappings", "toDevice"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -34996,6 +35261,15 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, err } it.Enabled = data + case "portMappings": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portMappings")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsInᚄ(ctx, v) + if err != nil { + return it, err + } + it.PortMappings = data case "toDevice": var err error @@ -36463,7 +36737,7 @@ func (ec *executionContext) unmarshalInputSearchEnvironments(ctx context.Context asMap[k] = v } - fieldsInOrder := [...]string{"text", "projectName", "isReady", "markedForDeletion"} + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -36479,15 +36753,6 @@ func (ec *executionContext) unmarshalInputSearchEnvironments(ctx context.Context return it, err } it.Text = data - case "projectName": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectName")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.ProjectName = data case "isReady": var err error @@ -38844,6 +39109,50 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ return out } +var github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsImplementors) + + 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("Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings") + case "appPort": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "devicePort": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(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 github__com___kloudlite___operator___apis___crds___v1__AppSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppSpec"} func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { @@ -39486,6 +39795,8 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ if out.Values[i] == graphql.Null { out.Invalids++ } + case "portMappings": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx, field, obj) case "toDevice": out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -40127,6 +40438,8 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field, obj) case "description": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + case "hide": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field, obj) case "name": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -44304,6 +44617,21 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) 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._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { return ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx, sel, &v) } @@ -45585,7 +45913,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -45593,7 +45921,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -45900,6 +46228,73 @@ func (ec *executionContext) marshalOGithub__com___kloudlite___api___pkg___types_ return ec._Github__com___kloudlite___api___pkg___types__EncodedString(ctx, sel, v) } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppSvc) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/apps/console/internal/app/graph/model/models_gen.go b/apps/console/internal/app/graph/model/models_gen.go index 1e06603e1..742597908 100644 --- a/apps/console/internal/app/graph/model/models_gen.go +++ b/apps/console/internal/app/graph/model/models_gen.go @@ -114,6 +114,16 @@ type GithubComKloudliteOperatorApisCrdsV1AppContainerIn struct { Volumes []*GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn `json:"volumes,omitempty"` } +type GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings struct { + AppPort int `json:"appPort"` + DevicePort int `json:"devicePort"` +} + +type GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn struct { + AppPort int `json:"appPort"` + DevicePort int `json:"devicePort"` +} + type GithubComKloudliteOperatorApisCrdsV1AppSpec struct { Containers []*GithubComKloudliteOperatorApisCrdsV1AppContainer `json:"containers"` DisplayName *string `json:"displayName,omitempty"` @@ -305,13 +315,15 @@ type GithubComKloudliteOperatorApisCrdsV1HTTPSIn struct { } type GithubComKloudliteOperatorApisCrdsV1Intercept struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` + Enabled bool `json:"enabled"` + PortMappings []*GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings `json:"portMappings,omitempty"` + ToDevice string `json:"toDevice"` } type GithubComKloudliteOperatorApisCrdsV1InterceptIn struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` + Enabled bool `json:"enabled"` + PortMappings []*GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn `json:"portMappings,omitempty"` + ToDevice string `json:"toDevice"` } type GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec struct { @@ -489,6 +501,7 @@ type GithubComKloudliteOperatorPkgOperatorCheck struct { type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { Debug *bool `json:"debug,omitempty"` Description *string `json:"description,omitempty"` + Hide *bool `json:"hide,omitempty"` Name string `json:"name"` Title string `json:"title"` } @@ -634,7 +647,6 @@ type SearchConfigs struct { type SearchEnvironments struct { Text *repos.MatchFilter `json:"text,omitempty"` - ProjectName *repos.MatchFilter `json:"projectName,omitempty"` IsReady *repos.MatchFilter `json:"isReady,omitempty"` MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` } diff --git a/apps/console/internal/app/graph/schema.resolvers.go b/apps/console/internal/app/graph/schema.resolvers.go index c523cb6d6..1ba3feb8a 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -7,7 +7,6 @@ package graph import ( "context" "fmt" - "github.com/kloudlite/api/pkg/errors" "github.com/kloudlite/api/apps/console/internal/app/graph/generated" @@ -812,7 +811,5 @@ func (r *Resolver) Mutation() generated.MutationResolver { return &mutationResol // Query returns generated.QueryResolver implementation. func (r *Resolver) Query() generated.QueryResolver { return &queryResolver{r} } -type ( - mutationResolver struct{ *Resolver } - queryResolver struct{ *Resolver } -) +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls index 57032d159..c3961b97c 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -33,6 +33,11 @@ type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @sharea volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] } +type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings @shareable { + appPort: Int! + devicePort: Int! +} + type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! displayName: String @@ -131,6 +136,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__Https @shareable { type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings!] toDevice: String! } @@ -230,6 +236,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -327,6 +334,11 @@ input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] } +input Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn { + appPort: Int! + devicePort: Int! +} + input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! displayName: String @@ -423,6 +435,7 @@ input Github__com___kloudlite___operator___apis___crds___v1__HttpsIn { input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn!] toDevice: String! } diff --git a/apps/console/internal/entities/field-constants/generated_constants.go b/apps/console/internal/entities/field-constants/generated_constants.go index 376199b87..e7c0bc86d 100644 --- a/apps/console/internal/entities/field-constants/generated_constants.go +++ b/apps/console/internal/entities/field-constants/generated_constants.go @@ -17,7 +17,9 @@ const ( AppSpecHpaThresholdCpu = "spec.hpa.thresholdCpu" AppSpecHpaThresholdMemory = "spec.hpa.thresholdMemory" AppSpecIntercept = "spec.intercept" + AppSpecInterceptDeviceHostSuffix = "spec.intercept.deviceHostSuffix" AppSpecInterceptEnabled = "spec.intercept.enabled" + AppSpecInterceptPortMappings = "spec.intercept.portMappings" AppSpecInterceptToDevice = "spec.intercept.toDevice" AppSpecNodeSelector = "spec.nodeSelector" AppSpecRegion = "spec.region" diff --git a/apps/container-registry/internal/app/graph/entity.resolvers.go b/apps/container-registry/internal/app/graph/entity.resolvers.go index 48d272c63..8b34d3882 100644 --- a/apps/container-registry/internal/app/graph/entity.resolvers.go +++ b/apps/container-registry/internal/app/graph/entity.resolvers.go @@ -6,7 +6,6 @@ package graph import ( "context" - fiber "github.com/gofiber/fiber/v2" "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" "github.com/kloudlite/api/apps/container-registry/internal/domain/entities" diff --git a/apps/container-registry/internal/app/graph/generated/generated.go b/apps/container-registry/internal/app/graph/generated/generated.go index 45bf16e1e..99933c2b2 100644 --- a/apps/container-registry/internal/app/graph/generated/generated.go +++ b/apps/container-registry/internal/app/graph/generated/generated.go @@ -346,6 +346,7 @@ type ComplexityRoot struct { Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { Debug func(childComplexity int) int Description func(childComplexity int) int + Hide func(childComplexity int) int Name func(childComplexity int) int Title func(childComplexity int) int } @@ -1863,6 +1864,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.hide": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { break @@ -3098,6 +3106,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -3208,6 +3217,7 @@ input Github__com___kloudlite___operator___pkg___operator__CheckIn { input Github__com___kloudlite___operator___pkg___operator__CheckMetaIn { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -12314,6 +12324,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(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.Hide, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + 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) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) if err != nil { @@ -12618,6 +12669,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field) case "description": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "hide": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field) case "name": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) case "title": @@ -20662,7 +20715,7 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p asMap[k] = v } - fieldsInOrder := [...]string{"debug", "description", "name", "title"} + fieldsInOrder := [...]string{"debug", "description", "hide", "name", "title"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -20687,6 +20740,15 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p return it, err } it.Description = data + case "hide": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("hide")) + data, err := ec.unmarshalOBoolean2ᚖbool(ctx, v) + if err != nil { + return it, err + } + it.Hide = data case "name": var err error @@ -23686,6 +23748,8 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field, obj) case "description": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + case "hide": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field, obj) case "name": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -26868,7 +26932,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -26876,7 +26940,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } diff --git a/apps/container-registry/internal/app/graph/model/models_gen.go b/apps/container-registry/internal/app/graph/model/models_gen.go index f9e7d3010..e897d4125 100644 --- a/apps/container-registry/internal/app/graph/model/models_gen.go +++ b/apps/container-registry/internal/app/graph/model/models_gen.go @@ -231,6 +231,7 @@ type GithubComKloudliteOperatorPkgOperatorCheckIn struct { type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { Debug *bool `json:"debug,omitempty"` Description *string `json:"description,omitempty"` + Hide *bool `json:"hide,omitempty"` Name string `json:"name"` Title string `json:"title"` } @@ -238,6 +239,7 @@ type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { type GithubComKloudliteOperatorPkgOperatorCheckMetaIn struct { Debug *bool `json:"debug,omitempty"` Description *string `json:"description,omitempty"` + Hide *bool `json:"hide,omitempty"` Name string `json:"name"` Title string `json:"title"` } diff --git a/apps/container-registry/internal/app/graph/schema.resolvers.go b/apps/container-registry/internal/app/graph/schema.resolvers.go index c3f13655b..9b4786591 100644 --- a/apps/container-registry/internal/app/graph/schema.resolvers.go +++ b/apps/container-registry/internal/app/graph/schema.resolvers.go @@ -6,7 +6,6 @@ package graph import ( "context" - generated1 "github.com/kloudlite/api/apps/container-registry/internal/app/graph/generated" "github.com/kloudlite/api/apps/container-registry/internal/app/graph/model" "github.com/kloudlite/api/apps/container-registry/internal/domain" @@ -446,7 +445,5 @@ func (r *Resolver) Mutation() generated1.MutationResolver { return &mutationReso // Query returns generated1.QueryResolver implementation. func (r *Resolver) Query() generated1.QueryResolver { return &queryResolver{r} } -type ( - mutationResolver struct{ *Resolver } - queryResolver struct{ *Resolver } -) +type mutationResolver struct{ *Resolver } +type queryResolver struct{ *Resolver } diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls index 6f40b0b9b..eb14f4de4 100644 --- a/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -110,6 +110,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -220,6 +221,7 @@ input Github__com___kloudlite___operator___pkg___operator__CheckIn { input Github__com___kloudlite___operator___pkg___operator__CheckMetaIn { debug: Boolean description: String + hide: Boolean name: String! title: String! } diff --git a/apps/infra/internal/domain/templates/cluster-kube-proxy.yml.tpl b/apps/infra/internal/domain/templates/cluster-kube-proxy.yml.tpl new file mode 100644 index 000000000..e69de29bb diff --git a/apps/infra/internal/domain/templates/types.go b/apps/infra/internal/domain/templates/types.go new file mode 100644 index 000000000..6970b9fbb --- /dev/null +++ b/apps/infra/internal/domain/templates/types.go @@ -0,0 +1,6 @@ +package templates + +type ClusterKubeProxyVars struct { + Namespace string + KloudliteDeviceWgConfig string +} diff --git a/apps/infra/internal/entities/byoc_cluster.go b/apps/infra/internal/entities/byok_cluster.go similarity index 82% rename from apps/infra/internal/entities/byoc_cluster.go rename to apps/infra/internal/entities/byok_cluster.go index 578055a18..7991964d2 100644 --- a/apps/infra/internal/entities/byoc_cluster.go +++ b/apps/infra/internal/entities/byok_cluster.go @@ -1,6 +1,7 @@ package entities import ( + fc "github.com/kloudlite/api/apps/infra/internal/entities/field-constants" "github.com/kloudlite/api/common" "github.com/kloudlite/api/pkg/repos" t "github.com/kloudlite/api/pkg/types" @@ -41,20 +42,16 @@ func (c *BYOKCluster) GetStatus() operator.Status { var BYOKClusterIndices = []repos.IndexField{ { Field: []repos.IndexKey{ - {Key: "id", Value: repos.IndexAsc}, + {Key: fc.Id, Value: repos.IndexAsc}, }, Unique: true, }, { Field: []repos.IndexKey{ - {Key: "metadata.name", Value: repos.IndexAsc}, - {Key: "metadata.namespace", Value: repos.IndexAsc}, + {Key: fc.MetadataName, Value: repos.IndexAsc}, + {Key: fc.MetadataNamespace, Value: repos.IndexAsc}, + {Key: fc.AccountName, Value: repos.IndexAsc}, }, Unique: true, }, - { - Field: []repos.IndexKey{ - {Key: "accountName", Value: repos.IndexAsc}, - }, - }, } diff --git a/apps/iot-console/internal/app/graph/common-types.resolvers.go b/apps/iot-console/internal/app/graph/common-types.resolvers.go index 9d71b815b..7e82f122e 100644 --- a/apps/iot-console/internal/app/graph/common-types.resolvers.go +++ b/apps/iot-console/internal/app/graph/common-types.resolvers.go @@ -12,7 +12,7 @@ import ( "github.com/kloudlite/api/apps/iot-console/internal/app/graph/generated" "github.com/kloudlite/api/common" fn "github.com/kloudlite/api/pkg/functions" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" ) // UserID is the resolver for the userId field. @@ -83,8 +83,6 @@ func (r *Resolver) Metadata() generated.MetadataResolver { return &metadataResol // MetadataIn returns generated.MetadataInResolver implementation. func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataInResolver{r} } -type ( - github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } - metadataResolver struct{ *Resolver } - metadataInResolver struct{ *Resolver } -) +type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } +type metadataResolver struct{ *Resolver } +type metadataInResolver struct{ *Resolver } diff --git a/apps/iot-console/internal/app/graph/generated/generated.go b/apps/iot-console/internal/app/graph/generated/generated.go index 6b0ad5674..79a915ed1 100644 --- a/apps/iot-console/internal/app/graph/generated/generated.go +++ b/apps/iot-console/internal/app/graph/generated/generated.go @@ -100,6 +100,11 @@ type ComplexityRoot struct { Volumes func(childComplexity int) int } + Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings struct { + AppPort func(childComplexity int) int + DevicePort func(childComplexity int) int + } + Github__com___kloudlite___operator___apis___crds___v1__AppSpec struct { Containers func(childComplexity int) int DisplayName func(childComplexity int) int @@ -168,8 +173,9 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___apis___crds___v1__Intercept struct { - Enabled func(childComplexity int) int - ToDevice func(childComplexity int) int + Enabled func(childComplexity int) int + PortMappings func(childComplexity int) int + ToDevice func(childComplexity int) int } Github__com___kloudlite___operator___apis___crds___v1__Probe struct { @@ -204,6 +210,7 @@ type ComplexityRoot struct { Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { Debug func(childComplexity int) int Description func(childComplexity int) int + Hide func(childComplexity int) int Name func(childComplexity int) int Title func(childComplexity int) int } @@ -751,6 +758,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppContainer.Volumes(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.appPort": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.AppPort == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.AppPort(childComplexity), true + + case "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.devicePort": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.DevicePort == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings.DevicePort(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__AppSpec.containers": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__AppSpec.Containers == nil { break @@ -1038,6 +1059,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.Enabled(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.portMappings": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.PortMappings == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.PortMappings(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__Intercept.toDevice": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__Intercept.ToDevice == nil { break @@ -1178,6 +1206,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.hide": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Hide(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { break @@ -2609,6 +2644,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCursorPaginationIn, ec.unmarshalInputGithub__com___kloudlite___api___apps___iot____console___internal___entities__ExposedServiceIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppContainerIn, + ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSvcIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__ContainerEnvIn, @@ -2835,6 +2871,11 @@ type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @sharea volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] } +type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings @shareable { + appPort: Int! + devicePort: Int! +} + type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! displayName: String @@ -2904,6 +2945,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe @sharea type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings!] toDevice: String! } @@ -2939,6 +2981,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -3031,6 +3074,11 @@ input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] } +input Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn { + appPort: Int! + devicePort: Int! +} + input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! displayName: String @@ -3100,6 +3148,7 @@ input Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn { input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn!] toDevice: String! } @@ -5312,6 +5361,94 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(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.AppPort, 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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(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.DevicePort, 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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppSpec_containers(ctx, field) if err != nil { @@ -5555,6 +5692,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap switch field.Name { case "enabled": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_enabled(ctx, field) + case "portMappings": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx, field) case "toDevice": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) } @@ -7122,6 +7261,53 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(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.PortMappings, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__Intercept", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "appPort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx, field) + case "devicePort": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1Intercept) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field) if err != nil { @@ -7970,6 +8156,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(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.Hide, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + 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) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) if err != nil { @@ -8274,6 +8501,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field) case "description": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "hide": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field) case "name": return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) case "title": @@ -19957,6 +20186,44 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, nil } +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + var it model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"appPort", "devicePort"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "appPort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("appPort")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.AppPort = data + case "devicePort": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("devicePort")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.DevicePort = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppSpecIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn, error) { var it model.GithubComKloudliteOperatorApisCrdsV1AppSpecIn asMap := map[string]interface{}{} @@ -20504,7 +20771,7 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a asMap[k] = v } - fieldsInOrder := [...]string{"enabled", "toDevice"} + fieldsInOrder := [...]string{"enabled", "portMappings", "toDevice"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -20520,6 +20787,15 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___a return it, err } it.Enabled = data + case "portMappings": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("portMappings")) + data, err := ec.unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsInᚄ(ctx, v) + if err != nil { + return it, err + } + it.PortMappings = data case "toDevice": var err error @@ -21864,6 +22140,50 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ return out } +var github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings"} + +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsImplementors) + + 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("Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings") + case "appPort": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_appPort(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "devicePort": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings_devicePort(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 github__com___kloudlite___operator___apis___crds___v1__AppSpecImplementors = []string{"Github__com___kloudlite___operator___apis___crds___v1__AppSpec"} func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { @@ -22302,6 +22622,8 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ if out.Values[i] == graphql.Null { out.Invalids++ } + case "portMappings": + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_portMappings(ctx, field, obj) case "toDevice": out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -22524,6 +22846,8 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_debug(ctx, field, obj) case "description": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + case "hide": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_hide(ctx, field, obj) case "name": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -25704,6 +26028,21 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) 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._Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppSpec2githubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSpec(ctx context.Context, sel ast.SelectionSet, v model.GithubComKloudliteOperatorApisCrdsV1AppSpec) graphql.Marshaler { return ec._Github__com___kloudlite___operator___apis___crds___v1__AppSpec(ctx, sel, &v) } @@ -26730,7 +27069,7 @@ func (ec *executionContext) marshalNfederation__Scope2ᚕᚕstringᚄ(ctx contex return ret } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -26738,7 +27077,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26845,6 +27184,73 @@ func (ec *executionContext) marshalODate2ᚖstring(ctx context.Context, sel ast. return res } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___crds___v1__AppSvc2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋiotᚑconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1AppSvcᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorApisCrdsV1AppSvc) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/apps/iot-console/internal/app/graph/model/models_gen.go b/apps/iot-console/internal/app/graph/model/models_gen.go index 38a934fa1..1d07ff94d 100644 --- a/apps/iot-console/internal/app/graph/model/models_gen.go +++ b/apps/iot-console/internal/app/graph/model/models_gen.go @@ -52,6 +52,16 @@ type GithubComKloudliteOperatorApisCrdsV1AppContainerIn struct { Volumes []*GithubComKloudliteOperatorApisCrdsV1ContainerVolumeIn `json:"volumes,omitempty"` } +type GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings struct { + AppPort int `json:"appPort"` + DevicePort int `json:"devicePort"` +} + +type GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn struct { + AppPort int `json:"appPort"` + DevicePort int `json:"devicePort"` +} + type GithubComKloudliteOperatorApisCrdsV1AppSpec struct { Containers []*GithubComKloudliteOperatorApisCrdsV1AppContainer `json:"containers"` DisplayName *string `json:"displayName,omitempty"` @@ -187,13 +197,15 @@ type GithubComKloudliteOperatorApisCrdsV1HTTPGetProbeIn struct { } type GithubComKloudliteOperatorApisCrdsV1Intercept struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` + Enabled bool `json:"enabled"` + PortMappings []*GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings `json:"portMappings,omitempty"` + ToDevice string `json:"toDevice"` } type GithubComKloudliteOperatorApisCrdsV1InterceptIn struct { - Enabled bool `json:"enabled"` - ToDevice string `json:"toDevice"` + Enabled bool `json:"enabled"` + PortMappings []*GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappingsIn `json:"portMappings,omitempty"` + ToDevice string `json:"toDevice"` } type GithubComKloudliteOperatorApisCrdsV1Probe struct { @@ -246,6 +258,7 @@ type GithubComKloudliteOperatorPkgOperatorCheck struct { type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { Debug *bool `json:"debug,omitempty"` Description *string `json:"description,omitempty"` + Hide *bool `json:"hide,omitempty"` Name string `json:"name"` Title string `json:"title"` } diff --git a/apps/iot-console/internal/app/graph/schema.resolvers.go b/apps/iot-console/internal/app/graph/schema.resolvers.go index a8b10e556..ab5b83b10 100644 --- a/apps/iot-console/internal/app/graph/schema.resolvers.go +++ b/apps/iot-console/internal/app/graph/schema.resolvers.go @@ -6,11 +6,10 @@ package graph import ( "context" - "github.com/kloudlite/api/pkg/errors" - "github.com/kloudlite/api/apps/iot-console/internal/app/graph/generated" "github.com/kloudlite/api/apps/iot-console/internal/app/graph/model" "github.com/kloudlite/api/apps/iot-console/internal/entities" + "github.com/kloudlite/api/pkg/errors" fn "github.com/kloudlite/api/pkg/functions" "github.com/kloudlite/api/pkg/repos" ) diff --git a/apps/iot-console/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/iot-console/internal/app/graph/struct-to-graphql/common-types.graphqls index 49ac292fc..626545a41 100644 --- a/apps/iot-console/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/iot-console/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -24,6 +24,11 @@ type Github__com___kloudlite___operator___apis___crds___v1__AppContainer @sharea volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolume!] } +type Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings @shareable { + appPort: Int! + devicePort: Int! +} + type Github__com___kloudlite___operator___apis___crds___v1__AppSpec @shareable { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainer!]! displayName: String @@ -93,6 +98,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbe @sharea type Github__com___kloudlite___operator___apis___crds___v1__Intercept @shareable { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappings!] toDevice: String! } @@ -128,6 +134,7 @@ type Github__com___kloudlite___operator___pkg___operator__Check @shareable { type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { debug: Boolean description: String + hide: Boolean name: String! title: String! } @@ -220,6 +227,11 @@ input Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn { volumes: [Github__com___kloudlite___operator___apis___crds___v1__ContainerVolumeIn!] } +input Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn { + appPort: Int! + devicePort: Int! +} + input Github__com___kloudlite___operator___apis___crds___v1__AppSpecIn { containers: [Github__com___kloudlite___operator___apis___crds___v1__AppContainerIn!]! displayName: String @@ -289,6 +301,7 @@ input Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn { input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { enabled: Boolean! + portMappings: [Github__com___kloudlite___operator___apis___crds___v1__AppInterceptPortMappingsIn!] toDevice: String! } diff --git a/common/types.go b/common/types.go index e35a4b274..20a4a7a9d 100644 --- a/common/types.go +++ b/common/types.go @@ -49,3 +49,8 @@ var CreatedOrUpdatedByKloudlite = CreatedOrUpdatedBy{ UserName: "kloudlite", UserEmail: "support@kloudlite.io", } + +type EncodedValue struct { + Value string `json:"value"` + Encoding string `json:"encoding"` +} diff --git a/go.mod b/go.mod index aa93e81f1..a3544b08e 100644 --- a/go.mod +++ b/go.mod @@ -42,14 +42,16 @@ require ( require ( github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 - github.com/kloudlite/operator v1.0.4-0.20240429055144-2ef8ed2a0e9a + github.com/kloudlite/operator v1.0.4-0.20240507101346-0ff69785004a github.com/nats-io/nats.go v1.31.0 github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 + github.com/seancfoley/ipaddress-go v1.5.4 github.com/stretchr/testify v1.9.0 github.com/ztrue/tracerr v0.4.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/net v0.22.0 + golang.org/x/net v0.23.0 + golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 ) require ( @@ -60,12 +62,14 @@ require ( github.com/hashicorp/go-hclog v1.4.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/seancfoley/bintree v1.2.1 // indirect github.com/sosodev/duration v1.2.0 // indirect github.com/stretchr/objx v0.5.2 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect @@ -114,7 +118,6 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect diff --git a/go.sum b/go.sum index 3d345bf1e..b8e323b88 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= @@ -20,8 +19,7 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/aws/aws-sdk-go v1.45.11 h1:8qiSrA12+NRr+2MVpMApi3JxtiFFjDVU1NeWe+80bYg= -github.com/aws/aws-sdk-go v1.45.11/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.50.10 h1:H3NQvqRUKG+9oysCKTIyylpkqfPA7MiBtzTnu/cIGqE= github.com/aws/aws-sdk-go v1.50.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -61,10 +59,8 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= @@ -97,7 +93,6 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -126,8 +121,7 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a h1:PEOGDI1kkyW37YqPWHLHc+D20D9+87Wt12TCcfTUo5Q= -github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= +github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b h1:h9U78+dx9a4BKdQkBBos92HalKpaGKHrp+3Uo6yTodo= github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -167,12 +161,8 @@ github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLA github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 h1:YnZh3TL6AG4EfoInx1/L5zcPHd2QxgLKseJB1KtHjdQ= github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55/go.mod h1:GZj3wZmIw/qCciclRhgQTgmGiqe8wxoVzMXQjbOfnbc= -github.com/kloudlite/operator v1.0.4-0.20240409082541-b8ead24a9fad h1:uJWUGbOPS72pxoFpxRpqr3bT9cBptRcNseytCWY/2KE= -github.com/kloudlite/operator v1.0.4-0.20240409082541-b8ead24a9fad/go.mod h1:ozyCDuQNCcMRu2XYZz4OtWr38IwRZ50ZCOcBsobj60c= -github.com/kloudlite/operator v1.0.4-0.20240410110352-9d89459d8651 h1:O4iQybfIdEs0Dl0wSUrju6Dtw9X5HrOBDjrpyqnkGhA= -github.com/kloudlite/operator v1.0.4-0.20240410110352-9d89459d8651/go.mod h1:ozyCDuQNCcMRu2XYZz4OtWr38IwRZ50ZCOcBsobj60c= -github.com/kloudlite/operator v1.0.4-0.20240429055144-2ef8ed2a0e9a h1:BYYgEMoKK5yQeNNdJtSoudmef37VFGcVhuRuRUvQFwE= -github.com/kloudlite/operator v1.0.4-0.20240429055144-2ef8ed2a0e9a/go.mod h1:BzDnnJauGDUUFG+BzxbH4ZAAFUgU0qjMmuQlGG5zs1E= +github.com/kloudlite/operator v1.0.4-0.20240507101346-0ff69785004a h1:HsfzsGECpsW2GYgzoUNZ7a63upiDuvq1ih1S0Q6AMO8= +github.com/kloudlite/operator v1.0.4-0.20240507101346-0ff69785004a/go.mod h1:CxZ24OQx30my/xzxOnjQLmUCcEvVhzAuYtGblRhXnhg= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -196,8 +186,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -236,11 +226,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= @@ -258,6 +246,10 @@ github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQ github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 h1:Orn7s+r1raRTBKLSc9DmbktTT04sL+vkzsbRD2Q8rOI= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899/go.mod h1:oejLrk1Y/5zOF+c/aHtXqn3TFlzzbAgPWg8zBiAHDas= +github.com/seancfoley/bintree v1.2.1 h1:Z/iNjRKkXnn0CTW7jDQYtjW5fz2GH1yWvOTJ4MrMvdo= +github.com/seancfoley/bintree v1.2.1/go.mod h1:hIUabL8OFYyFVTQ6azeajbopogQc2l5C/hiXMcemWNU= +github.com/seancfoley/ipaddress-go v1.5.4 h1:ZdjewWC1J2y5ruQjWHwK6rA1tInWB6mz1ftz6uTm+Uw= +github.com/seancfoley/ipaddress-go v1.5.4/go.mod h1:fpvVPC+Jso+YEhNcNiww8HQmBgKP8T4T6BTp1SLxxIo= github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekueiEMJ7NEoxJo0= github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE= github.com/sendgrid/sendgrid-go v3.11.1+incompatible h1:ai0+woZ3r/+tKLQExznak5XerOFoD6S7ePO0lMV8WXo= @@ -371,15 +363,12 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= -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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -404,14 +393,12 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= @@ -425,8 +412,7 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -441,16 +427,16 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 h1:CawjfCvYQH2OU3/TnxLx97WDSUDRABfT18pCOYwc2GE= +golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6/go.mod h1:3rxYc4HtVcSG9gVaTs2GEBdehh+sYPOwKtyUWEOTb80= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= @@ -472,20 +458,17 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= -k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= +k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= -k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= -k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f h1:eeEUOoGYWhOz7EyXqhlR2zHKNw2mNJ9vzJmub6YN6kk= k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= diff --git a/pkg/http-server/transport.go b/pkg/http-server/transport.go new file mode 100644 index 000000000..8f4da3e7b --- /dev/null +++ b/pkg/http-server/transport.go @@ -0,0 +1,27 @@ +package httpServer + +import "net/http" + +type roundTripperWithHeaders struct { + //read more at https://pkg.go.dev/net/http#Header + headers map[string][]string + rt http.RoundTripper +} + +func (rt roundTripperWithHeaders) RoundTrip(req *http.Request) (*http.Response, error) { + for k, vv := range rt.headers { + for _, v := range vv { + req.Header.Add(k, v) + } + } + return rt.rt.RoundTrip(req) +} + +var _ http.RoundTripper = (*roundTripperWithHeaders)(nil) + +func NewRoundTripperWithHeaders(rt http.RoundTripper, headers map[string][]string) http.RoundTripper { + return &roundTripperWithHeaders{ + headers: headers, + rt: rt, + } +} diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/tools/global-vpn-kube-proxy/main.go b/tools/global-vpn-kube-proxy/main.go new file mode 100644 index 000000000..e69de29bb