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/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 5a39b7745..22d3b3828 100644 --- a/.tools/nvim/__http__/console/environments.graphql.yml +++ b/.tools/nvim/__http__/console/environments.graphql.yml @@ -1,12 +1,13 @@ --- global: envTargetNamespace: "nxtcoder17" + envName: "test-env" --- label: List Environments query: |+ #graphql - query Core_listEnvironments($projectName: String!) { - core_listEnvironments(projectName: $projectName) { + query Core_listEnvironments { + core_listEnvironments() { edges { cursor node { @@ -51,19 +52,16 @@ 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 { - projectName targetNamespace } syncStatus { @@ -76,13 +74,13 @@ query: |+ #graphql } } 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/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/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..1d5fc0b66 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 @@ -187,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 @@ -223,6 +216,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 +225,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 @@ -285,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 @@ -357,7 +355,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 } @@ -383,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 { @@ -392,12 +390,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 +414,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 +440,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 } @@ -504,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 } @@ -541,7 +519,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 +591,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 +639,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, 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, 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, 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, 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,104 +682,37 @@ 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 - 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 - 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 + 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 - 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 + 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 - 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 + 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 } @@ -827,7 +730,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 +763,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,91 +875,64 @@ 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) - 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) - 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) + 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 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) - 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) - 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) + 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) @@ -1094,7 +968,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 { @@ -1113,14 +986,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 +1115,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 +1290,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 @@ -1635,13 +1486,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 @@ -1787,6 +1631,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 +1694,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 @@ -2081,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 @@ -2368,13 +2226,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 @@ -2473,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 @@ -2494,27 +2352,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 +2457,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 +2576,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 @@ -2935,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 @@ -3110,13 +2912,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 +3248,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 @@ -3659,7 +3447,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 { @@ -3671,7 +3459,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 { @@ -3683,7 +3471,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 { @@ -3695,7 +3483,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 { @@ -3707,7 +3495,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 { @@ -3719,31 +3507,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 - - 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 + return e.complexity.Mutation.CoreCreateManagedResource(childComplexity, args["envName"].(string), args["mres"].(entities.ManagedResource)), true case "Mutation.core_createRouter": if e.complexity.Mutation.CoreCreateRouter == nil { @@ -3755,7 +3519,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 { @@ -3767,7 +3531,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 { @@ -3791,7 +3555,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 { @@ -3803,7 +3567,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 { @@ -3815,7 +3579,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 { @@ -3827,7 +3591,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 { @@ -3839,31 +3603,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 - - 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 + return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["envName"].(string), args["mresName"].(string)), true case "Mutation.core_deleteRouter": if e.complexity.Mutation.CoreDeleteRouter == nil { @@ -3875,7 +3615,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 { @@ -3887,7 +3627,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 { @@ -3911,7 +3651,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 { @@ -3923,7 +3663,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 { @@ -3935,7 +3675,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 { @@ -3947,7 +3687,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 { @@ -3959,31 +3699,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 - - 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 + return e.complexity.Mutation.CoreUpdateManagedResource(childComplexity, args["envName"].(string), args["mres"].(entities.ManagedResource)), true case "Mutation.core_updateRouter": if e.complexity.Mutation.CoreUpdateRouter == nil { @@ -3995,7 +3711,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 { @@ -4007,7 +3723,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 { @@ -4031,7 +3747,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 { @@ -4111,300 +3827,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 @@ -4415,7 +3837,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 { @@ -4427,7 +3849,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 { @@ -4439,7 +3861,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 { @@ -4451,7 +3873,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 { @@ -4463,7 +3885,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 { @@ -4475,7 +3897,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 { @@ -4487,7 +3909,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 { @@ -4499,7 +3921,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 { @@ -4511,31 +3933,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 - - 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 + return e.complexity.Query.CoreGetManagedResource(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_getRouter": if e.complexity.Query.CoreGetRouter == nil { @@ -4547,7 +3945,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 { @@ -4559,7 +3957,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 { @@ -4571,7 +3969,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 { @@ -4595,7 +3993,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 { @@ -4607,7 +4005,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 { @@ -4619,7 +4017,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 { @@ -4631,7 +4029,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 { @@ -4643,31 +4041,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 - - 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 + 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 { @@ -4679,7 +4053,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 { @@ -4691,7 +4065,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 { @@ -4722,19 +4096,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 - - 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 + return e.complexity.Query.CoreRestartApp(childComplexity, args["envName"].(string), args["appName"].(string)), true case "Query.core_resyncApp": if e.complexity.Query.CoreResyncApp == nil { @@ -4746,7 +4108,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 { @@ -4758,7 +4120,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 { @@ -4770,7 +4132,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 { @@ -4782,7 +4144,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 { @@ -4794,31 +4156,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 - - 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 + return e.complexity.Query.CoreResyncManagedResource(childComplexity, args["envName"].(string), args["name"].(string)), true case "Query.core_resyncRouter": if e.complexity.Query.CoreResyncRouter == nil { @@ -4830,7 +4168,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 { @@ -4842,7 +4180,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 { @@ -4947,13 +4285,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 +4453,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 @@ -5258,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, @@ -5274,16 +4599,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 +4621,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,13 +4736,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 @@ -5448,7 +4765,6 @@ input SearchImagePullSecrets { input SearchEnvironments { text: MatchFilterIn - projectName: MatchFilterIn isReady: MatchFilterIn markedForDeletion: MatchFilterIn } @@ -5498,50 +4814,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_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 @@ -5549,49 +4865,50 @@ 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 - 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(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_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_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_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_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_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_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_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_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_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_createProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(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 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 @@ -5620,7 +4937,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 @@ -5685,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 @@ -5757,7 +5078,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 } @@ -5784,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! } @@ -5792,12 +5113,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 +5137,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 +5163,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!] } @@ -5904,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! } @@ -6001,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 @@ -6071,7 +5377,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 } @@ -6098,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! } @@ -6106,12 +5412,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 +5436,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 +5462,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 +5611,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! @@ -6392,7 +5676,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 @@ -6419,7 +5702,6 @@ input ConsoleVPNDeviceIn { environmentName: String kind: String metadata: MetadataIn - projectName: String spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn } @@ -6458,6 +5740,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 +5749,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 +5769,7 @@ type EnvironmentPaginatedRecords @shareable { input EnvironmentIn { apiVersion: String + clusterName: String! displayName: String! kind: String metadata: MetadataIn @@ -6506,7 +5789,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 +5832,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 +5916,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 +5930,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 +5978,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! @@ -6921,50 +6121,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 } @@ -6972,32 +6163,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 } @@ -7005,56 +6187,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 } @@ -7062,32 +6226,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 } @@ -7095,71 +6250,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 - 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 + args["mres"] = arg1 return args, nil } @@ -7167,32 +6274,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 } @@ -7200,32 +6298,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 } @@ -7248,32 +6337,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 } @@ -7281,32 +6361,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 } @@ -7314,23 +6385,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 } @@ -7338,32 +6400,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 } @@ -7371,71 +6424,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) - if err != nil { - return nil, err - } - } - args["envName"] = arg1 - var arg2 string - if tmp, ok := rawArgs["mresName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) - arg2, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["mresName"] = arg2 - 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 + args["envName"] = arg0 var arg1 string - if tmp, ok := rawArgs["pmsvcName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pmsvcName")) + if tmp, ok := rawArgs["mresName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mresName")) 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 + args["mresName"] = arg1 return args, nil } @@ -7443,32 +6448,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 } @@ -7476,32 +6472,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 } @@ -7524,50 +6511,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 } @@ -7575,32 +6553,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 } @@ -7608,56 +6577,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 } @@ -7665,71 +6616,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 - 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 + args["mres"] = arg1 return args, nil } @@ -7737,32 +6640,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 } @@ -7770,32 +6664,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 } @@ -7812,23 +6697,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 } @@ -7953,41 +6829,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 } @@ -7995,32 +6862,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 } @@ -8028,32 +6886,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 } @@ -8061,32 +6910,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 } @@ -8094,23 +6934,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 } @@ -8118,32 +6949,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 } @@ -8151,32 +6973,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 } @@ -8184,32 +6997,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 } @@ -8217,47 +7021,14 @@ 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) - 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_getProjectManagedService_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 + args["envName"] = arg0 var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) @@ -8270,51 +7041,27 @@ func (ec *executionContext) field_Query_core_getProjectManagedService_args(ctx c 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 - 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_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) + 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 } @@ -8322,32 +7069,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 } @@ -8355,32 +7093,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 } @@ -8403,41 +7132,32 @@ 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")) - 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.SearchApps + args["envName"] = arg0 + var arg1 *model.SearchApps 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.unmarshalOSearchApps2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchApps(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 } @@ -8445,60 +7165,18 @@ func (ec *executionContext) field_Query_core_listConfigs_args(ctx context.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["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.SearchConfigs - 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) - 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_listEnvironments_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.SearchEnvironments + args["envName"] = arg0 + var arg1 *model.SearchConfigs 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.unmarshalOSearchConfigs2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchConfigs(ctx, tmp) if err != nil { return nil, err } @@ -8516,106 +7194,79 @@ 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) { +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 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 + var arg0 *model.SearchEnvironments 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) + 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"] = arg2 - var arg3 *repos.CursorPagination + args["search"] = arg0 + var arg1 *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) + arg1, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) if err != nil { return nil, err } } - args["pq"] = arg3 + args["pq"] = arg1 return args, nil } -func (ec *executionContext) field_Query_core_listManagedResources_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +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) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg1 - var arg2 *model.SearchManagedResources + args["envName"] = arg0 + var arg1 *model.SearchImagePullSecrets 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) + 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"] = 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_listProjectManagedServices_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +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")) + 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.SearchProjectManagedService + args["envName"] = arg0 + var arg1 *model.SearchManagedResources 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) + arg1, err = ec.unmarshalOSearchManagedResources2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐSearchManagedResources(ctx, tmp) if err != nil { return nil, err } @@ -8633,69 +7284,36 @@ func (ec *executionContext) field_Query_core_listProjectManagedServices_args(ctx 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{}{} 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.SearchRouters + args["envName"] = arg0 + var arg1 *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) + arg1, 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 + 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 } @@ -8703,41 +7321,32 @@ func (ec *executionContext) field_Query_core_listSecrets_args(ctx context.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["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 } @@ -8769,47 +7378,38 @@ 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 } -func (ec *executionContext) field_Query_core_restartProjectManagedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +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{}{} 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 + args["envName"] = arg0 var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) @@ -8822,69 +7422,27 @@ func (ec *executionContext) field_Query_core_restartProjectManagedService_args(c return args, nil } -func (ec *executionContext) field_Query_core_resyncApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_resyncConfig_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_resyncConfig_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 + args["envName"] = 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) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg2 + args["name"] = arg1 return args, nil } @@ -8892,23 +7450,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 } @@ -8916,32 +7465,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 } @@ -8949,47 +7489,14 @@ 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) - 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_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 + args["envName"] = arg0 var arg1 string if tmp, ok := rawArgs["name"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) @@ -9002,51 +7509,27 @@ func (ec *executionContext) field_Query_core_resyncProjectManagedService_args(ct 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{}{} 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 } @@ -9054,32 +7537,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 } @@ -9707,50 +8181,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 +8608,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 +9472,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 +9729,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": @@ -12396,47 +10778,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 { @@ -12851,8 +11192,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": @@ -13410,6 +11749,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 +12168,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 +12248,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 +12505,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 +12523,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": @@ -15398,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 { @@ -15641,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) } @@ -17199,50 +15626,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 { @@ -17840,8 +16223,8 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap 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) +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 } @@ -17854,79 +16237,41 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ToDevice, nil + return obj.PortMappings, 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) + res := resTmp.([]*model.GithubComKloudliteOperatorApisCrdsV1AppInterceptPortMappings) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, 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_toDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +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) { - 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__ManagedResourceSpec_resourceNamePrefix(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceNamePrefix(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.ResourceNamePrefix, 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_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceNamePrefix(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", - 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") + 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__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx, field) +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 { return graphql.Null } @@ -17939,7 +16284,7 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ResourceTemplate, nil + return obj.ToDevice, nil }) if err != nil { ec.Error(ctx, err) @@ -17951,36 +16296,26 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ } return graphql.Null } - res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) + res := resTmp.(string) fc.Result = res - return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplate(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__Intercept_toDevice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", + 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 "apiVersion": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field) - case "kind": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx, field) - case "msvcRef": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(ctx, field) - case "spec": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", field.Name) + 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__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) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceNamePrefix(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceNamePrefix(ctx, field) if err != nil { return graphql.Null } @@ -17993,7 +16328,7 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.NodeSelector, nil + return obj.ResourceNamePrefix, nil }) if err != nil { ec.Error(ctx, err) @@ -18002,26 +16337,26 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ if resTmp == nil { return graphql.Null } - res := resTmp.(map[string]interface{}) + res := resTmp.(*string) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(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) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceNamePrefix(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", 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 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__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) +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1ManagedResourceSpec) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx, field) if err != nil { return graphql.Null } @@ -18034,7 +16369,7 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ServiceTemplate, nil + return obj.ResourceTemplate, nil }) if err != nil { ec.Error(ctx, err) @@ -18046,80 +16381,29 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ } return graphql.Null } - res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1ServiceTemplate) + res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1MresResourceTemplate) 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) + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1MresResourceTemplate(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) { +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec_resourceTemplate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec", + Object: "Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec", 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) + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_apiVersion(ctx, field) case "kind": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate_kind(ctx, field) + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_kind(ctx, field) + case "msvcRef": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_msvcRef(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 ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate_spec(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type K8s__io___api___core___v1__Toleration", field.Name) + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate", field.Name) }, } return fc, nil @@ -18793,146 +17077,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 +17830,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 { @@ -20738,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 { @@ -21042,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": @@ -21867,50 +19922,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 +20296,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 +22078,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 +22495,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 +23345,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 +23360,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["env"].(entities.Environment)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -25419,10 +23382,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 +23394,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 +23408,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 +23450,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,312 +23472,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)) - } - 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) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Project) - fc.Result = res - return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_core_updateProject(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_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) - }, - } - 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_updateProject_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) - 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().CoreDeleteProject(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.(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_deleteProject(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_deleteProject_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) - 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().CoreCreateEnvironment(rctx, fc.Args["projectName"].(string), fc.Args["env"].(entities.Environment)) - } - 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.Environment); 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) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Environment) - fc.Result = res - 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) { - 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_Environment_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Environment_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_Environment_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Environment_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_Environment_displayName(ctx, field) - case "id": - return ec.fieldContext_Environment_id(ctx, field) - case "kind": - return ec.fieldContext_Environment_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) - case "markedForDeletion": - 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": - return ec.fieldContext_Environment_spec(ctx, field) - case "status": - return ec.fieldContext_Environment_status(ctx, field) - case "syncStatus": - return ec.fieldContext_Environment_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Environment_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Environment", 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_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_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 - } - 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().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 { @@ -25865,6 +23523,8 @@ func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(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": @@ -25881,8 +23541,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateEnvironment(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": @@ -25926,7 +23584,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 { @@ -26007,7 +23665,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 { @@ -26058,6 +23716,8 @@ func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx cont 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": @@ -26074,8 +23734,6 @@ func (ec *executionContext) fieldContext_Mutation_core_cloneEnvironment(ctx cont 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": @@ -26119,7 +23777,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 { @@ -26188,8 +23846,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createImagePullSecret(ctx 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": @@ -26235,7 +23891,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 { @@ -26316,7 +23972,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 { @@ -26389,8 +24045,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createApp(ctx context.Con 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": @@ -26436,7 +24090,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 { @@ -26509,8 +24163,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateApp(ctx context.Con 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": @@ -26556,7 +24208,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 { @@ -26637,7 +24289,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 { @@ -26718,7 +24370,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 { @@ -26793,8 +24445,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createConfig(ctx context. 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": @@ -26834,7 +24484,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 { @@ -26909,8 +24559,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateConfig(ctx context. 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": @@ -26950,7 +24598,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 { @@ -27031,7 +24679,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 { @@ -27106,8 +24754,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createSecret(ctx context. 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": @@ -27151,7 +24797,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 { @@ -27226,8 +24872,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateSecret(ctx context. 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": @@ -27271,7 +24915,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 { @@ -27352,7 +24996,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 { @@ -27423,8 +25067,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createRouter(ctx context. 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": @@ -27468,7 +25110,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 { @@ -27539,8 +25181,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateRouter(ctx context. 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": @@ -27584,7 +25224,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 { @@ -27665,7 +25305,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 { @@ -27736,8 +25376,6 @@ func (ec *executionContext) fieldContext_Mutation_core_createManagedResource(ctx 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": @@ -27783,7 +25421,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 { @@ -27854,8 +25492,6 @@ func (ec *executionContext) fieldContext_Mutation_core_updateManagedResource(ctx 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": @@ -27901,7 +25537,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 { @@ -27967,8 +25603,8 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteManagedResource(ctx 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_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 } @@ -27982,7 +25618,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().CoreCreateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28004,10 +25640,10 @@ 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.(*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.ProjectManagedService`, 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) @@ -28016,12 +25652,12 @@ func (ec *executionContext) _Mutation_core_createProjectManagedService(ctx conte if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ProjectManagedService) + res := resTmp.(*entities.ConsoleVPNDevice) fc.Result = res - return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(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_createProjectManagedService(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, @@ -28030,39 +25666,45 @@ func (ec *executionContext) fieldContext_Mutation_core_createProjectManagedServi Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ProjectManagedService_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 ProjectManagedService", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) }, } defer func() { @@ -28072,15 +25714,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_createVPNDevice_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_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 } @@ -28094,7 +25736,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().CoreUpdateVPNDevice(rctx, fc.Args["vpnDevice"].(entities.ConsoleVPNDevice)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28116,10 +25758,10 @@ 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.(*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.ProjectManagedService`, 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) @@ -28128,12 +25770,12 @@ func (ec *executionContext) _Mutation_core_updateProjectManagedService(ctx conte if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ProjectManagedService) + res := resTmp.(*entities.ConsoleVPNDevice) fc.Result = res - return ec.marshalOProjectManagedService2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProjectManagedService(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_updateProjectManagedService(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, @@ -28142,39 +25784,45 @@ func (ec *executionContext) fieldContext_Mutation_core_updateProjectManagedServi Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ProjectManagedService_accountName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ProjectManagedService_apiVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_apiVersion(ctx, field) + case "clusterName": + return ec.fieldContext_ConsoleVPNDevice_clusterName(ctx, field) case "createdBy": - return ec.fieldContext_ProjectManagedService_createdBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ProjectManagedService_creationTime(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ProjectManagedService_displayName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_displayName(ctx, field) + case "environmentName": + return ec.fieldContext_ConsoleVPNDevice_environmentName(ctx, field) case "id": - return ec.fieldContext_ProjectManagedService_id(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_id(ctx, field) case "kind": - return ec.fieldContext_ProjectManagedService_kind(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ProjectManagedService_lastUpdatedBy(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_lastUpdatedBy(ctx, field) + case "linkedClusters": + return ec.fieldContext_ConsoleVPNDevice_linkedClusters(ctx, field) case "markedForDeletion": - return ec.fieldContext_ProjectManagedService_markedForDeletion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ProjectManagedService_metadata(ctx, field) - case "projectName": - return ec.fieldContext_ProjectManagedService_projectName(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_ProjectManagedService_recordVersion(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_recordVersion(ctx, field) case "spec": - return ec.fieldContext_ProjectManagedService_spec(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_spec(ctx, field) case "status": - return ec.fieldContext_ProjectManagedService_status(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_status(ctx, field) case "syncStatus": - return ec.fieldContext_ProjectManagedService_syncStatus(ctx, field) + return ec.fieldContext_ConsoleVPNDevice_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ProjectManagedService_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 ProjectManagedService", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ConsoleVPNDevice", field.Name) }, } defer func() { @@ -28184,15 +25832,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_updateVPNDevice_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_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 } @@ -28206,7 +25854,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().CoreUpdateVPNDevicePorts(rctx, fc.Args["deviceName"].(string), fc.Args["ports"].([]*v11.Port)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28248,7 +25896,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_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -28265,15 +25913,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_updateVPNDevicePorts_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_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 } @@ -28287,7 +25935,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().CoreUpdateVPNDeviceEnv(rctx, fc.Args["deviceName"].(string), fc.Args["envName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -28309,193 +25957,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 { - return graphql.Null - } - res := resTmp.(*entities.ConsoleVPNDevice) - fc.Result = res - return ec.marshalOConsoleVPNDevice2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConsoleVPNDevice(ctx, field.Selections, res) -} - -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, - 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) - }, - } - 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_createVPNDevice_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) - 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().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 + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") } - 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) - return graphql.Null - } - if resTmp == nil { 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_updateVPNDevice(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_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() { @@ -28505,15 +25994,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevice(ctx conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateVPNDevice_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_updateVPNDevicePorts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVPNDevicePorts(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 } @@ -28527,7 +26016,7 @@ 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)) + 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 { @@ -28569,7 +26058,7 @@ func (ec *executionContext) _Mutation_core_updateVPNDevicePorts(ctx context.Cont return ec.marshalNBoolean2bool(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_Mutation_core_updateVpnDeviceNs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -28586,15 +26075,15 @@ func (ec *executionContext) fieldContext_Mutation_core_updateVPNDevicePorts(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_core_updateVPNDevicePorts_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_updateVPNDeviceEnv(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_core_updateVPNDeviceEnv(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 } @@ -28608,169 +26097,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)) - } - 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_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) { - 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)) + 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 { @@ -29163,8 +26490,8 @@ func (ec *executionContext) fieldContext_Port_targetPort(ctx context.Context, fi 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) +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 } @@ -29176,8 +26503,34 @@ func (ec *executionContext) _Project_accountName(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AccountName, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + 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 { + 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) @@ -29189,26 +26542,43 @@ func (ec *executionContext) _Project_accountName(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*domain.CheckNameAvailabilityOutput) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNConsoleCheckNameAvailabilityOutput2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐCheckNameAvailabilityOutput(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_accountName(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: "Project", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + 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") + 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) _Project_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_apiVersion(ctx, field) +func (ec *executionContext) _Query_core_listEnvironments(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listEnvironments(ctx, field) if err != nil { return graphql.Null } @@ -29220,8 +26590,34 @@ func (ec *executionContext) _Project_apiVersion(ctx context.Context, field graph } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.APIVersion, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + 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 { + 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.EnvironmentPaginatedRecords); 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.EnvironmentPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -29230,26 +26626,45 @@ func (ec *executionContext) _Project_apiVersion(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.EnvironmentPaginatedRecords) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listEnvironments(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + 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") + switch field.Name { + case "edges": + return ec.fieldContext_EnvironmentPaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EnvironmentPaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_EnvironmentPaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EnvironmentPaginatedRecords", 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_listEnvironments_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } 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) +func (ec *executionContext) _Query_core_getEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -29261,8 +26676,34 @@ func (ec *executionContext) _Project_clusterName(ctx context.Context, field grap } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClusterName, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreGetEnvironment(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.Environment); 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) }) if err != nil { ec.Error(ctx, err) @@ -29271,26 +26712,71 @@ func (ec *executionContext) _Project_clusterName(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*entities.Environment) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_clusterName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getEnvironment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Project", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + 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") + switch field.Name { + case "accountName": + 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": + return ec.fieldContext_Environment_creationTime(ctx, field) + case "displayName": + return ec.fieldContext_Environment_displayName(ctx, field) + case "id": + return ec.fieldContext_Environment_id(ctx, field) + case "kind": + return ec.fieldContext_Environment_kind(ctx, field) + case "lastUpdatedBy": + return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) + case "markedForDeletion": + return ec.fieldContext_Environment_markedForDeletion(ctx, field) + case "metadata": + return ec.fieldContext_Environment_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) + case "syncStatus": + return ec.fieldContext_Environment_syncStatus(ctx, field) + case "updateTime": + return ec.fieldContext_Environment_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Environment", 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_getEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } 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) +func (ec *executionContext) _Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncEnvironment(ctx, field) if err != nil { return graphql.Null } @@ -29302,8 +26788,34 @@ func (ec *executionContext) _Project_createdBy(ctx context.Context, field graphq } }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedBy, nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().CoreResyncEnvironment(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.(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) @@ -29315,34 +26827,37 @@ func (ec *executionContext) _Project_createdBy(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(bool) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Project_createdBy(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: "Project", + Object: "Query", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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 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) _Project_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_creationTime(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 } @@ -29354,39 +26869,81 @@ func (ec *executionContext) _Project_creationTime(ctx context.Context, field gra } }() 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) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + 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 { + 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 { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.ImagePullSecretPaginatedRecords) fc.Result = res - return ec.marshalNDate2string(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_Project_creationTime(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: "Project", + 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 Date does not have child fields") + 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) _Project_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Project) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Project_displayName(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 } @@ -29398,2564 +26955,9 @@ func (ec *executionContext) _Project_displayName(ctx context.Context, field grap } }() 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) - 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().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) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.ProjectPaginatedRecords) - fc.Result = res - return ec.marshalOProjectPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐProjectPaginatedRecords(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_listProjects(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_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) - }, - } - 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) - 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().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) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Project) - fc.Result = res - return ec.marshalOProject2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐProject(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_getProject(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_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) - }, - } - 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) - 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().CoreResyncProject(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.(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_resyncProject(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_resyncProject_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_listEnvironments(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listEnvironments(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().CoreListEnvironments(rctx, fc.Args["projectName"].(string), fc.Args["search"].(*model.SearchEnvironments), 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.EnvironmentPaginatedRecords); 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.EnvironmentPaginatedRecords`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.EnvironmentPaginatedRecords) - fc.Result = res - return ec.marshalOEnvironmentPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐEnvironmentPaginatedRecords(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_listEnvironments(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_EnvironmentPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_EnvironmentPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_EnvironmentPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type EnvironmentPaginatedRecords", 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_listEnvironments_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_getEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getEnvironment(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().CoreGetEnvironment(rctx, fc.Args["projectName"].(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.Environment); 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) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.Environment) - fc.Result = res - return ec.marshalOEnvironment2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐEnvironment(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_getEnvironment(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_Environment_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Environment_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_Environment_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_Environment_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_Environment_displayName(ctx, field) - case "id": - return ec.fieldContext_Environment_id(ctx, field) - case "kind": - return ec.fieldContext_Environment_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_Environment_lastUpdatedBy(ctx, field) - case "markedForDeletion": - 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": - return ec.fieldContext_Environment_spec(ctx, field) - case "status": - return ec.fieldContext_Environment_status(ctx, field) - case "syncStatus": - return ec.fieldContext_Environment_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_Environment_updateTime(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Environment", 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_getEnvironment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_resyncEnvironment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncEnvironment(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().CoreResyncEnvironment(rctx, fc.Args["projectName"].(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_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)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + 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 { @@ -32024,8 +27026,6 @@ func (ec *executionContext) fieldContext_Query_core_getImagePullSecret(ctx conte 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": @@ -32071,7 +27071,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 { @@ -32152,7 +27152,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 { @@ -32238,7 +27238,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 { @@ -32311,8 +27311,6 @@ func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, 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": @@ -32358,341 +27356,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)) - } - 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_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) { - 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_resyncApp_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) - 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().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 { - 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_restartApp(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_restartApp_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) - 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().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 { - 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.([]*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.ConfigKeyValueRef`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*domain.ConfigKeyValueRef) - fc.Result = res - return ec.marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx, field.Selections, res) -} - -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, - IsMethod: true, - 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) - } - return nil, fmt.Errorf("no field named %q was found under type ConfigKeyValueRef", 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_getConfigValues_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) - 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().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 { - 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.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.ConfigPaginatedRecords`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.ConfigPaginatedRecords) - fc.Result = 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_listConfigs(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_ConfigPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ConfigPaginatedRecords", 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_listConfigs_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) - 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().CoreGetConfig(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 { @@ -32714,69 +27378,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 +27415,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 +27437,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["envName"].(string), fc.Args["appName"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32850,7 +27479,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 +27496,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 +27518,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["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32911,10 +27540,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 +27552,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 +27565,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 +27582,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 +27604,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["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 +27626,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 +27638,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 +27652,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 +27668,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 +27690,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33083,10 +27712,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 +27724,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 +27738,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 +27782,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 +27804,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33223,7 +27846,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 +27863,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 +27885,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["envName"].(string), fc.Args["queries"].([]*domain.SecretKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33284,10 +27907,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 +27919,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 +27932,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 +27949,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 +27971,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["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 +27993,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 +28005,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 +28018,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 +28035,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 +28057,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33486,34 +28079,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 +28153,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 +28175,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33567,10 +28197,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 +28212,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 +28234,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 +28256,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["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 +28278,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 +28303,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 +28320,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 +28342,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33737,10 +28364,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 +28376,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 +28389,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 +28434,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 +28456,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33823,71 +28478,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 +28515,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 +28537,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33941,10 +28559,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 +28574,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 +28596,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 +28618,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["envName"].(string), fc.Args["keyrefs"].([]*domain.ManagedResourceKeyRef)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34022,24 +28640,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 +28668,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 +28685,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 +28707,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["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 +28729,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 +28741,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 +28754,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 +28771,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 +28793,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34220,34 +28815,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 +28887,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 +28909,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["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34321,7 +28951,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 +28968,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 } @@ -34519,8 +29149,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": @@ -34628,8 +29256,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": @@ -35437,50 +30063,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 +30437,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 +31232,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 +31571,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": @@ -39504,7 +34038,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 { @@ -39567,15 +34101,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 @@ -39728,7 +34253,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 +34269,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 @@ -39918,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{}{} @@ -40476,22 +35048,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 @@ -40682,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 { @@ -40698,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 @@ -40751,53 +35323,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 +35518,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 +35731,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 +36558,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{}{} @@ -42473,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 { @@ -42489,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 @@ -43120,11 +37375,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 +37800,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 { @@ -43937,8 +38182,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 { @@ -44297,6 +38540,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 +38607,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 { @@ -44866,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 { @@ -45329,11 +39616,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": @@ -45513,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 { @@ -45582,49 +39866,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 +40025,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 +40173,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 { @@ -46329,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 { @@ -46362,279 +40473,37 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator return out } -var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} - -func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors) - - 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___pkg___operator__ResourceRef") - case "apiVersion": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "kind": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "name": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "namespace": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(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___pkg___operator__StatusImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Status"} - -func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__StatusImplementors) - - 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___pkg___operator__Status") - case "checkList": - 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._Github__com___kloudlite___operator___pkg___operator__Status_checkList(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) }) - case "checks": - 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._Github__com___kloudlite___operator___pkg___operator__Status_checks(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) }) - case "isReady": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_isReady(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "lastReadyGeneration": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field, obj) - case "lastReconcileTime": - 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._Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(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) }) - case "message": - 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._Github__com___kloudlite___operator___pkg___operator__Status_message(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) }) - case "resources": - 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._Github__com___kloudlite___operator___pkg___operator__Status_resources(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 github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors = []string{"Github__com___kloudlite___operator___pkg___raw____json__RawJson"} +var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} -func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors) 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___pkg___raw____json__RawJson") - case "RawMessage": - out.Values[i] = ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__ResourceRef") + case "apiVersion": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "kind": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "namespace": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef_namespace(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -46658,28 +40527,18 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____j return out } -var imagePullSecretImplementors = []string{"ImagePullSecret"} +var github__com___kloudlite___operator___pkg___operator__StatusImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__Status"} -func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.SelectionSet, obj *entities.ImagePullSecret) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretImplementors) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status(ctx context.Context, sel ast.SelectionSet, obj *operator.Status) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__StatusImplementors) 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("ImagePullSecret") - case "accountName": - out.Values[i] = ec._ImagePullSecret_accountName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "createdBy": - out.Values[i] = ec._ImagePullSecret_createdBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "creationTime": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checkList": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -46688,10 +40547,7 @@ func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ImagePullSecret_creationTime(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field, obj) return res } @@ -46715,19 +40571,7 @@ func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.Select } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "displayName": - out.Values[i] = ec._ImagePullSecret_displayName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "dockerConfigJson": - out.Values[i] = ec._ImagePullSecret_dockerConfigJson(ctx, field, obj) - case "environmentName": - out.Values[i] = ec._ImagePullSecret_environmentName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "format": + case "checks": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -46736,10 +40580,7 @@ func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ImagePullSecret_format(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field, obj) return res } @@ -46763,210 +40604,14 @@ func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.Select } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "id": - out.Values[i] = ec._ImagePullSecret_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "lastUpdatedBy": - out.Values[i] = ec._ImagePullSecret_lastUpdatedBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "markedForDeletion": - out.Values[i] = ec._ImagePullSecret_markedForDeletion(ctx, field, obj) - case "metadata": - out.Values[i] = ec._ImagePullSecret_metadata(ctx, field, obj) - 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 { - atomic.AddUint32(&out.Invalids, 1) - } - case "registryPassword": - out.Values[i] = ec._ImagePullSecret_registryPassword(ctx, field, obj) - case "registryURL": - out.Values[i] = ec._ImagePullSecret_registryURL(ctx, field, obj) - case "registryUsername": - out.Values[i] = ec._ImagePullSecret_registryUsername(ctx, field, obj) - case "syncStatus": - out.Values[i] = ec._ImagePullSecret_syncStatus(ctx, field, obj) + case "isReady": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_isReady(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._ImagePullSecret_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.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 imagePullSecretEdgeImplementors = []string{"ImagePullSecretEdge"} - -func (ec *executionContext) _ImagePullSecretEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretEdgeImplementors) - - 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("ImagePullSecretEdge") - case "cursor": - out.Values[i] = ec._ImagePullSecretEdge_cursor(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "node": - out.Values[i] = ec._ImagePullSecretEdge_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 imagePullSecretPaginatedRecordsImplementors = []string{"ImagePullSecretPaginatedRecords"} - -func (ec *executionContext) _ImagePullSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretPaginatedRecords) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretPaginatedRecordsImplementors) - - 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("ImagePullSecretPaginatedRecords") - case "edges": - out.Values[i] = ec._ImagePullSecretPaginatedRecords_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "pageInfo": - out.Values[i] = ec._ImagePullSecretPaginatedRecords_pageInfo(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "totalCount": - out.Values[i] = ec._ImagePullSecretPaginatedRecords_totalCount(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___api___core___v1__SecretImplementors = []string{"K8s__io___api___core___v1__Secret"} - -func (ec *executionContext) _K8s__io___api___core___v1__Secret(ctx context.Context, sel ast.SelectionSet, obj *v12.Secret) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__SecretImplementors) - - 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__Secret") - case "apiVersion": - out.Values[i] = ec._K8s__io___api___core___v1__Secret_apiVersion(ctx, field, obj) - case "data": + case "lastReadyGeneration": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReadyGeneration(ctx, field, obj) + case "lastReconcileTime": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -46975,7 +40620,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_data(ctx, field, obj) + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_lastReconcileTime(ctx, field, obj) return res } @@ -46999,13 +40644,7 @@ func (ec *executionContext) _K8s__io___api___core___v1__Secret(ctx context.Conte } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "immutable": - out.Values[i] = ec._K8s__io___api___core___v1__Secret_immutable(ctx, field, obj) - case "kind": - out.Values[i] = ec._K8s__io___api___core___v1__Secret_kind(ctx, field, obj) - case "metadata": - out.Values[i] = ec._K8s__io___api___core___v1__Secret_metadata(ctx, field, obj) - case "stringData": + case "message": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47014,7 +40653,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_stringData(ctx, field, obj) + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_message(ctx, field, obj) return res } @@ -47038,7 +40677,7 @@ func (ec *executionContext) _K8s__io___api___core___v1__Secret(ctx context.Conte } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "type": + case "resources": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47047,7 +40686,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) + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_resources(ctx, field, obj) return res } @@ -47094,170 +40733,19 @@ func (ec *executionContext) _K8s__io___api___core___v1__Secret(ctx context.Conte 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"} +var github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors = []string{"Github__com___kloudlite___operator___pkg___raw____json__RawJson"} -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) +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___raw____json__RawJson(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgRawJSONRawJSON) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___raw____json__RawJsonImplementors) 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) + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___raw____json__RawJson") + case "RawMessage": + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___raw____json__RawJson_RawMessage(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -47281,26 +40769,24 @@ func (ec *executionContext) _K8s__io___apimachinery___pkg___apis___meta___v1__La return out } -var managedResourceImplementors = []string{"ManagedResource"} +var imagePullSecretImplementors = []string{"ImagePullSecret"} -func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.SelectionSet, obj *entities.ManagedResource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceImplementors) +func (ec *executionContext) _ImagePullSecret(ctx context.Context, sel ast.SelectionSet, obj *entities.ImagePullSecret) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretImplementors) 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") + out.Values[i] = graphql.MarshalString("ImagePullSecret") case "accountName": - out.Values[i] = ec._ManagedResource_accountName(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_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) + out.Values[i] = ec._ImagePullSecret_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -47313,7 +40799,7 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ManagedResource_creationTime(ctx, field, obj) + res = ec._ImagePullSecret_creationTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -47326,59 +40812,33 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select 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) + } 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 "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) + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "displayName": + out.Values[i] = ec._ImagePullSecret_displayName(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) + case "dockerConfigJson": + out.Values[i] = ec._ImagePullSecret_dockerConfigJson(ctx, field, obj) + case "environmentName": + out.Values[i] = ec._ImagePullSecret_environmentName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "spec": + case "format": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47387,7 +40847,7 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ManagedResource_spec(ctx, field, obj) + res = ec._ImagePullSecret_format(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -47414,12 +40874,36 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select } 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 "id": + out.Values[i] = ec._ImagePullSecret_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "lastUpdatedBy": + out.Values[i] = ec._ImagePullSecret_lastUpdatedBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "markedForDeletion": + out.Values[i] = ec._ImagePullSecret_markedForDeletion(ctx, field, obj) + case "metadata": + out.Values[i] = ec._ImagePullSecret_metadata(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 { + atomic.AddUint32(&out.Invalids, 1) + } + case "registryPassword": + out.Values[i] = ec._ImagePullSecret_registryPassword(ctx, field, obj) + case "registryURL": + out.Values[i] = ec._ImagePullSecret_registryURL(ctx, field, obj) + case "registryUsername": + out.Values[i] = ec._ImagePullSecret_registryUsername(ctx, field, obj) case "syncStatus": - out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) + out.Values[i] = ec._ImagePullSecret_syncStatus(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -47432,7 +40916,7 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ManagedResource_updateTime(ctx, field, obj) + res = ec._ImagePullSecret_updateTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -47482,117 +40966,24 @@ func (ec *executionContext) _ManagedResource(ctx context.Context, sel ast.Select return out } -var managedResourceEdgeImplementors = []string{"ManagedResourceEdge"} +var imagePullSecretEdgeImplementors = []string{"ImagePullSecretEdge"} -func (ec *executionContext) _ManagedResourceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ManagedResourceEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, managedResourceEdgeImplementors) +func (ec *executionContext) _ImagePullSecretEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretEdgeImplementors) 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") + out.Values[i] = graphql.MarshalString("ImagePullSecretEdge") case "cursor": - out.Values[i] = ec._ManagedResourceEdge_cursor(ctx, field, obj) + out.Values[i] = ec._ImagePullSecretEdge_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"} - -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("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)) - } - } - 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 managedResourceKeyValueRefImplementors = []string{"ManagedResourceKeyValueRef"} - -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("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) + out.Values[i] = ec._ImagePullSecretEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -47619,77 +41010,32 @@ func (ec *executionContext) _ManagedResourceKeyValueRef(ctx context.Context, sel return out } -var managedResourcePaginatedRecordsImplementors = []string{"ManagedResourcePaginatedRecords"} +var imagePullSecretPaginatedRecordsImplementors = []string{"ImagePullSecretPaginatedRecords"} -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) _ImagePullSecretPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.ImagePullSecretPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imagePullSecretPaginatedRecordsImplementors) 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") + out.Values[i] = graphql.MarshalString("ImagePullSecretPaginatedRecords") case "edges": - out.Values[i] = ec._ManagedResourcePaginatedRecords_edges(ctx, field, obj) + out.Values[i] = ec._ImagePullSecretPaginatedRecords_edges(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "pageInfo": - out.Values[i] = ec._ManagedResourcePaginatedRecords_pageInfo(ctx, field, obj) + out.Values[i] = ec._ImagePullSecretPaginatedRecords_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++ - } - 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 matchFilterImplementors = []string{"MatchFilter"} - -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("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] = ec._ImagePullSecretPaginatedRecords_totalCount(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)) } @@ -47713,87 +41059,20 @@ func (ec *executionContext) _MatchFilter(ctx context.Context, sel ast.SelectionS return out } -var metadataImplementors = []string{"Metadata"} +var k8s__io___api___core___v1__SecretImplementors = []string{"K8s__io___api___core___v1__Secret"} -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) _K8s__io___api___core___v1__Secret(ctx context.Context, sel ast.SelectionSet, obj *v12.Secret) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, k8s__io___api___core___v1__SecretImplementors) 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 - } - - 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 "creationTimestamp": - 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_creationTimestamp(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 "deletionTimestamp": + out.Values[i] = graphql.MarshalString("K8s__io___api___core___v1__Secret") + case "apiVersion": + out.Values[i] = ec._K8s__io___api___core___v1__Secret_apiVersion(ctx, field, obj) + case "data": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47802,7 +41081,7 @@ 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._K8s__io___api___core___v1__Secret_data(ctx, field, obj) return res } @@ -47826,12 +41105,13 @@ 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) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "labels": + case "immutable": + out.Values[i] = ec._K8s__io___api___core___v1__Secret_immutable(ctx, field, obj) + case "kind": + out.Values[i] = ec._K8s__io___api___core___v1__Secret_kind(ctx, field, obj) + case "metadata": + out.Values[i] = ec._K8s__io___api___core___v1__Secret_metadata(ctx, field, obj) + case "stringData": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -47840,7 +41120,7 @@ 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._K8s__io___api___core___v1__Secret_stringData(ctx, field, obj) return res } @@ -47857,244 +41137,146 @@ func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, 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 "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)) - } - } - 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 mutationImplementors = []string{"Mutation"} - -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("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++ + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - 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++ + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "type": + 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._K8s__io___api___core___v1__Secret_type(ctx, field, obj) + return res } - 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++ + + 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 "core_updateVpnDeviceNs": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVpnDeviceNs(ctx, field) - }) + + 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 "core_updateVpnClusterName": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_updateVpnClusterName(ctx, field) - }) + 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 "core_deleteVPNDevice": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_core_deleteVPNDevice(ctx, field) - }) + case "whenUnsatisfiable": + out.Values[i] = ec._K8s__io___api___core___v1__TopologySpreadConstraint_whenUnsatisfiable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -48121,25 +41303,21 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -var pageInfoImplementors = []string{"PageInfo"} +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelector"} -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) _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("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("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)) } @@ -48163,21 +41341,29 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, return out } -var portImplementors = []string{"Port"} +var k8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementImplementors = []string{"K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirement"} -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) _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("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("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)) } @@ -48201,28 +41387,26 @@ func (ec *executionContext) _Port(ctx context.Context, sel ast.SelectionSet, obj return out } -var projectImplementors = []string{"Project"} +var managedResourceImplementors = []string{"ManagedResource"} -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) _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("Project") + out.Values[i] = graphql.MarshalString("ManagedResource") case "accountName": - out.Values[i] = ec._Project_accountName(ctx, field, obj) + 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._Project_apiVersion(ctx, field, obj) - case "clusterName": - out.Values[i] = ec._Project_clusterName(ctx, field, obj) + out.Values[i] = ec._ManagedResource_apiVersion(ctx, field, obj) case "createdBy": - out.Values[i] = ec._Project_createdBy(ctx, field, obj) + out.Values[i] = ec._ManagedResource_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -48235,7 +41419,7 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Project_creationTime(ctx, field, obj) + res = ec._ManagedResource_creationTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -48263,28 +41447,35 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "displayName": - out.Values[i] = ec._Project_displayName(ctx, field, obj) + 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._Project_id(ctx, field, obj) + 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._Project_kind(ctx, field, obj) + out.Values[i] = ec._ManagedResource_kind(ctx, field, obj) case "lastUpdatedBy": - out.Values[i] = ec._Project_lastUpdatedBy(ctx, field, obj) + 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._Project_markedForDeletion(ctx, field, obj) + out.Values[i] = ec._ManagedResource_markedForDeletion(ctx, field, obj) case "metadata": - out.Values[i] = ec._Project_metadata(ctx, field, obj) + out.Values[i] = ec._ManagedResource_metadata(ctx, field, obj) case "recordVersion": - out.Values[i] = ec._Project_recordVersion(ctx, field, obj) + out.Values[i] = ec._ManagedResource_recordVersion(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -48297,7 +41488,7 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Project_spec(ctx, field, obj) + res = ec._ManagedResource_spec(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -48325,9 +41516,11 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "status": - out.Values[i] = ec._Project_status(ctx, field, obj) + 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._Project_syncStatus(ctx, field, obj) + out.Values[i] = ec._ManagedResource_syncStatus(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -48340,7 +41533,7 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Project_updateTime(ctx, field, obj) + res = ec._ManagedResource_updateTime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -48390,24 +41583,24 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, return out } -var projectEdgeImplementors = []string{"ProjectEdge"} +var managedResourceEdgeImplementors = []string{"ManagedResourceEdge"} -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) _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("ProjectEdge") + out.Values[i] = graphql.MarshalString("ManagedResourceEdge") case "cursor": - out.Values[i] = ec._ProjectEdge_cursor(ctx, field, obj) + out.Values[i] = ec._ManagedResourceEdge_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] = ec._ManagedResourceEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -48434,30 +41627,238 @@ func (ec *executionContext) _ProjectEdge(ctx context.Context, sel ast.SelectionS return out } -var projectManagedServiceImplementors = []string{"ProjectManagedService"} +var managedResourceKeyRefImplementors = []string{"ManagedResourceKeyRef"} -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) _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("ProjectManagedService") - case "accountName": - out.Values[i] = ec._ProjectManagedService_accountName(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 { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } - case "apiVersion": - out.Values[i] = ec._ProjectManagedService_apiVersion(ctx, field, obj) - case "createdBy": - out.Values[i] = ec._ProjectManagedService_createdBy(ctx, field, obj) + case "mresName": + out.Values[i] = ec._ManagedResourceKeyRef_mresName(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } - case "creationTime": + 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 managedResourceKeyValueRefImplementors = []string{"ManagedResourceKeyValueRef"} + +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("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)) + } + } + 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 managedResourcePaginatedRecordsImplementors = []string{"ManagedResourcePaginatedRecords"} + +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("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++ + } + 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 matchFilterImplementors = []string{"MatchFilter"} + +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("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)) + } + } + 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 metadataImplementors = []string{"Metadata"} + +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("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 + } + + 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 "creationTimestamp": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -48466,7 +41867,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 +41894,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 +41903,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 +41927,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 +41941,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 +41965,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 +41995,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 +42192,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 +42234,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 +42312,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 +42836,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 +43056,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 +43412,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 { @@ -51262,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) } @@ -51411,21 +44781,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 +44811,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 +44850,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 +45286,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)) { @@ -53050,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 @@ -53568,21 +46813,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 +47627,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 +47681,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..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"` @@ -255,13 +265,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"` } @@ -307,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 { @@ -326,18 +336,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 +384,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 +436,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"` } @@ -533,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"` } @@ -653,28 +622,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"` @@ -700,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/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..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_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 @@ -135,49 +132,50 @@ 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 - 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(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_updateProjectManagedService(pmsvc: ProjectManagedServiceIn!): ProjectManagedService @isLoggedInAndVerified @hasAccount + # core_deleteProjectManagedService(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 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 509b6f536..1ba3feb8a 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -27,282 +27,221 @@ 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) { +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) } - return r.Domain.CreateEnvironment(cc, projectName, env) + return r.Domain.CreateEnvironment(cc, env) } // 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) } - return r.Domain.UpdateEnvironment(cc, projectName, env) + return r.Domain.UpdateEnvironment(cc, env) } // 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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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. -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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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 } // 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) } - 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. -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) } - 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. -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) } - 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 @@ -343,9 +282,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) { - if projectName == "" && envName == "" { - return false, fmt.Errorf("projectName and envName cannot be empty") +func (r *mutationResolver) CoreUpdateVPNDeviceEnv(ctx context.Context, deviceName string, envName string) (bool, error) { + if envName == "" { + return false, fmt.Errorf("envName cannot be empty") } cc, err := toConsoleContext(ctx) @@ -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) } @@ -403,67 +342,16 @@ 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 } - 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. -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) @@ -473,9 +361,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 } @@ -484,7 +369,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) } @@ -493,29 +378,29 @@ 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) } - return r.Domain.GetEnvironment(cc, projectName, name) + return r.Domain.GetEnvironment(cc, name) } // 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) } - 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 } // 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) @@ -533,7 +418,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) } @@ -542,29 +427,29 @@ 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) } - 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. -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) } - 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 } // 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) @@ -582,7 +467,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) } @@ -591,40 +476,40 @@ 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) } - 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. -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) } - 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 } // 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) } - 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 } // 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) @@ -635,11 +520,11 @@ 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. -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) @@ -657,7 +542,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) } @@ -666,29 +551,29 @@ 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) } - 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. -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) } - 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 } // 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) @@ -699,11 +584,11 @@ 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. -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) @@ -721,7 +606,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) } @@ -730,28 +615,28 @@ 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) } - 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. -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) } - 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 } // 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) @@ -769,7 +654,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) } @@ -778,37 +663,37 @@ 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) } - 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. -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) } - 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 } // 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) } - 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. -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) @@ -819,11 +704,11 @@ 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. -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) @@ -845,7 +730,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) } @@ -854,94 +739,26 @@ 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) } - 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. -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) } - if err := r.Domain.ResyncManagedResource(newResourceContext(cc, projectName, envName), name); err != nil { + if err := r.Domain.ResyncManagedResource(newResourceContext(cc, 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 { - return false, errors.NewE(err) - } - - if err := r.Domain.RestartProjectManagedService(cc, projectName, name); err != nil { - return false, err - } - return true, nil -} - // CoreListVPNDevices is the resolver for the core_listVPNDevices field. func (r *queryResolver) CoreListVPNDevices(ctx context.Context, search *model.CoreSearchVPNDevices, pq *repos.CursorPagination) (*model.ConsoleVPNDevicePaginatedRecords, error) { filter := map[string]repos.MatchFilter{} 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..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 @@ -105,7 +110,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 } @@ -132,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! } @@ -140,12 +145,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 +169,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 +195,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!] } @@ -252,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! } @@ -349,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 @@ -419,7 +409,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 } @@ -446,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! } @@ -454,12 +444,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 +468,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 +494,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/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/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..32988bb56 100644 --- a/apps/console/internal/domain/environment.go +++ b/apps/console/internal/domain/environment.go @@ -1,9 +1,10 @@ package domain 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 +25,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 +96,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 +130,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 +145,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 +164,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 +173,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 +192,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 +230,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 +248,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 +289,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 +302,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 +386,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 +405,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 +422,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 +438,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 +455,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 +465,19 @@ 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) - hash := md5.Sum([]byte(envNamespace)) - return fmt.Sprintf("env-%s", hex.EncodeToString(hash[:])) +func (d *domain) getEnvironmentTargetNamespace(envName string) string { + 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, 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 +499,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 +555,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 +566,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 +578,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 +594,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 +611,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 +631,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 +653,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..00513ea91 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"` @@ -52,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/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..64f77df93 100644 --- a/apps/console/internal/entities/environment.go +++ b/apps/console/internal/entities/environment.go @@ -16,7 +16,7 @@ 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"` SyncStatus t.SyncStatus `json:"syncStatus" graphql:"noinput"` @@ -46,21 +46,22 @@ 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, }, { 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..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" @@ -52,7 +54,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 +113,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" @@ -221,7 +199,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/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..827785d7b 100644 --- a/apps/console/internal/entities/mres.go +++ b/apps/console/internal/entities/mres.go @@ -15,10 +15,8 @@ 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"` SyncedOutputSecretRef *corev1.Secret `json:"syncedOutputSecretRef" graphql:"noinput"` common.ResourceMetadata `json:",inline"` @@ -49,7 +47,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..f968c68d9 100644 --- a/apps/console/internal/entities/resource-mapping.go +++ b/apps/console/internal/entities/resource-mapping.go @@ -9,22 +9,19 @@ import ( type ResourceType string const ( - ResourceTypeProject ResourceType = "project" - 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 const ( - ResourceHeirarchyProject ResourceHeirarchy = "project" ResourceHeirarchyEnvironment ResourceHeirarchy = "environment" ) @@ -40,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/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/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/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/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 . ./ 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" 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/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/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) } 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