diff --git a/.tools/nvim/__http__/console/environments.graphql.yml b/.tools/nvim/__http__/console/environments.graphql.yml index 22d3b3828..f59b734f7 100644 --- a/.tools/nvim/__http__/console/environments.graphql.yml +++ b/.tools/nvim/__http__/console/environments.graphql.yml @@ -7,7 +7,7 @@ global: label: List Environments query: |+ #graphql query Core_listEnvironments { - core_listEnvironments() { + core_listEnvironments { edges { cursor node { @@ -46,7 +46,7 @@ query: |+ #graphql pageInfo { endCursor hasNextPage - hasPreviousPage + hasPrevPage startCursor } totalCount diff --git a/.tools/nvim/__http__/console/registry-image.graphql.yml b/.tools/nvim/__http__/console/registry-image.graphql.yml new file mode 100644 index 000000000..398a966dd --- /dev/null +++ b/.tools/nvim/__http__/console/registry-image.graphql.yml @@ -0,0 +1,72 @@ +--- +global: + image: "test-image:t1.0.0" +--- + +label: List Registry Images +query: |+ #graphql + query Core_listRegistryImages { + core_listRegistryImages { + edges { + cursor + node { + id + accountName + imageName + imageTag + meta + } + } + pageInfo { + endCursor + hasNextPage + hasPrevPage + startCursor + } + totalCount + } + } + +--- + +label: Get Registry Image +query: |+ + query Core_getRegistryImage($image: String!) { + core_getRegistryImage(image: $image) { + accountName + imageName + imageTag + meta + } + } +variables: + image: "{{.image}}" + +--- + +label: Delete Registry Image +query: |+ + mutation Core_deleteRegistryImage($image: String!) { + core_deleteRegistryImage(image: $image) + } +variables: + image: "{{.image}}" + +--- + +label: Get Registry Image URL +query: |+ + query Core_getRegistryImageURL($image: String!, $meta: Map!) { + core_getRegistryImageURL(image: $image, meta: $meta) { + url + scriptUrl + } + } +variables: + image: "{{.image}}" + meta: + registry: "github" + repository: "kloudlite/kloudlite-console" + tag: "latest" + +--- diff --git a/apps/console/Taskfile.yml b/apps/console/Taskfile.yml index 8063005a2..322f64544 100644 --- a/apps/console/Taskfile.yml +++ b/apps/console/Taskfile.yml @@ -36,12 +36,14 @@ tasks: --struct github.com/kloudlite/api/apps/console/internal/entities.ClusterManagedService --struct github.com/kloudlite/api/apps/console/internal/entities.ImportedManagedResource --struct github.com/kloudlite/api/apps/console/internal/entities.ImagePullSecret + --struct github.com/kloudlite/api/apps/console/internal/entities.RegistryImage + --struct github.com/kloudlite/api/apps/console/internal/entities.RegistryImageURL --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 Environment,App,ExternalApp,Secret,Config,Router,ManagedResource,ImportedManagedResource,ImagePullSecret,ClusterManagedService + go run main.go --dev --out-dir ../graph/struct-to-graphql --with-pagination Environment,App,ExternalApp,Secret,Config,Router,ManagedResource,ImportedManagedResource,ImagePullSecret,ClusterManagedService,RegistryImage popd - rm -rf ./internal/app/_struct-to-graphql diff --git a/apps/console/internal/app/app.go b/apps/console/internal/app/app.go index 9bf9d2fe4..bea14a365 100644 --- a/apps/console/internal/app/app.go +++ b/apps/console/internal/app/app.go @@ -73,6 +73,7 @@ var Module = fx.Module("app", repos.NewFxMongoRepo[*entities.ResourceMapping]("resource_mappings", "rmap", entities.ResourceMappingIndices), repos.NewFxMongoRepo[*entities.ServiceBinding]("service_bindings", "svcb", entities.ServiceBindingIndexes), repos.NewFxMongoRepo[*entities.ClusterManagedService]("cluster_managed_services", "cmsvc", entities.ClusterManagedServiceIndices), + repos.NewFxMongoRepo[*entities.RegistryImage]("registry_images", "reg_img", entities.RegistryImageIndexes), fx.Provide( func(conn IAMGrpcClient) iam.IAMClient { @@ -190,6 +191,37 @@ var Module = fx.Module("app", }) }), + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (WebhookConsumer, error) { + topic := string(common.ImageRegistryHookTopicName) + consumerName := "console:webhook" + return msg_nats.NewJetstreamConsumer(context.TODO(), jc, msg_nats.JetstreamConsumerArgs{ + Stream: ev.EventsNatsStream, + ConsumerConfig: msg_nats.ConsumerConfig{ + Name: consumerName, + Durable: consumerName, + Description: "this consumer reads message from a subject dedicated to console registry webhooks", + FilterSubjects: []string{topic}, + }, + }) + }), + + fx.Invoke(func(lf fx.Lifecycle, consumer WebhookConsumer, d domain.Domain, logger logging.Logger) { + lf.Append(fx.Hook{ + OnStart: func(context.Context) error { + go func() { + err := processWebhooks(consumer, d, logger) + if err != nil { + logger.Errorf(err, "could not process webhooks") + } + }() + return nil + }, + OnStop: func(ctx context.Context) error { + return consumer.Stop(ctx) + }, + }) + }), + fx.Provide(func(jc *nats.JetstreamClient, ev *env.Env, logger logging.Logger) (ResourceUpdateConsumer, error) { topic := common.ReceiveFromAgentSubjectName(common.ReceiveFromAgentArgs{AccountName: "*", ClusterName: "*"}, common.ConsoleReceiver, common.EventResourceUpdate) diff --git a/apps/console/internal/app/gqlgen.yml b/apps/console/internal/app/gqlgen.yml index d74bd8bef..cec924e7b 100644 --- a/apps/console/internal/app/gqlgen.yml +++ b/apps/console/internal/app/gqlgen.yml @@ -80,6 +80,10 @@ models: model: github.com/kloudlite/api/apps/console/internal/entities.Environment EnvironmentIn: *environment-model + RegistryImage: ®istry-image-model + model: github.com/kloudlite/api/apps/console/internal/entities.RegistryImage + RegistryImageIn: *registry-image-model + Secret: &secret-model model: github.com/kloudlite/api/apps/console/internal/entities.Secret SecretIn: *secret-model diff --git a/apps/console/internal/app/graph/environment.resolvers.go b/apps/console/internal/app/graph/environment.resolvers.go index 56fb103eb..87b483980 100644 --- a/apps/console/internal/app/graph/environment.resolvers.go +++ b/apps/console/internal/app/graph/environment.resolvers.go @@ -6,9 +6,8 @@ package graph import ( "context" - "time" - "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" @@ -75,7 +74,5 @@ func (r *Resolver) Environment() generated.EnvironmentResolver { return &environ // EnvironmentIn returns generated.EnvironmentInResolver implementation. func (r *Resolver) EnvironmentIn() generated.EnvironmentInResolver { return &environmentInResolver{r} } -type ( - environmentResolver struct{ *Resolver } - environmentInResolver struct{ *Resolver } -) +type environmentResolver struct{ *Resolver } +type environmentInResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index 90af2eebd..792f6e81d 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -65,6 +65,7 @@ type ResolverRoot interface { Metadata() MetadataResolver Mutation() MutationResolver Query() QueryResolver + RegistryImage() RegistryImageResolver Router() RouterResolver Secret() SecretResolver AppIn() AppInResolver @@ -753,6 +754,7 @@ type ComplexityRoot struct { CoreDeleteImagePullSecret func(childComplexity int, name string) int CoreDeleteImportedManagedResource func(childComplexity int, envName string, importName string) int CoreDeleteManagedResource func(childComplexity int, msvcName string, mresName string) int + CoreDeleteRegistryImage func(childComplexity int, image string) int CoreDeleteRouter func(childComplexity int, envName string, routerName string) int CoreDeleteSecret func(childComplexity int, envName string, secretName string) int CoreImportManagedResource func(childComplexity int, envName string, msvcName string, mresName string, importName string) int @@ -796,6 +798,8 @@ type ComplexityRoot struct { CoreGetManagedResouceOutputKeyValues func(childComplexity int, msvcName *string, envName *string, keyrefs []*domain.ManagedResourceKeyRef) int CoreGetManagedResouceOutputKeys func(childComplexity int, msvcName *string, envName *string, name string) int CoreGetManagedResource func(childComplexity int, msvcName *string, envName *string, name string) int + CoreGetRegistryImage func(childComplexity int, image string) int + CoreGetRegistryImageURL func(childComplexity int, image string, meta map[string]interface{}) 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 @@ -806,6 +810,7 @@ type ComplexityRoot struct { CoreListImagePullSecrets func(childComplexity int, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) int CoreListImportedManagedResources func(childComplexity int, envName string, search *model.SearchImportedManagedResources, pq *repos.CursorPagination) int CoreListManagedResources func(childComplexity int, search *model.SearchManagedResources, pq *repos.CursorPagination) int + CoreListRegistryImages func(childComplexity int, 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 CoreRestartApp func(childComplexity int, envName string, appName string) int @@ -823,6 +828,56 @@ type ComplexityRoot struct { __resolve_entities func(childComplexity int, representations []map[string]interface{}) int } + RegistryImage struct { + AccountName func(childComplexity int) int + CreationTime func(childComplexity int) int + Id func(childComplexity int) int + ImageName func(childComplexity int) int + ImageTag func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Meta func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + RegistryImageCredentials struct { + AccountName func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreationTime func(childComplexity int) int + ID func(childComplexity int) int + MarkedForDeletion func(childComplexity int) int + Password func(childComplexity int) int + RecordVersion func(childComplexity int) int + UpdateTime func(childComplexity int) int + } + + RegistryImageCredentialsEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + RegistryImageCredentialsPaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + RegistryImageEdge struct { + Cursor func(childComplexity int) int + Node func(childComplexity int) int + } + + RegistryImagePaginatedRecords struct { + Edges func(childComplexity int) int + PageInfo func(childComplexity int) int + TotalCount func(childComplexity int) int + } + + RegistryImageURL struct { + ScriptURL func(childComplexity int) int + URL func(childComplexity int) int + } + Router struct { APIVersion func(childComplexity int) int AccountName func(childComplexity int) int @@ -1008,6 +1063,7 @@ type MutationResolver interface { CoreCreateImagePullSecret(ctx context.Context, pullSecret entities.ImagePullSecret) (*entities.ImagePullSecret, error) CoreUpdateImagePullSecret(ctx context.Context, pullSecret entities.ImagePullSecret) (*entities.ImagePullSecret, error) CoreDeleteImagePullSecret(ctx context.Context, name string) (bool, error) + CoreDeleteRegistryImage(ctx context.Context, image 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) @@ -1044,6 +1100,9 @@ type QueryResolver interface { CoreListImagePullSecrets(ctx context.Context, search *model.SearchImagePullSecrets, pq *repos.CursorPagination) (*model.ImagePullSecretPaginatedRecords, error) CoreGetImagePullSecret(ctx context.Context, name string) (*entities.ImagePullSecret, error) CoreResyncImagePullSecret(ctx context.Context, name string) (bool, error) + CoreGetRegistryImageURL(ctx context.Context, image string, meta map[string]interface{}) (*model.RegistryImageURL, error) + CoreGetRegistryImage(ctx context.Context, image string) (*entities.RegistryImage, error) + CoreListRegistryImages(ctx context.Context, pq *repos.CursorPagination) (*model.RegistryImagePaginatedRecords, 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) @@ -1071,6 +1130,11 @@ type QueryResolver interface { CoreResyncManagedResource(ctx context.Context, msvcName string, name string) (bool, error) CoreListImportedManagedResources(ctx context.Context, envName string, search *model.SearchImportedManagedResources, pq *repos.CursorPagination) (*model.ImportedManagedResourcePaginatedRecords, error) } +type RegistryImageResolver interface { + CreationTime(ctx context.Context, obj *entities.RegistryImage) (string, error) + + UpdateTime(ctx context.Context, obj *entities.RegistryImage) (string, error) +} type RouterResolver interface { CreationTime(ctx context.Context, obj *entities.Router) (string, error) @@ -4220,6 +4284,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CoreDeleteManagedResource(childComplexity, args["msvcName"].(string), args["mresName"].(string)), true + case "Mutation.core_deleteRegistryImage": + if e.complexity.Mutation.CoreDeleteRegistryImage == nil { + break + } + + args, err := ec.field_Mutation_core_deleteRegistryImage_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CoreDeleteRegistryImage(childComplexity, args["image"].(string)), true + case "Mutation.core_deleteRouter": if e.complexity.Mutation.CoreDeleteRouter == nil { break @@ -4598,6 +4674,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreGetManagedResource(childComplexity, args["msvcName"].(*string), args["envName"].(*string), args["name"].(string)), true + case "Query.core_getRegistryImage": + if e.complexity.Query.CoreGetRegistryImage == nil { + break + } + + args, err := ec.field_Query_core_getRegistryImage_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CoreGetRegistryImage(childComplexity, args["image"].(string)), true + + case "Query.core_getRegistryImageURL": + if e.complexity.Query.CoreGetRegistryImageURL == nil { + break + } + + args, err := ec.field_Query_core_getRegistryImageURL_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CoreGetRegistryImageURL(childComplexity, args["image"].(string), args["meta"].(map[string]interface{})), true + case "Query.core_getRouter": if e.complexity.Query.CoreGetRouter == nil { break @@ -4718,6 +4818,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.CoreListManagedResources(childComplexity, args["search"].(*model.SearchManagedResources), args["pq"].(*repos.CursorPagination)), true + case "Query.core_listRegistryImages": + if e.complexity.Query.CoreListRegistryImages == nil { + break + } + + args, err := ec.field_Query_core_listRegistryImages_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.CoreListRegistryImages(childComplexity, args["pq"].(*repos.CursorPagination)), true + case "Query.core_listRouters": if e.complexity.Query.CoreListRouters == nil { break @@ -4893,6 +5005,209 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.__resolve_entities(childComplexity, args["representations"].([]map[string]interface{})), true + case "RegistryImage.accountName": + if e.complexity.RegistryImage.AccountName == nil { + break + } + + return e.complexity.RegistryImage.AccountName(childComplexity), true + + case "RegistryImage.creationTime": + if e.complexity.RegistryImage.CreationTime == nil { + break + } + + return e.complexity.RegistryImage.CreationTime(childComplexity), true + + case "RegistryImage.id": + if e.complexity.RegistryImage.Id == nil { + break + } + + return e.complexity.RegistryImage.Id(childComplexity), true + + case "RegistryImage.imageName": + if e.complexity.RegistryImage.ImageName == nil { + break + } + + return e.complexity.RegistryImage.ImageName(childComplexity), true + + case "RegistryImage.imageTag": + if e.complexity.RegistryImage.ImageTag == nil { + break + } + + return e.complexity.RegistryImage.ImageTag(childComplexity), true + + case "RegistryImage.markedForDeletion": + if e.complexity.RegistryImage.MarkedForDeletion == nil { + break + } + + return e.complexity.RegistryImage.MarkedForDeletion(childComplexity), true + + case "RegistryImage.meta": + if e.complexity.RegistryImage.Meta == nil { + break + } + + return e.complexity.RegistryImage.Meta(childComplexity), true + + case "RegistryImage.recordVersion": + if e.complexity.RegistryImage.RecordVersion == nil { + break + } + + return e.complexity.RegistryImage.RecordVersion(childComplexity), true + + case "RegistryImage.updateTime": + if e.complexity.RegistryImage.UpdateTime == nil { + break + } + + return e.complexity.RegistryImage.UpdateTime(childComplexity), true + + case "RegistryImageCredentials.accountName": + if e.complexity.RegistryImageCredentials.AccountName == nil { + break + } + + return e.complexity.RegistryImageCredentials.AccountName(childComplexity), true + + case "RegistryImageCredentials.createdBy": + if e.complexity.RegistryImageCredentials.CreatedBy == nil { + break + } + + return e.complexity.RegistryImageCredentials.CreatedBy(childComplexity), true + + case "RegistryImageCredentials.creationTime": + if e.complexity.RegistryImageCredentials.CreationTime == nil { + break + } + + return e.complexity.RegistryImageCredentials.CreationTime(childComplexity), true + + case "RegistryImageCredentials.id": + if e.complexity.RegistryImageCredentials.ID == nil { + break + } + + return e.complexity.RegistryImageCredentials.ID(childComplexity), true + + case "RegistryImageCredentials.markedForDeletion": + if e.complexity.RegistryImageCredentials.MarkedForDeletion == nil { + break + } + + return e.complexity.RegistryImageCredentials.MarkedForDeletion(childComplexity), true + + case "RegistryImageCredentials.password": + if e.complexity.RegistryImageCredentials.Password == nil { + break + } + + return e.complexity.RegistryImageCredentials.Password(childComplexity), true + + case "RegistryImageCredentials.recordVersion": + if e.complexity.RegistryImageCredentials.RecordVersion == nil { + break + } + + return e.complexity.RegistryImageCredentials.RecordVersion(childComplexity), true + + case "RegistryImageCredentials.updateTime": + if e.complexity.RegistryImageCredentials.UpdateTime == nil { + break + } + + return e.complexity.RegistryImageCredentials.UpdateTime(childComplexity), true + + case "RegistryImageCredentialsEdge.cursor": + if e.complexity.RegistryImageCredentialsEdge.Cursor == nil { + break + } + + return e.complexity.RegistryImageCredentialsEdge.Cursor(childComplexity), true + + case "RegistryImageCredentialsEdge.node": + if e.complexity.RegistryImageCredentialsEdge.Node == nil { + break + } + + return e.complexity.RegistryImageCredentialsEdge.Node(childComplexity), true + + case "RegistryImageCredentialsPaginatedRecords.edges": + if e.complexity.RegistryImageCredentialsPaginatedRecords.Edges == nil { + break + } + + return e.complexity.RegistryImageCredentialsPaginatedRecords.Edges(childComplexity), true + + case "RegistryImageCredentialsPaginatedRecords.pageInfo": + if e.complexity.RegistryImageCredentialsPaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.RegistryImageCredentialsPaginatedRecords.PageInfo(childComplexity), true + + case "RegistryImageCredentialsPaginatedRecords.totalCount": + if e.complexity.RegistryImageCredentialsPaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.RegistryImageCredentialsPaginatedRecords.TotalCount(childComplexity), true + + case "RegistryImageEdge.cursor": + if e.complexity.RegistryImageEdge.Cursor == nil { + break + } + + return e.complexity.RegistryImageEdge.Cursor(childComplexity), true + + case "RegistryImageEdge.node": + if e.complexity.RegistryImageEdge.Node == nil { + break + } + + return e.complexity.RegistryImageEdge.Node(childComplexity), true + + case "RegistryImagePaginatedRecords.edges": + if e.complexity.RegistryImagePaginatedRecords.Edges == nil { + break + } + + return e.complexity.RegistryImagePaginatedRecords.Edges(childComplexity), true + + case "RegistryImagePaginatedRecords.pageInfo": + if e.complexity.RegistryImagePaginatedRecords.PageInfo == nil { + break + } + + return e.complexity.RegistryImagePaginatedRecords.PageInfo(childComplexity), true + + case "RegistryImagePaginatedRecords.totalCount": + if e.complexity.RegistryImagePaginatedRecords.TotalCount == nil { + break + } + + return e.complexity.RegistryImagePaginatedRecords.TotalCount(childComplexity), true + + case "RegistryImageURL.scriptUrl": + if e.complexity.RegistryImageURL.ScriptURL == nil { + break + } + + return e.complexity.RegistryImageURL.ScriptURL(childComplexity), true + + case "RegistryImageURL.url": + if e.complexity.RegistryImageURL.URL == nil { + break + } + + return e.complexity.RegistryImageURL.URL(childComplexity), true + case "Router.apiVersion": if e.complexity.Router.APIVersion == nil { break @@ -5332,6 +5647,9 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputMatchFilterIn, ec.unmarshalInputMetadataIn, ec.unmarshalInputPortIn, + ec.unmarshalInputRegistryImageCredentialsIn, + ec.unmarshalInputRegistryImageIn, + ec.unmarshalInputRegistryImageURLIn, ec.unmarshalInputRouterIn, ec.unmarshalInputSearchApps, ec.unmarshalInputSearchClusterManagedService, @@ -5343,6 +5661,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputSearchManagedResources, ec.unmarshalInputSearchProjectManagedService, ec.unmarshalInputSearchProjects, + ec.unmarshalInputSearchRegistryImages, ec.unmarshalInputSearchRouters, ec.unmarshalInputSearchSecrets, ec.unmarshalInputSecretIn, @@ -5458,6 +5777,7 @@ enum ConsoleResType { managed_resource imported_managed_resource environment + registry_image vpn_device } @@ -5484,6 +5804,10 @@ input SearchEnvironments { markedForDeletion: MatchFilterIn } +input SearchRegistryImages { + text: MatchFilterIn +} + input SearchApps { text: MatchFilterIn isReady: MatchFilterIn @@ -5558,6 +5882,10 @@ type Query { core_getImagePullSecret(name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount core_resyncImagePullSecret(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_getRegistryImageURL(image: String!, meta: Map!): RegistryImageURL! @isLoggedInAndVerified @hasAccount + core_getRegistryImage(image: String!,): RegistryImage @isLoggedInAndVerified @hasAccount + core_listRegistryImages(pq: CursorPaginationIn): RegistryImagePaginatedRecords @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 @@ -5604,6 +5932,8 @@ type Mutation { core_updateImagePullSecret(pullSecret: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount core_deleteImagePullSecret(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_deleteRegistryImage(image: 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 @@ -6856,6 +7186,76 @@ input PortIn { targetPort: Int } +`, BuiltIn: false}, + {Name: "../struct-to-graphql/registryimage.graphqls", Input: `type RegistryImage @shareable { + accountName: String! + creationTime: Date! + id: ID! + imageName: String! + imageTag: String! + markedForDeletion: Boolean + meta: Map! + recordVersion: Int! + updateTime: Date! +} + +type RegistryImageEdge @shareable { + cursor: String! + node: RegistryImage! +} + +type RegistryImagePaginatedRecords @shareable { + edges: [RegistryImageEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RegistryImageIn { + accountName: String! + imageName: String! + imageTag: String! + meta: Map! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/registryimagecredentials.graphqls", Input: `type RegistryImageCredentials @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + id: ID! + markedForDeletion: Boolean + password: String! + recordVersion: Int! + updateTime: Date! +} + +type RegistryImageCredentialsEdge @shareable { + cursor: String! + node: RegistryImageCredentials! +} + +type RegistryImageCredentialsPaginatedRecords @shareable { + edges: [RegistryImageCredentialsEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RegistryImageCredentialsIn { + accountName: String! + password: String! +} + +`, BuiltIn: false}, + {Name: "../struct-to-graphql/registryimageurl.graphqls", Input: `type RegistryImageURL @shareable { + scriptUrl: String! + url: String! +} + +input RegistryImageURLIn { + scriptUrl: String! + url: String! +} + `, BuiltIn: false}, {Name: "../struct-to-graphql/router.graphqls", Input: `type Router @shareable { accountName: String! @@ -7440,6 +7840,21 @@ func (ec *executionContext) field_Mutation_core_deleteManagedResource_args(ctx c return args, nil } +func (ec *executionContext) field_Mutation_core_deleteRegistryImage_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["image"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["image"] = arg0 + return args, nil +} + func (ec *executionContext) field_Mutation_core_deleteRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -8214,55 +8629,94 @@ func (ec *executionContext) field_Query_core_getManagedResource_args(ctx context return args, nil } -func (ec *executionContext) field_Query_core_getRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_getRegistryImageURL_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["image"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg0 - var arg1 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalNString2string(ctx, tmp) + args["image"] = arg0 + var arg1 map[string]interface{} + if tmp, ok := rawArgs["meta"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("meta")) + arg1, err = ec.unmarshalNMap2map(ctx, tmp) if err != nil { return nil, err } } - args["name"] = arg1 + args["meta"] = arg1 return args, nil } -func (ec *executionContext) field_Query_core_getSecretValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_getRegistryImage_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string - if tmp, ok := rawArgs["envName"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + if tmp, ok := rawArgs["image"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["envName"] = arg0 - var arg1 []*domain.SecretKeyRef - if tmp, ok := rawArgs["queries"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) - arg1, err = ec.unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx, tmp) - if err != nil { - return nil, err - } - } - args["queries"] = arg1 + args["image"] = arg0 return args, nil } -func (ec *executionContext) field_Query_core_getSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_core_getRouter_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + 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["envName"] = arg0 + var arg1 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg1, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_getSecretValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["envName"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["envName"] = arg0 + var arg1 []*domain.SecretKeyRef + if tmp, ok := rawArgs["queries"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("queries")) + arg1, err = ec.unmarshalOSecretKeyRefIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐSecretKeyRefᚄ(ctx, tmp) + if err != nil { + return nil, err + } + } + args["queries"] = arg1 + return args, nil +} + +func (ec *executionContext) field_Query_core_getSecret_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string @@ -8490,6 +8944,21 @@ func (ec *executionContext) field_Query_core_listManagedResources_args(ctx conte return args, nil } +func (ec *executionContext) field_Query_core_listRegistryImages_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *repos.CursorPagination + if tmp, ok := rawArgs["pq"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pq")) + arg0, err = ec.unmarshalOCursorPaginationIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐCursorPagination(ctx, tmp) + if err != nil { + return nil, err + } + } + args["pq"] = arg0 + 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{}{} @@ -28380,6 +28849,87 @@ func (ec *executionContext) fieldContext_Mutation_core_deleteImagePullSecret(ctx return fc, nil } +func (ec *executionContext) _Mutation_core_deleteRegistryImage(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_core_deleteRegistryImage(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().CoreDeleteRegistryImage(rctx, fc.Args["image"].(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_deleteRegistryImage(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_deleteRegistryImage_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Mutation_core_createApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_core_createApp(ctx, field) if err != nil { @@ -32026,8 +32576,8 @@ func (ec *executionContext) fieldContext_Query_core_resyncImagePullSecret(ctx co return fc, nil } -func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listApps(ctx, field) +func (ec *executionContext) _Query_core_getRegistryImageURL(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getRegistryImageURL(ctx, field) if err != nil { return graphql.Null } @@ -32041,7 +32591,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["envName"].(string), fc.Args["search"].(*model.SearchApps), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreGetRegistryImageURL(rctx, fc.Args["image"].(string), fc.Args["meta"].(map[string]interface{})) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32063,110 +32613,27 @@ func (ec *executionContext) _Query_core_listApps(ctx context.Context, field grap if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.AppPaginatedRecords); ok { + if data, ok := tmp.(*model.RegistryImageURL); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.AppPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.RegistryImageURL`, tmp) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.AppPaginatedRecords) - fc.Result = res - return ec.marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "edges": - return ec.fieldContext_AppPaginatedRecords_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) - case "totalCount": - return ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AppPaginatedRecords", field.Name) - }, - } - 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_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getApp(ctx, field) - 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().CoreGetApp(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) - } - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.IsLoggedInAndVerified == nil { - return nil, errors.New("directive isLoggedInAndVerified is not implemented") - } - return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) - } - directive2 := func(ctx context.Context) (interface{}, error) { - if ec.directives.HasAccount == nil { - return nil, errors.New("directive hasAccount is not implemented") - } - return ec.directives.HasAccount(ctx, nil, directive1) - } - - tmp, err := directive2(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*entities.App); 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.App`, tmp) - }) - if err != nil { - ec.Error(ctx, err) return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*entities.App) + res := resTmp.(*model.RegistryImageURL) fc.Result = res - return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) + return ec.marshalNRegistryImageURL2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageURL(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getRegistryImageURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32174,48 +32641,12 @@ func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "accountName": - return ec.fieldContext_App_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_App_apiVersion(ctx, field) - case "ciBuildId": - return ec.fieldContext_App_ciBuildId(ctx, field) - case "createdBy": - return ec.fieldContext_App_createdBy(ctx, field) - case "creationTime": - return ec.fieldContext_App_creationTime(ctx, field) - case "displayName": - return ec.fieldContext_App_displayName(ctx, field) - case "enabled": - return ec.fieldContext_App_enabled(ctx, field) - case "environmentName": - return ec.fieldContext_App_environmentName(ctx, field) - case "id": - return ec.fieldContext_App_id(ctx, field) - case "kind": - return ec.fieldContext_App_kind(ctx, field) - case "lastUpdatedBy": - return ec.fieldContext_App_lastUpdatedBy(ctx, field) - case "markedForDeletion": - return ec.fieldContext_App_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_App_metadata(ctx, field) - case "recordVersion": - return ec.fieldContext_App_recordVersion(ctx, field) - case "spec": - return ec.fieldContext_App_spec(ctx, field) - case "status": - return ec.fieldContext_App_status(ctx, field) - case "syncStatus": - return ec.fieldContext_App_syncStatus(ctx, field) - case "updateTime": - return ec.fieldContext_App_updateTime(ctx, field) - case "build": - return ec.fieldContext_App_build(ctx, field) - case "serviceHost": - return ec.fieldContext_App_serviceHost(ctx, field) + case "scriptUrl": + return ec.fieldContext_RegistryImageURL_scriptUrl(ctx, field) + case "url": + return ec.fieldContext_RegistryImageURL_url(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type App", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RegistryImageURL", field.Name) }, } defer func() { @@ -32225,15 +32656,15 @@ func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getRegistryImageURL_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) +func (ec *executionContext) _Query_core_getRegistryImage(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getRegistryImage(ctx, field) if err != nil { return graphql.Null } @@ -32247,7 +32678,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["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetRegistryImage(rctx, fc.Args["image"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32269,34 +32700,51 @@ func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field gra if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*entities.RegistryImage); 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.RegistryImage`, 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.RegistryImage) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalORegistryImage2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRegistryImage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getRegistryImage(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_RegistryImage_accountName(ctx, field) + case "creationTime": + return ec.fieldContext_RegistryImage_creationTime(ctx, field) + case "id": + return ec.fieldContext_RegistryImage_id(ctx, field) + case "imageName": + return ec.fieldContext_RegistryImage_imageName(ctx, field) + case "imageTag": + return ec.fieldContext_RegistryImage_imageTag(ctx, field) + case "markedForDeletion": + return ec.fieldContext_RegistryImage_markedForDeletion(ctx, field) + case "meta": + return ec.fieldContext_RegistryImage_meta(ctx, field) + case "recordVersion": + return ec.fieldContext_RegistryImage_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_RegistryImage_updateTime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RegistryImage", field.Name) }, } defer func() { @@ -32306,15 +32754,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncApp(ctx context.Contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getRegistryImage_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_restartApp(ctx, field) +func (ec *executionContext) _Query_core_listRegistryImages(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listRegistryImages(ctx, field) if err != nil { return graphql.Null } @@ -32328,7 +32776,7 @@ func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field gr resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreRestartApp(rctx, fc.Args["envName"].(string), fc.Args["appName"].(string)) + return ec.resolvers.Query().CoreListRegistryImages(rctx, fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32350,34 +32798,39 @@ func (ec *executionContext) _Query_core_restartApp(ctx context.Context, field gr if tmp == nil { return nil, nil } - if data, ok := tmp.(bool); ok { + if data, ok := tmp.(*model.RegistryImagePaginatedRecords); 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/app/graph/model.RegistryImagePaginatedRecords`, 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.(*model.RegistryImagePaginatedRecords) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalORegistryImagePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImagePaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_restartApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listRegistryImages(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 "edges": + return ec.fieldContext_RegistryImagePaginatedRecords_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_RegistryImagePaginatedRecords_pageInfo(ctx, field) + case "totalCount": + return ec.fieldContext_RegistryImagePaginatedRecords_totalCount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RegistryImagePaginatedRecords", field.Name) }, } defer func() { @@ -32387,15 +32840,15 @@ func (ec *executionContext) fieldContext_Query_core_restartApp(ctx context.Conte } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_restartApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listRegistryImages_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listExternalApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listExternalApps(ctx, field) +func (ec *executionContext) _Query_core_listApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listApps(ctx, field) if err != nil { return graphql.Null } @@ -32409,7 +32862,7 @@ func (ec *executionContext) _Query_core_listExternalApps(ctx context.Context, fi resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListExternalApps(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchExternalApps), 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 { @@ -32431,10 +32884,10 @@ func (ec *executionContext) _Query_core_listExternalApps(ctx context.Context, fi if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.ExternalAppPaginatedRecords); ok { + if data, ok := tmp.(*model.AppPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ExternalAppPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.AppPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32443,12 +32896,12 @@ func (ec *executionContext) _Query_core_listExternalApps(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ExternalAppPaginatedRecords) + res := resTmp.(*model.AppPaginatedRecords) fc.Result = res - return ec.marshalOExternalAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐExternalAppPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐAppPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listExternalApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32457,13 +32910,13 @@ func (ec *executionContext) fieldContext_Query_core_listExternalApps(ctx context Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_ExternalAppPaginatedRecords_edges(ctx, field) + return ec.fieldContext_AppPaginatedRecords_edges(ctx, field) case "pageInfo": - return ec.fieldContext_ExternalAppPaginatedRecords_pageInfo(ctx, field) + return ec.fieldContext_AppPaginatedRecords_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_ExternalAppPaginatedRecords_totalCount(ctx, field) + return ec.fieldContext_AppPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExternalAppPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type AppPaginatedRecords", field.Name) }, } defer func() { @@ -32473,15 +32926,15 @@ func (ec *executionContext) fieldContext_Query_core_listExternalApps(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listExternalApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getExternalApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getExternalApp(ctx, field) +func (ec *executionContext) _Query_core_getApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getApp(ctx, field) if err != nil { return graphql.Null } @@ -32495,7 +32948,7 @@ func (ec *executionContext) _Query_core_getExternalApp(ctx context.Context, fiel resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetExternalApp(rctx, 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 { @@ -32517,10 +32970,10 @@ func (ec *executionContext) _Query_core_getExternalApp(ctx context.Context, fiel if tmp == nil { return nil, nil } - if data, ok := tmp.(*entities.ExternalApp); ok { + if data, ok := tmp.(*entities.App); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ExternalApp`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.App`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32529,12 +32982,12 @@ func (ec *executionContext) _Query_core_getExternalApp(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.ExternalApp) + res := resTmp.(*entities.App) fc.Result = res - return ec.marshalOExternalApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐExternalApp(ctx, field.Selections, res) + return ec.marshalOApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐApp(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getExternalApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_getApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32543,39 +32996,47 @@ func (ec *executionContext) fieldContext_Query_core_getExternalApp(ctx context.C Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_ExternalApp_accountName(ctx, field) + return ec.fieldContext_App_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_ExternalApp_apiVersion(ctx, field) + return ec.fieldContext_App_apiVersion(ctx, field) + case "ciBuildId": + return ec.fieldContext_App_ciBuildId(ctx, field) case "createdBy": - return ec.fieldContext_ExternalApp_createdBy(ctx, field) + return ec.fieldContext_App_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_ExternalApp_creationTime(ctx, field) + return ec.fieldContext_App_creationTime(ctx, field) case "displayName": - return ec.fieldContext_ExternalApp_displayName(ctx, field) + return ec.fieldContext_App_displayName(ctx, field) + case "enabled": + return ec.fieldContext_App_enabled(ctx, field) case "environmentName": - return ec.fieldContext_ExternalApp_environmentName(ctx, field) + return ec.fieldContext_App_environmentName(ctx, field) case "id": - return ec.fieldContext_ExternalApp_id(ctx, field) + return ec.fieldContext_App_id(ctx, field) case "kind": - return ec.fieldContext_ExternalApp_kind(ctx, field) + return ec.fieldContext_App_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_ExternalApp_lastUpdatedBy(ctx, field) + return ec.fieldContext_App_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_ExternalApp_markedForDeletion(ctx, field) + return ec.fieldContext_App_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_ExternalApp_metadata(ctx, field) + return ec.fieldContext_App_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_ExternalApp_recordVersion(ctx, field) + return ec.fieldContext_App_recordVersion(ctx, field) case "spec": - return ec.fieldContext_ExternalApp_spec(ctx, field) + return ec.fieldContext_App_spec(ctx, field) case "status": - return ec.fieldContext_ExternalApp_status(ctx, field) + return ec.fieldContext_App_status(ctx, field) case "syncStatus": - return ec.fieldContext_ExternalApp_syncStatus(ctx, field) + return ec.fieldContext_App_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_ExternalApp_updateTime(ctx, field) + return ec.fieldContext_App_updateTime(ctx, field) + case "build": + return ec.fieldContext_App_build(ctx, field) + case "serviceHost": + return ec.fieldContext_App_serviceHost(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ExternalApp", field.Name) + return nil, fmt.Errorf("no field named %q was found under type App", field.Name) }, } defer func() { @@ -32585,15 +33046,15 @@ func (ec *executionContext) fieldContext_Query_core_getExternalApp(ctx context.C } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getExternalApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_getApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_resyncExternalApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_resyncExternalApp(ctx, field) +func (ec *executionContext) _Query_core_resyncApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncApp(ctx, field) if err != nil { return graphql.Null } @@ -32607,7 +33068,7 @@ func (ec *executionContext) _Query_core_resyncExternalApp(ctx context.Context, f resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreResyncExternalApp(rctx, 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 { @@ -32649,7 +33110,7 @@ func (ec *executionContext) _Query_core_resyncExternalApp(ctx context.Context, f return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_resyncExternalApp(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, @@ -32666,15 +33127,15 @@ func (ec *executionContext) fieldContext_Query_core_resyncExternalApp(ctx contex } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_resyncExternalApp_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_getConfigValues(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getConfigValues(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 } @@ -32688,7 +33149,7 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfigValues(rctx, fc.Args["envName"].(string), fc.Args["queries"].([]*domain.ConfigKeyRef)) + 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 { @@ -32710,39 +33171,34 @@ func (ec *executionContext) _Query_core_getConfigValues(ctx context.Context, fie if tmp == nil { return nil, nil } - if data, ok := tmp.([]*domain.ConfigKeyValueRef); ok { + if data, ok := tmp.(bool); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*github.com/kloudlite/api/apps/console/internal/domain.ConfigKeyValueRef`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be 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.([]*domain.ConfigKeyValueRef) + res := resTmp.(bool) fc.Result = res - return ec.marshalOConfigKeyValueRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋdomainᚐConfigKeyValueRefᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_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) { - 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) + return nil, errors.New("field of type Boolean does not have child fields") }, } defer func() { @@ -32752,15 +33208,15 @@ func (ec *executionContext) fieldContext_Query_core_getConfigValues(ctx context. } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_getConfigValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_restartApp_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_listConfigs(ctx, field) +func (ec *executionContext) _Query_core_listExternalApps(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_listExternalApps(ctx, field) if err != nil { return graphql.Null } @@ -32774,7 +33230,7 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreListConfigs(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchConfigs), fc.Args["pq"].(*repos.CursorPagination)) + return ec.resolvers.Query().CoreListExternalApps(rctx, fc.Args["envName"].(string), fc.Args["search"].(*model.SearchExternalApps), fc.Args["pq"].(*repos.CursorPagination)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32796,10 +33252,10 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g if tmp == nil { return nil, nil } - if data, ok := tmp.(*model.ConfigPaginatedRecords); ok { + if data, ok := tmp.(*model.ExternalAppPaginatedRecords); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ConfigPaginatedRecords`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/app/graph/model.ExternalAppPaginatedRecords`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32808,12 +33264,12 @@ func (ec *executionContext) _Query_core_listConfigs(ctx context.Context, field g if resTmp == nil { return graphql.Null } - res := resTmp.(*model.ConfigPaginatedRecords) + res := resTmp.(*model.ExternalAppPaginatedRecords) fc.Result = res - return ec.marshalOConfigPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐConfigPaginatedRecords(ctx, field.Selections, res) + return ec.marshalOExternalAppPaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐExternalAppPaginatedRecords(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_core_listExternalApps(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32822,13 +33278,13 @@ func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Cont Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_ConfigPaginatedRecords_edges(ctx, field) + return ec.fieldContext_ExternalAppPaginatedRecords_edges(ctx, field) case "pageInfo": - return ec.fieldContext_ConfigPaginatedRecords_pageInfo(ctx, field) + return ec.fieldContext_ExternalAppPaginatedRecords_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_ConfigPaginatedRecords_totalCount(ctx, field) + return ec.fieldContext_ExternalAppPaginatedRecords_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type ConfigPaginatedRecords", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExternalAppPaginatedRecords", field.Name) }, } defer func() { @@ -32838,15 +33294,15 @@ func (ec *executionContext) fieldContext_Query_core_listConfigs(ctx context.Cont } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_core_listConfigs_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_core_listExternalApps_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_core_getConfig(ctx, field) +func (ec *executionContext) _Query_core_getExternalApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_getExternalApp(ctx, field) if err != nil { return graphql.Null } @@ -32860,7 +33316,7 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { directive0 := func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CoreGetConfig(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreGetExternalApp(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -32882,10 +33338,10 @@ 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.(*entities.ExternalApp); ok { return data, nil } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.Config`, tmp) + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/kloudlite/api/apps/console/internal/entities.ExternalApp`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -32894,12 +33350,12 @@ func (ec *executionContext) _Query_core_getConfig(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*entities.Config) + res := resTmp.(*entities.ExternalApp) fc.Result = res - return ec.marshalOConfig2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐConfig(ctx, field.Selections, res) + return ec.marshalOExternalApp2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐExternalApp(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_getExternalApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -32908,41 +33364,39 @@ func (ec *executionContext) fieldContext_Query_core_getConfig(ctx context.Contex Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "accountName": - return ec.fieldContext_Config_accountName(ctx, field) + return ec.fieldContext_ExternalApp_accountName(ctx, field) case "apiVersion": - return ec.fieldContext_Config_apiVersion(ctx, field) - case "binaryData": - return ec.fieldContext_Config_binaryData(ctx, field) + return ec.fieldContext_ExternalApp_apiVersion(ctx, field) case "createdBy": - return ec.fieldContext_Config_createdBy(ctx, field) + return ec.fieldContext_ExternalApp_createdBy(ctx, field) case "creationTime": - return ec.fieldContext_Config_creationTime(ctx, field) - case "data": - return ec.fieldContext_Config_data(ctx, field) + return ec.fieldContext_ExternalApp_creationTime(ctx, field) case "displayName": - return ec.fieldContext_Config_displayName(ctx, field) + return ec.fieldContext_ExternalApp_displayName(ctx, field) case "environmentName": - return ec.fieldContext_Config_environmentName(ctx, field) + return ec.fieldContext_ExternalApp_environmentName(ctx, field) case "id": - return ec.fieldContext_Config_id(ctx, field) - case "immutable": - return ec.fieldContext_Config_immutable(ctx, field) + return ec.fieldContext_ExternalApp_id(ctx, field) case "kind": - return ec.fieldContext_Config_kind(ctx, field) + return ec.fieldContext_ExternalApp_kind(ctx, field) case "lastUpdatedBy": - return ec.fieldContext_Config_lastUpdatedBy(ctx, field) + return ec.fieldContext_ExternalApp_lastUpdatedBy(ctx, field) case "markedForDeletion": - return ec.fieldContext_Config_markedForDeletion(ctx, field) + return ec.fieldContext_ExternalApp_markedForDeletion(ctx, field) case "metadata": - return ec.fieldContext_Config_metadata(ctx, field) + return ec.fieldContext_ExternalApp_metadata(ctx, field) case "recordVersion": - return ec.fieldContext_Config_recordVersion(ctx, field) + return ec.fieldContext_ExternalApp_recordVersion(ctx, field) + case "spec": + return ec.fieldContext_ExternalApp_spec(ctx, field) + case "status": + return ec.fieldContext_ExternalApp_status(ctx, field) case "syncStatus": - return ec.fieldContext_Config_syncStatus(ctx, field) + return ec.fieldContext_ExternalApp_syncStatus(ctx, field) case "updateTime": - return ec.fieldContext_Config_updateTime(ctx, field) + return ec.fieldContext_ExternalApp_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Config", field.Name) + return nil, fmt.Errorf("no field named %q was found under type ExternalApp", field.Name) }, } defer func() { @@ -32952,15 +33406,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_getExternalApp_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_resyncExternalApp(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_core_resyncExternalApp(ctx, field) if err != nil { return graphql.Null } @@ -32974,7 +33428,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["envName"].(string), fc.Args["name"].(string)) + return ec.resolvers.Query().CoreResyncExternalApp(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -33016,7 +33470,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_resyncExternalApp(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, @@ -33033,15 +33487,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_resyncExternalApp_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 } @@ -33055,7 +33509,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["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 { @@ -33077,10 +33531,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) @@ -33089,12 +33543,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, @@ -33102,14 +33556,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() { @@ -33119,15 +33573,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 } @@ -33141,7 +33595,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["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 { @@ -33163,10 +33617,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) @@ -33175,12 +33629,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, @@ -33189,13 +33643,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() { @@ -33205,15 +33659,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 } @@ -33227,7 +33681,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["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 { @@ -33249,10 +33703,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) @@ -33261,12 +33715,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, @@ -33275,47 +33729,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) - case "for": - return ec.fieldContext_Secret_for(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) + 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() { @@ -33325,15 +33773,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 } @@ -33347,7 +33795,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["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 { @@ -33389,7 +33837,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, @@ -33406,15 +33854,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 } @@ -33428,7 +33876,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["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 { @@ -33450,10 +33898,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) @@ -33462,12 +33910,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, @@ -33475,14 +33923,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() { @@ -33492,15 +33940,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 } @@ -33514,7 +33962,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["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 { @@ -33536,10 +33984,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) @@ -33548,12 +33996,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, @@ -33561,42 +34009,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 "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() { @@ -33606,15 +34026,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 } @@ -33628,7 +34048,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["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 { @@ -33650,34 +34070,73 @@ 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 "for": + return ec.fieldContext_Secret_for(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() { @@ -33687,15 +34146,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 } @@ -33709,7 +34168,369 @@ 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["msvcName"].(*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 { + 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_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 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_resyncSecret_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) + 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().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 { + 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.RouterPaginatedRecords); 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) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.RouterPaginatedRecords) + fc.Result = 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_listRouters(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_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 RouterPaginatedRecords", 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_listRouters_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) + 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().CoreGetRouter(rctx, fc.Args["envName"].(string), fc.Args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.IsLoggedInAndVerified == nil { + return nil, errors.New("directive isLoggedInAndVerified is not implemented") + } + return ec.directives.IsLoggedInAndVerified(ctx, nil, directive0) + } + directive2 := func(ctx context.Context) (interface{}, error) { + if ec.directives.HasAccount == nil { + return nil, errors.New("directive hasAccount is not implemented") + } + return ec.directives.HasAccount(ctx, nil, directive1) + } + + tmp, err := directive2(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*entities.Router); 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) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*entities.Router) + fc.Result = res + return ec.marshalORouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +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, + IsMethod: true, + 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 "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 Router", 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_getRouter_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) + 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().CoreResyncRouter(rctx, 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_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) { + 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_resyncRouter_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) + 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().CoreGetManagedResouceOutputKeys(rctx, fc.Args["msvcName"].(*string), fc.Args["envName"].(*string), fc.Args["name"].(string)) } directive1 := func(ctx context.Context) (interface{}, error) { if ec.directives.IsLoggedInAndVerified == nil { @@ -34673,8 +35494,8 @@ func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field return fc, nil } -func (ec *executionContext) _Router_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_accountName(ctx, field) +func (ec *executionContext) _RegistryImage_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_accountName(ctx, field) if err != nil { return graphql.Null } @@ -34704,9 +35525,9 @@ func (ec *executionContext) _Router_accountName(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", Field: field, IsMethod: false, IsResolver: false, @@ -34717,8 +35538,8 @@ func (ec *executionContext) fieldContext_Router_accountName(_ context.Context, f return fc, nil } -func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_apiVersion(ctx, field) +func (ec *executionContext) _RegistryImage_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -34731,35 +35552,38 @@ func (ec *executionContext) _Router_apiVersion(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.APIVersion, nil + return ec.resolvers.RegistryImage().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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_apiVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", 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") + return nil, errors.New("field of type Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_createdBy(ctx, field) +func (ec *executionContext) _RegistryImage_id(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_id(ctx, field) if err != nil { return graphql.Null } @@ -34772,7 +35596,7 @@ func (ec *executionContext) _Router_createdBy(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedBy, nil + return obj.Id, nil }) if err != nil { ec.Error(ctx, err) @@ -34784,34 +35608,26 @@ func (ec *executionContext) _Router_createdBy(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(repos.ID) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_creationTime(ctx, field) +func (ec *executionContext) _RegistryImage_imageName(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_imageName(ctx, field) if err != nil { return graphql.Null } @@ -34824,7 +35640,7 @@ func (ec *executionContext) _Router_creationTime(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 ec.resolvers.Router().CreationTime(rctx, obj) + return obj.ImageName, nil }) if err != nil { ec.Error(ctx, err) @@ -34838,24 +35654,24 @@ func (ec *executionContext) _Router_creationTime(ctx context.Context, field grap } res := resTmp.(string) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_imageName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_displayName(ctx, field) +func (ec *executionContext) _RegistryImage_imageTag(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_imageTag(ctx, field) if err != nil { return graphql.Null } @@ -34868,7 +35684,7 @@ func (ec *executionContext) _Router_displayName(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.DisplayName, nil + return obj.ImageTag, nil }) if err != nil { ec.Error(ctx, err) @@ -34885,9 +35701,9 @@ func (ec *executionContext) _Router_displayName(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_imageTag(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", Field: field, IsMethod: false, IsResolver: false, @@ -34898,8 +35714,8 @@ func (ec *executionContext) fieldContext_Router_displayName(_ context.Context, f return fc, nil } -func (ec *executionContext) _Router_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_enabled(ctx, field) +func (ec *executionContext) _RegistryImage_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -34912,7 +35728,7 @@ func (ec *executionContext) _Router_enabled(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Enabled, nil + return obj.MarkedForDeletion, nil }) if err != nil { ec.Error(ctx, err) @@ -34921,14 +35737,14 @@ func (ec *executionContext) _Router_enabled(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(bool) + res := resTmp.(*bool) fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_markedForDeletion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", Field: field, IsMethod: false, IsResolver: false, @@ -34939,8 +35755,8 @@ func (ec *executionContext) fieldContext_Router_enabled(_ context.Context, field return fc, nil } -func (ec *executionContext) _Router_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_environmentName(ctx, field) +func (ec *executionContext) _RegistryImage_meta(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_meta(ctx, field) if err != nil { return graphql.Null } @@ -34953,7 +35769,7 @@ func (ec *executionContext) _Router_environmentName(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil + return obj.Meta, nil }) if err != nil { ec.Error(ctx, err) @@ -34965,26 +35781,26 @@ func (ec *executionContext) _Router_environmentName(ctx context.Context, field g } return graphql.Null } - res := resTmp.(string) + res := resTmp.(map[string]any) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNMap2map(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_environmentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_meta(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", 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 nil, errors.New("field of type Map does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_id(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_id(ctx, field) +func (ec *executionContext) _RegistryImage_recordVersion(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -34997,7 +35813,7 @@ func (ec *executionContext) _Router_id(ctx context.Context, field graphql.Collec }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Id, nil + return obj.RecordVersion, nil }) if err != nil { ec.Error(ctx, err) @@ -35009,26 +35825,26 @@ func (ec *executionContext) _Router_id(ctx context.Context, field graphql.Collec } return graphql.Null } - res := resTmp.(repos.ID) + res := resTmp.(int) fc.Result = res - return ec.marshalNID2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐID(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_recordVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", 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 nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Router_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_kind(ctx, field) +func (ec *executionContext) _RegistryImage_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.RegistryImage) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImage_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -35041,23 +35857,70 @@ func (ec *executionContext) _Router_kind(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind, nil + return ec.resolvers.RegistryImage().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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImage_updateTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImage", + 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) _RegistryImageCredentials_accountName(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_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_RegistryImageCredentials_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RegistryImageCredentials", Field: field, IsMethod: false, IsResolver: false, @@ -35068,8 +35931,8 @@ func (ec *executionContext) fieldContext_Router_kind(_ context.Context, field gr return fc, nil } -func (ec *executionContext) _Router_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_lastUpdatedBy(ctx, field) +func (ec *executionContext) _RegistryImageCredentials_createdBy(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -35082,7 +35945,7 @@ func (ec *executionContext) _Router_lastUpdatedBy(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 obj.LastUpdatedBy, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -35094,14 +35957,14 @@ func (ec *executionContext) _Router_lastUpdatedBy(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(*common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_lastUpdatedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentials_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentials", Field: field, IsMethod: false, IsResolver: false, @@ -35120,8 +35983,96 @@ func (ec *executionContext) fieldContext_Router_lastUpdatedBy(_ context.Context, return fc, nil } -func (ec *executionContext) _Router_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_markedForDeletion(ctx, field) +func (ec *executionContext) _RegistryImageCredentials_creationTime(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_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 obj.CreationTime, 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.marshalNDate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RegistryImageCredentials_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RegistryImageCredentials", + Field: field, + IsMethod: false, + IsResolver: false, + 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) _RegistryImageCredentials_id(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_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_RegistryImageCredentials_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RegistryImageCredentials", + 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) _RegistryImageCredentials_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_markedForDeletion(ctx, field) if err != nil { return graphql.Null } @@ -35148,9 +36099,9 @@ func (ec *executionContext) _Router_markedForDeletion(ctx context.Context, field return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_markedForDeletion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentials_markedForDeletion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentials", Field: field, IsMethod: false, IsResolver: false, @@ -35161,8 +36112,8 @@ func (ec *executionContext) fieldContext_Router_markedForDeletion(_ context.Cont return fc, nil } -func (ec *executionContext) _Router_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_metadata(ctx, field) +func (ec *executionContext) _RegistryImageCredentials_password(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_password(ctx, field) if err != nil { return graphql.Null } @@ -35175,51 +36126,38 @@ func (ec *executionContext) _Router_metadata(ctx context.Context, field graphql. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ObjectMeta, nil + return obj.Password, 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.(v12.ObjectMeta) + res := resTmp.(string) fc.Result = res - return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentials_password(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentials", 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 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) +func (ec *executionContext) _RegistryImageCredentials_recordVersion(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_recordVersion(ctx, field) if err != nil { return graphql.Null } @@ -35249,9 +36187,9 @@ func (ec *executionContext) _Router_recordVersion(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_recordVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentials_recordVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentials", Field: field, IsMethod: false, IsResolver: false, @@ -35262,8 +36200,8 @@ func (ec *executionContext) fieldContext_Router_recordVersion(_ context.Context, return fc, nil } -func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_spec(ctx, field) +func (ec *executionContext) _RegistryImageCredentials_updateTime(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentials) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentials_updateTime(ctx, field) if err != nil { return graphql.Null } @@ -35276,7 +36214,7 @@ func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Router().Spec(rctx, obj) + return obj.UpdateTime, nil }) if err != nil { ec.Error(ctx, err) @@ -35288,46 +36226,132 @@ func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(*model.GithubComKloudliteOperatorApisCrdsV1RouterSpec) + res := resTmp.(string) fc.Result = res - return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpec(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_spec(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentials_updateTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentials", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _RegistryImageCredentialsEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentialsEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentialsEdge_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_RegistryImageCredentialsEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RegistryImageCredentialsEdge", + 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) _RegistryImageCredentialsEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentialsEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentialsEdge_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.(*model.RegistryImageCredentials) + fc.Result = res + return ec.marshalNRegistryImageCredentials2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentials(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RegistryImageCredentialsEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RegistryImageCredentialsEdge", + Field: field, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "backendProtocol": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx, field) - case "basicAuth": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx, field) - case "cors": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx, field) - case "domains": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx, field) - case "https": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx, field) - case "ingressClass": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx, field) - case "maxBodySizeInMB": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx, field) - case "rateLimit": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx, field) - case "routes": - return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx, field) + case "accountName": + return ec.fieldContext_RegistryImageCredentials_accountName(ctx, field) + case "createdBy": + return ec.fieldContext_RegistryImageCredentials_createdBy(ctx, field) + case "creationTime": + return ec.fieldContext_RegistryImageCredentials_creationTime(ctx, field) + case "id": + return ec.fieldContext_RegistryImageCredentials_id(ctx, field) + case "markedForDeletion": + return ec.fieldContext_RegistryImageCredentials_markedForDeletion(ctx, field) + case "password": + return ec.fieldContext_RegistryImageCredentials_password(ctx, field) + case "recordVersion": + return ec.fieldContext_RegistryImageCredentials_recordVersion(ctx, field) + case "updateTime": + return ec.fieldContext_RegistryImageCredentials_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RegistryImageCredentials", field.Name) }, } return fc, nil } -func (ec *executionContext) _Router_status(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_status(ctx, field) +func (ec *executionContext) _RegistryImageCredentialsPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentialsPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentialsPaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -35340,51 +36364,44 @@ func (ec *executionContext) _Router_status(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + 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.(operator.Status) + res := resTmp.([]*model.RegistryImageCredentialsEdge) fc.Result = res - return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx, field.Selections, res) + return ec.marshalNRegistryImageCredentialsEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentialsEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentialsPaginatedRecords_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentialsPaginatedRecords", 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) + case "cursor": + return ec.fieldContext_RegistryImageCredentialsEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_RegistryImageCredentialsEdge_node(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__Status", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RegistryImageCredentialsEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _Router_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_syncStatus(ctx, field) +func (ec *executionContext) _RegistryImageCredentialsPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentialsPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentialsPaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -35397,7 +36414,7 @@ func (ec *executionContext) _Router_syncStatus(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.SyncStatus, nil + return obj.PageInfo, nil }) if err != nil { ec.Error(ctx, err) @@ -35409,40 +36426,36 @@ func (ec *executionContext) _Router_syncStatus(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(types.SyncStatus) + res := resTmp.(*model.PageInfo) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___pkg___types__SyncStatus2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋtypesᚐSyncStatus(ctx, field.Selections, res) + return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_syncStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentialsPaginatedRecords_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentialsPaginatedRecords", 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) + case "endCursor": + return ec.fieldContext_PageInfo_endCursor(ctx, field) + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPrevPage": + return ec.fieldContext_PageInfo_hasPrevPage(ctx, field) + case "startCursor": + return ec.fieldContext_PageInfo_startCursor(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___pkg___types__SyncStatus", field.Name) + return nil, fmt.Errorf("no field named %q was found under type PageInfo", field.Name) }, } return fc, nil } -func (ec *executionContext) _Router_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Router_updateTime(ctx, field) +func (ec *executionContext) _RegistryImageCredentialsPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageCredentialsPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageCredentialsPaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -35455,7 +36468,7 @@ func (ec *executionContext) _Router_updateTime(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 ec.resolvers.Router().UpdateTime(rctx, obj) + return obj.TotalCount, nil }) if err != nil { ec.Error(ctx, err) @@ -35467,26 +36480,26 @@ func (ec *executionContext) _Router_updateTime(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Router_updateTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageCredentialsPaginatedRecords_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Router", + Object: "RegistryImageCredentialsPaginatedRecords", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _RouterEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterEdge_cursor(ctx, field) +func (ec *executionContext) _RegistryImageEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageEdge_cursor(ctx, field) if err != nil { return graphql.Null } @@ -35516,9 +36529,9 @@ func (ec *executionContext) _RouterEdge_cursor(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterEdge", + Object: "RegistryImageEdge", Field: field, IsMethod: false, IsResolver: false, @@ -35529,8 +36542,8 @@ func (ec *executionContext) fieldContext_RouterEdge_cursor(_ context.Context, fi return fc, nil } -func (ec *executionContext) _RouterEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterEdge_node(ctx, field) +func (ec *executionContext) _RegistryImageEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageEdge_node(ctx, field) if err != nil { return graphql.Null } @@ -35555,62 +36568,46 @@ func (ec *executionContext) _RouterEdge_node(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.(*entities.Router) + res := resTmp.(*entities.RegistryImage) fc.Result = res - return ec.marshalNRouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) + return ec.marshalNRegistryImage2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRegistryImage(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterEdge", + Object: "RegistryImageEdge", 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_Router_accountName(ctx, field) - case "apiVersion": - return ec.fieldContext_Router_apiVersion(ctx, field) - case "createdBy": - return ec.fieldContext_Router_createdBy(ctx, field) + return ec.fieldContext_RegistryImage_accountName(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) + return ec.fieldContext_RegistryImage_creationTime(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) + return ec.fieldContext_RegistryImage_id(ctx, field) + case "imageName": + return ec.fieldContext_RegistryImage_imageName(ctx, field) + case "imageTag": + return ec.fieldContext_RegistryImage_imageTag(ctx, field) case "markedForDeletion": - return ec.fieldContext_Router_markedForDeletion(ctx, field) - case "metadata": - return ec.fieldContext_Router_metadata(ctx, field) + return ec.fieldContext_RegistryImage_markedForDeletion(ctx, field) + case "meta": + return ec.fieldContext_RegistryImage_meta(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) + return ec.fieldContext_RegistryImage_recordVersion(ctx, field) case "updateTime": - return ec.fieldContext_Router_updateTime(ctx, field) + return ec.fieldContext_RegistryImage_updateTime(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Router", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RegistryImage", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterPaginatedRecords_edges(ctx, field) +func (ec *executionContext) _RegistryImagePaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImagePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImagePaginatedRecords_edges(ctx, field) if err != nil { return graphql.Null } @@ -35635,32 +36632,32 @@ func (ec *executionContext) _RouterPaginatedRecords_edges(ctx context.Context, f } return graphql.Null } - res := resTmp.([]*model.RouterEdge) + res := resTmp.([]*model.RegistryImageEdge) fc.Result = res - return ec.marshalNRouterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdgeᚄ(ctx, field.Selections, res) + return ec.marshalNRegistryImageEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageEdgeᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterPaginatedRecords_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImagePaginatedRecords_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterPaginatedRecords", + Object: "RegistryImagePaginatedRecords", 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_RouterEdge_cursor(ctx, field) + return ec.fieldContext_RegistryImageEdge_cursor(ctx, field) case "node": - return ec.fieldContext_RouterEdge_node(ctx, field) + return ec.fieldContext_RegistryImageEdge_node(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type RouterEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type RegistryImageEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _RouterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterPaginatedRecords_pageInfo(ctx, field) +func (ec *executionContext) _RegistryImagePaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImagePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImagePaginatedRecords_pageInfo(ctx, field) if err != nil { return graphql.Null } @@ -35690,9 +36687,9 @@ func (ec *executionContext) _RouterPaginatedRecords_pageInfo(ctx context.Context return ec.marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterPaginatedRecords_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImagePaginatedRecords_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterPaginatedRecords", + Object: "RegistryImagePaginatedRecords", Field: field, IsMethod: false, IsResolver: false, @@ -35713,8 +36710,8 @@ func (ec *executionContext) fieldContext_RouterPaginatedRecords_pageInfo(_ conte return fc, nil } -func (ec *executionContext) _RouterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_RouterPaginatedRecords_totalCount(ctx, field) +func (ec *executionContext) _RegistryImagePaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImagePaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImagePaginatedRecords_totalCount(ctx, field) if err != nil { return graphql.Null } @@ -35744,9 +36741,9 @@ func (ec *executionContext) _RouterPaginatedRecords_totalCount(ctx context.Conte return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_RouterPaginatedRecords_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImagePaginatedRecords_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "RouterPaginatedRecords", + Object: "RegistryImagePaginatedRecords", Field: field, IsMethod: false, IsResolver: false, @@ -35757,8 +36754,8 @@ func (ec *executionContext) fieldContext_RouterPaginatedRecords_totalCount(_ con return fc, nil } -func (ec *executionContext) _Secret_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_accountName(ctx, field) +func (ec *executionContext) _RegistryImageURL_scriptUrl(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageURL) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageURL_scriptUrl(ctx, field) if err != nil { return graphql.Null } @@ -35771,7 +36768,7 @@ func (ec *executionContext) _Secret_accountName(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.AccountName, nil + return obj.ScriptURL, nil }) if err != nil { ec.Error(ctx, err) @@ -35788,9 +36785,9 @@ func (ec *executionContext) _Secret_accountName(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageURL_scriptUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "RegistryImageURL", Field: field, IsMethod: false, IsResolver: false, @@ -35801,8 +36798,8 @@ func (ec *executionContext) fieldContext_Secret_accountName(_ context.Context, f return fc, nil } -func (ec *executionContext) _Secret_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_apiVersion(ctx, field) +func (ec *executionContext) _RegistryImageURL_url(ctx context.Context, field graphql.CollectedField, obj *model.RegistryImageURL) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RegistryImageURL_url(ctx, field) if err != nil { return graphql.Null } @@ -35815,23 +36812,26 @@ func (ec *executionContext) _Secret_apiVersion(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.APIVersion, nil + return obj.URL, 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.marshalOString2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_apiVersion(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_RegistryImageURL_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "RegistryImageURL", Field: field, IsMethod: false, IsResolver: false, @@ -35842,8 +36842,8 @@ func (ec *executionContext) fieldContext_Secret_apiVersion(_ context.Context, fi return fc, nil } -func (ec *executionContext) _Secret_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_createdBy(ctx, field) +func (ec *executionContext) _Router_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_accountName(ctx, field) if err != nil { return graphql.Null } @@ -35856,7 +36856,7 @@ func (ec *executionContext) _Secret_createdBy(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedBy, nil + return obj.AccountName, nil }) if err != nil { ec.Error(ctx, err) @@ -35868,34 +36868,26 @@ func (ec *executionContext) _Secret_createdBy(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(common.CreatedOrUpdatedBy) + res := resTmp.(string) fc.Result = res - return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_accountName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Router", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_creationTime(ctx, field) +func (ec *executionContext) _Router_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_apiVersion(ctx, field) if err != nil { return graphql.Null } @@ -35908,7 +36900,48 @@ func (ec *executionContext) _Secret_creationTime(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 ec.resolvers.Secret().CreationTime(rctx, obj) + 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_Router_apiVersion(_ 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_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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) @@ -35920,26 +36953,34 @@ func (ec *executionContext) _Secret_creationTime(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(string) + res := resTmp.(common.CreatedOrUpdatedBy) fc.Result = res - return ec.marshalNDate2string(ctx, field.Selections, res) + return ec.marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2githubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Router", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Date does not have child fields") + 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) _Secret_data(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_data(ctx, field) +func (ec *executionContext) _Router_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_creationTime(ctx, field) if err != nil { return graphql.Null } @@ -35952,35 +36993,38 @@ func (ec *executionContext) _Secret_data(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().Data(rctx, obj) + return ec.resolvers.Router().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.(map[string]interface{}) + res := resTmp.(string) fc.Result = res - return ec.marshalOMap2map(ctx, field.Selections, res) + return ec.marshalNDate2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Router", Field: field, IsMethod: true, IsResolver: true, 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 Date does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_displayName(ctx, field) +func (ec *executionContext) _Router_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_displayName(ctx, field) if err != nil { return graphql.Null } @@ -36010,9 +37054,9 @@ func (ec *executionContext) _Secret_displayName(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_displayName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Router", Field: field, IsMethod: false, IsResolver: false, @@ -36023,8 +37067,8 @@ func (ec *executionContext) fieldContext_Secret_displayName(_ context.Context, f return fc, nil } -func (ec *executionContext) _Secret_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_environmentName(ctx, field) +func (ec *executionContext) _Router_enabled(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_enabled(ctx, field) if err != nil { return graphql.Null } @@ -36037,38 +37081,35 @@ func (ec *executionContext) _Secret_environmentName(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnvironmentName, nil + return obj.Enabled, 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.(bool) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_environmentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_enabled(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + 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 nil, errors.New("field of type Boolean does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_for(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_for(ctx, field) +func (ec *executionContext) _Router_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_environmentName(ctx, field) if err != nil { return graphql.Null } @@ -36081,45 +37122,1173 @@ func (ec *executionContext) _Secret_for(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Secret().For(rctx, obj) + return obj.EnvironmentName, 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.GithubComKloudliteAPIAppsConsoleInternalEntitiesSecretCreatedFor) + res := resTmp.(string) fc.Result = res - return ec.marshalOGithub__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesSecretCreatedFor(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Secret_for(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Router_environmentName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Secret", + Object: "Router", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_name(ctx, field) - case "namespace": - return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_namespace(ctx, field) - case "refId": - return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_refId(ctx, field) - case "resourceType": - return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_resourceType(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Secret_id(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Secret_id(ctx, field) +func (ec *executionContext) _Router_id(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_id(_ 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 ID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_kind(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_kind(_ 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_lastUpdatedBy(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_lastUpdatedBy(_ 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) { + 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) _Router_markedForDeletion(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_markedForDeletion(_ 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 Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_metadata(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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.(v12.ObjectMeta) + fc.Result = res + return ec.marshalOMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_metadata(_ 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) { + 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) _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 { + 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_Router_recordVersion(_ 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 Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_spec(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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.Router().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.GithubComKloudliteOperatorApisCrdsV1RouterSpec) + fc.Result = res + return ec.marshalNGithub__com___kloudlite___operator___apis___crds___v1__RouterSpec2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorApisCrdsV1RouterSpec(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Router_spec(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "backendProtocol": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_backendProtocol(ctx, field) + case "basicAuth": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_basicAuth(ctx, field) + case "cors": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_cors(ctx, field) + case "domains": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_domains(ctx, field) + case "https": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_https(ctx, field) + case "ingressClass": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_ingressClass(ctx, field) + case "maxBodySizeInMB": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_maxBodySizeInMB(ctx, field) + case "rateLimit": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_rateLimit(ctx, field) + case "routes": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__RouterSpec_routes(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___apis___crds___v1__RouterSpec", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Router_status(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_status(_ 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) { + 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) _Router_syncStatus(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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_Router_syncStatus(_ 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) { + 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) _Router_updateTime(ctx context.Context, field graphql.CollectedField, obj *entities.Router) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Router_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.Router().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_Router_updateTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Router", + 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) _RouterEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterEdge_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_RouterEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterEdge", + 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) _RouterEdge_node(ctx context.Context, field graphql.CollectedField, obj *model.RouterEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterEdge_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.Router) + fc.Result = res + return ec.marshalNRouter2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRouter(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterEdge", + 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_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 Router", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterPaginatedRecords_edges(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_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.RouterEdge) + fc.Result = res + return ec.marshalNRouterEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRouterEdgeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_RouterPaginatedRecords_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + 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_RouterEdge_cursor(ctx, field) + case "node": + return ec.fieldContext_RouterEdge_node(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type RouterEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _RouterPaginatedRecords_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_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_RouterPaginatedRecords_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + 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 "hasPrevPage": + return ec.fieldContext_PageInfo_hasPrevPage(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) _RouterPaginatedRecords_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.RouterPaginatedRecords) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_RouterPaginatedRecords_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_RouterPaginatedRecords_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "RouterPaginatedRecords", + 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) _Secret_accountName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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_Secret_accountName(_ 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_apiVersion(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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_Secret_apiVersion(_ 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_createdBy(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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_Secret_createdBy(_ 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) { + 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) _Secret_creationTime(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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.Secret().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_Secret_creationTime(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + 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) _Secret_data(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_data(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.Secret().Data(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(map[string]interface{}) + fc.Result = res + return ec.marshalOMap2map(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_data(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Secret_displayName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_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_Secret_displayName(_ 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_environmentName(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_environmentName(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.EnvironmentName, 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_environmentName(_ 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_for(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_for(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.Secret().For(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteAPIAppsConsoleInternalEntitiesSecretCreatedFor) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteAPIAppsConsoleInternalEntitiesSecretCreatedFor(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Secret_for(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Secret", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_name(ctx, field) + case "namespace": + return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_namespace(ctx, field) + case "refId": + return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_refId(ctx, field) + case "resourceType": + return ec.fieldContext_Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor_resourceType(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___api___apps___console___internal___entities__SecretCreatedFor", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Secret_id(ctx context.Context, field graphql.CollectedField, obj *entities.Secret) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Secret_id(ctx, field) if err != nil { return graphql.Null } @@ -42049,6 +44218,122 @@ func (ec *executionContext) unmarshalInputPortIn(ctx context.Context, obj interf return it, nil } +func (ec *executionContext) unmarshalInputRegistryImageCredentialsIn(ctx context.Context, obj interface{}) (model.RegistryImageCredentialsIn, error) { + var it model.RegistryImageCredentialsIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accountName", "password"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accountName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.AccountName = data + case "password": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("password")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Password = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRegistryImageIn(ctx context.Context, obj interface{}) (entities.RegistryImage, error) { + var it entities.RegistryImage + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"accountName", "imageName", "imageTag", "meta"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "accountName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("accountName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.AccountName = data + case "imageName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imageName")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ImageName = data + case "imageTag": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("imageTag")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ImageTag = data + case "meta": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("meta")) + data, err := ec.unmarshalNMap2map(ctx, v) + if err != nil { + return it, err + } + it.Meta = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRegistryImageURLIn(ctx context.Context, obj interface{}) (model.RegistryImageURLIn, error) { + var it model.RegistryImageURLIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"scriptUrl", "url"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "scriptUrl": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scriptUrl")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.ScriptURL = data + case "url": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("url")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.URL = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputRouterIn(ctx context.Context, obj interface{}) (entities.Router, error) { var it entities.Router asMap := map[string]interface{}{} @@ -42156,206 +44441,350 @@ func (ec *executionContext) unmarshalInputSearchApps(ctx context.Context, obj in return it, nil } -func (ec *executionContext) unmarshalInputSearchClusterManagedService(ctx context.Context, obj interface{}) (model.SearchClusterManagedService, error) { - var it model.SearchClusterManagedService - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"isReady", "text"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchConfigs(ctx context.Context, obj interface{}) (model.SearchConfigs, error) { - var it model.SearchConfigs - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchEnvironments(ctx context.Context, obj interface{}) (model.SearchEnvironments, error) { - var it model.SearchEnvironments - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchExternalApps(ctx context.Context, obj interface{}) (model.SearchExternalApps, error) { - var it model.SearchExternalApps - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchImagePullSecrets(ctx context.Context, obj interface{}) (model.SearchImagePullSecrets, error) { - var it model.SearchImagePullSecrets - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchImportedManagedResources(ctx context.Context, obj interface{}) (model.SearchImportedManagedResources, error) { - var it model.SearchImportedManagedResources +func (ec *executionContext) unmarshalInputSearchClusterManagedService(ctx context.Context, obj interface{}) (model.SearchClusterManagedService, error) { + var it model.SearchClusterManagedService + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"isReady", "text"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchConfigs(ctx context.Context, obj interface{}) (model.SearchConfigs, error) { + var it model.SearchConfigs + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchEnvironments(ctx context.Context, obj interface{}) (model.SearchEnvironments, error) { + var it model.SearchEnvironments + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchExternalApps(ctx context.Context, obj interface{}) (model.SearchExternalApps, error) { + var it model.SearchExternalApps + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchImagePullSecrets(ctx context.Context, obj interface{}) (model.SearchImagePullSecrets, error) { + var it model.SearchImagePullSecrets + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchImportedManagedResources(ctx context.Context, obj interface{}) (model.SearchImportedManagedResources, error) { + var it model.SearchImportedManagedResources + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchManagedResources(ctx context.Context, obj interface{}) (model.SearchManagedResources, error) { + var it model.SearchManagedResources + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "managedServiceName", "envName", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "managedServiceName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.ManagedServiceName = data + case "envName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.EnvName = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchProjectManagedService(ctx context.Context, obj interface{}) (model.SearchProjectManagedService, error) { + var it model.SearchProjectManagedService + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"text", "managedServiceName", "isReady", "markedForDeletion"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "text": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.Text = data + case "managedServiceName": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.ManagedServiceName = data + case "isReady": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.IsReady = data + case "markedForDeletion": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) + data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) + if err != nil { + return it, err + } + it.MarkedForDeletion = data + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputSearchProjects(ctx context.Context, obj interface{}) (model.SearchProjects, error) { + var it model.SearchProjects asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v @@ -42395,14 +44824,14 @@ func (ec *executionContext) unmarshalInputSearchImportedManagedResources(ctx con return it, nil } -func (ec *executionContext) unmarshalInputSearchManagedResources(ctx context.Context, obj interface{}) (model.SearchManagedResources, error) { - var it model.SearchManagedResources +func (ec *executionContext) unmarshalInputSearchRegistryImages(ctx context.Context, obj interface{}) (model.SearchRegistryImages, error) { + var it model.SearchRegistryImages asMap := map[string]interface{}{} for k, v := range obj.(map[string]interface{}) { asMap[k] = v } - fieldsInOrder := [...]string{"text", "managedServiceName", "envName", "isReady", "markedForDeletion"} + fieldsInOrder := [...]string{"text"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -42416,123 +44845,6 @@ func (ec *executionContext) unmarshalInputSearchManagedResources(ctx context.Con return it, err } it.Text = data - case "managedServiceName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.ManagedServiceName = data - case "envName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("envName")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.EnvName = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchProjectManagedService(ctx context.Context, obj interface{}) (model.SearchProjectManagedService, error) { - var it model.SearchProjectManagedService - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "managedServiceName", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "managedServiceName": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("managedServiceName")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.ManagedServiceName = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputSearchProjects(ctx context.Context, obj interface{}) (model.SearchProjects, error) { - var it model.SearchProjects - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"text", "isReady", "markedForDeletion"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "text": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("text")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.Text = data - case "isReady": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isReady")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.IsReady = data - case "markedForDeletion": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("markedForDeletion")) - data, err := ec.unmarshalOMatchFilterIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchFilter(ctx, v) - if err != nil { - return it, err - } - it.MarkedForDeletion = data } } @@ -48455,6 +50767,13 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } + case "core_deleteRegistryImage": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_core_deleteRegistryImage(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) @@ -48859,6 +51178,66 @@ 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_getRegistryImageURL": + 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_getRegistryImageURL(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_getRegistryImage": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_getRegistryImage(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_listRegistryImages": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_core_listRegistryImages(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_listApps": field := field @@ -49456,6 +51835,445 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +var registryImageImplementors = []string{"RegistryImage"} + +func (ec *executionContext) _RegistryImage(ctx context.Context, sel ast.SelectionSet, obj *entities.RegistryImage) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageImplementors) + + 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("RegistryImage") + case "accountName": + out.Values[i] = ec._RegistryImage_accountName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "creationTime": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._RegistryImage_creationTime(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "id": + out.Values[i] = ec._RegistryImage_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "imageName": + out.Values[i] = ec._RegistryImage_imageName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "imageTag": + out.Values[i] = ec._RegistryImage_imageTag(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "markedForDeletion": + out.Values[i] = ec._RegistryImage_markedForDeletion(ctx, field, obj) + case "meta": + out.Values[i] = ec._RegistryImage_meta(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "recordVersion": + out.Values[i] = ec._RegistryImage_recordVersion(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._RegistryImage_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 registryImageCredentialsImplementors = []string{"RegistryImageCredentials"} + +func (ec *executionContext) _RegistryImageCredentials(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImageCredentials) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageCredentialsImplementors) + + 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("RegistryImageCredentials") + case "accountName": + out.Values[i] = ec._RegistryImageCredentials_accountName(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createdBy": + out.Values[i] = ec._RegistryImageCredentials_createdBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "creationTime": + out.Values[i] = ec._RegistryImageCredentials_creationTime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "id": + out.Values[i] = ec._RegistryImageCredentials_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "markedForDeletion": + out.Values[i] = ec._RegistryImageCredentials_markedForDeletion(ctx, field, obj) + case "password": + out.Values[i] = ec._RegistryImageCredentials_password(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "recordVersion": + out.Values[i] = ec._RegistryImageCredentials_recordVersion(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "updateTime": + out.Values[i] = ec._RegistryImageCredentials_updateTime(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 registryImageCredentialsEdgeImplementors = []string{"RegistryImageCredentialsEdge"} + +func (ec *executionContext) _RegistryImageCredentialsEdge(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImageCredentialsEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageCredentialsEdgeImplementors) + + 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("RegistryImageCredentialsEdge") + case "cursor": + out.Values[i] = ec._RegistryImageCredentialsEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "node": + out.Values[i] = ec._RegistryImageCredentialsEdge_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 registryImageCredentialsPaginatedRecordsImplementors = []string{"RegistryImageCredentialsPaginatedRecords"} + +func (ec *executionContext) _RegistryImageCredentialsPaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImageCredentialsPaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageCredentialsPaginatedRecordsImplementors) + + 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("RegistryImageCredentialsPaginatedRecords") + case "edges": + out.Values[i] = ec._RegistryImageCredentialsPaginatedRecords_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + out.Values[i] = ec._RegistryImageCredentialsPaginatedRecords_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._RegistryImageCredentialsPaginatedRecords_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 registryImageEdgeImplementors = []string{"RegistryImageEdge"} + +func (ec *executionContext) _RegistryImageEdge(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImageEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageEdgeImplementors) + + 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("RegistryImageEdge") + case "cursor": + out.Values[i] = ec._RegistryImageEdge_cursor(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "node": + out.Values[i] = ec._RegistryImageEdge_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 registryImagePaginatedRecordsImplementors = []string{"RegistryImagePaginatedRecords"} + +func (ec *executionContext) _RegistryImagePaginatedRecords(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImagePaginatedRecords) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImagePaginatedRecordsImplementors) + + 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("RegistryImagePaginatedRecords") + case "edges": + out.Values[i] = ec._RegistryImagePaginatedRecords_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + out.Values[i] = ec._RegistryImagePaginatedRecords_pageInfo(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "totalCount": + out.Values[i] = ec._RegistryImagePaginatedRecords_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 registryImageURLImplementors = []string{"RegistryImageURL"} + +func (ec *executionContext) _RegistryImageURL(ctx context.Context, sel ast.SelectionSet, obj *model.RegistryImageURL) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, registryImageURLImplementors) + + 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("RegistryImageURL") + case "scriptUrl": + out.Values[i] = ec._RegistryImageURL_scriptUrl(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "url": + out.Values[i] = ec._RegistryImageURL_url(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 routerImplementors = []string{"Router"} func (ec *executionContext) _Router(ctx context.Context, sel ast.SelectionSet, obj *entities.Router) graphql.Marshaler { @@ -51123,6 +53941,16 @@ func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__Crea return ec._Github__com___kloudlite___api___common__CreatedOrUpdatedBy(ctx, sel, &v) } +func (ec *executionContext) marshalNGithub__com___kloudlite___api___common__CreatedOrUpdatedBy2ᚖgithubᚗcomᚋkloudliteᚋapiᚋcommonᚐCreatedOrUpdatedBy(ctx context.Context, sel ast.SelectionSet, v *common.CreatedOrUpdatedBy) 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___api___common__CreatedOrUpdatedBy(ctx, sel, v) +} + func (ec *executionContext) unmarshalNGithub__com___kloudlite___api___pkg___repos__MatchType2githubᚗcomᚋkloudliteᚋapiᚋpkgᚋreposᚐMatchType(ctx context.Context, v interface{}) (repos.MatchType, error) { tmp, err := graphql.UnmarshalString(v) res := repos.MatchType(tmp) @@ -51945,6 +54773,27 @@ func (ec *executionContext) marshalNManagedResourceKeyValueRef2ᚖgithubᚗcom return ec._ManagedResourceKeyValueRef(ctx, sel, v) } +func (ec *executionContext) unmarshalNMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { + res, err := graphql.UnmarshalMap(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMap2map(ctx context.Context, sel ast.SelectionSet, v map[string]interface{}) 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 + } + res := graphql.MarshalMap(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + func (ec *executionContext) marshalNMetadata2k8sᚗioᚋapimachineryᚋpkgᚋapisᚋmetaᚋv1ᚐObjectMeta(ctx context.Context, sel ast.SelectionSet, v v12.ObjectMeta) graphql.Marshaler { return ec._Metadata(ctx, sel, &v) } @@ -51969,6 +54818,148 @@ func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋkloudliteᚋapi return ec._PageInfo(ctx, sel, v) } +func (ec *executionContext) marshalNRegistryImage2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRegistryImage(ctx context.Context, sel ast.SelectionSet, v *entities.RegistryImage) 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._RegistryImage(ctx, sel, v) +} + +func (ec *executionContext) marshalNRegistryImageCredentials2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentials(ctx context.Context, sel ast.SelectionSet, v *model.RegistryImageCredentials) 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._RegistryImageCredentials(ctx, sel, v) +} + +func (ec *executionContext) marshalNRegistryImageCredentialsEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentialsEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RegistryImageCredentialsEdge) 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.marshalNRegistryImageCredentialsEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentialsEdge(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) marshalNRegistryImageCredentialsEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageCredentialsEdge(ctx context.Context, sel ast.SelectionSet, v *model.RegistryImageCredentialsEdge) 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._RegistryImageCredentialsEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalNRegistryImageEdge2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RegistryImageEdge) 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.marshalNRegistryImageEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageEdge(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) marshalNRegistryImageEdge2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageEdge(ctx context.Context, sel ast.SelectionSet, v *model.RegistryImageEdge) 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._RegistryImageEdge(ctx, sel, v) +} + +func (ec *executionContext) marshalNRegistryImageURL2githubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageURL(ctx context.Context, sel ast.SelectionSet, v model.RegistryImageURL) graphql.Marshaler { + return ec._RegistryImageURL(ctx, sel, &v) +} + +func (ec *executionContext) marshalNRegistryImageURL2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImageURL(ctx context.Context, sel ast.SelectionSet, v *model.RegistryImageURL) 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._RegistryImageURL(ctx, sel, v) +} + 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)) { @@ -54314,6 +57305,20 @@ func (ec *executionContext) unmarshalOMetadataIn2ᚖk8sᚗioᚋapimachineryᚋpk return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalORegistryImage2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋentitiesᚐRegistryImage(ctx context.Context, sel ast.SelectionSet, v *entities.RegistryImage) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._RegistryImage(ctx, sel, v) +} + +func (ec *executionContext) marshalORegistryImagePaginatedRecords2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐRegistryImagePaginatedRecords(ctx context.Context, sel ast.SelectionSet, v *model.RegistryImagePaginatedRecords) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._RegistryImagePaginatedRecords(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 diff --git a/apps/console/internal/app/graph/model/models_gen.go b/apps/console/internal/app/graph/model/models_gen.go index cb37a2a0e..12482df01 100644 --- a/apps/console/internal/app/graph/model/models_gen.go +++ b/apps/console/internal/app/graph/model/models_gen.go @@ -8,6 +8,7 @@ import ( "strconv" "github.com/kloudlite/api/apps/console/internal/entities" + "github.com/kloudlite/api/common" "github.com/kloudlite/api/pkg/repos" "github.com/kloudlite/api/pkg/types" "github.com/kloudlite/operator/apis/crds/v1" @@ -753,6 +754,54 @@ type Port struct { type Query struct { } +type RegistryImageCredentials struct { + AccountName string `json:"accountName"` + CreatedBy *common.CreatedOrUpdatedBy `json:"createdBy"` + CreationTime string `json:"creationTime"` + ID repos.ID `json:"id"` + MarkedForDeletion *bool `json:"markedForDeletion,omitempty"` + Password string `json:"password"` + RecordVersion int `json:"recordVersion"` + UpdateTime string `json:"updateTime"` +} + +type RegistryImageCredentialsEdge struct { + Cursor string `json:"cursor"` + Node *RegistryImageCredentials `json:"node"` +} + +type RegistryImageCredentialsIn struct { + AccountName string `json:"accountName"` + Password string `json:"password"` +} + +type RegistryImageCredentialsPaginatedRecords struct { + Edges []*RegistryImageCredentialsEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type RegistryImageEdge struct { + Cursor string `json:"cursor"` + Node *entities.RegistryImage `json:"node"` +} + +type RegistryImagePaginatedRecords struct { + Edges []*RegistryImageEdge `json:"edges"` + PageInfo *PageInfo `json:"pageInfo"` + TotalCount int `json:"totalCount"` +} + +type RegistryImageURL struct { + ScriptURL string `json:"scriptUrl"` + URL string `json:"url"` +} + +type RegistryImageURLIn struct { + ScriptURL string `json:"scriptUrl"` + URL string `json:"url"` +} + type RouterEdge struct { Cursor string `json:"cursor"` Node *entities.Router `json:"node"` @@ -826,6 +875,10 @@ type SearchProjects struct { MarkedForDeletion *repos.MatchFilter `json:"markedForDeletion,omitempty"` } +type SearchRegistryImages struct { + Text *repos.MatchFilter `json:"text,omitempty"` +} + type SearchRouters struct { Text *repos.MatchFilter `json:"text,omitempty"` IsReady *repos.MatchFilter `json:"isReady,omitempty"` diff --git a/apps/console/internal/app/graph/registryimage.resolvers.go b/apps/console/internal/app/graph/registryimage.resolvers.go new file mode 100644 index 000000000..4a69a0c83 --- /dev/null +++ b/apps/console/internal/app/graph/registryimage.resolvers.go @@ -0,0 +1,34 @@ +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.49 + +import ( + "context" + "time" + + "github.com/kloudlite/api/apps/console/internal/app/graph/generated" + "github.com/kloudlite/api/apps/console/internal/entities" +) + +// CreationTime is the resolver for the creationTime field. +func (r *registryImageResolver) CreationTime(ctx context.Context, obj *entities.RegistryImage) (string, error) { + if obj == nil { + return "", errNilRegistryImage + } + return obj.BaseEntity.CreationTime.Format(time.RFC3339), nil +} + +// UpdateTime is the resolver for the updateTime field. +func (r *registryImageResolver) UpdateTime(ctx context.Context, obj *entities.RegistryImage) (string, error) { + if obj == nil { + return "", errNilRegistryImage + } + return obj.BaseEntity.UpdateTime.Format(time.RFC3339), nil +} + +// RegistryImage returns generated.RegistryImageResolver implementation. +func (r *Resolver) RegistryImage() generated.RegistryImageResolver { return ®istryImageResolver{r} } + +type registryImageResolver struct{ *Resolver } diff --git a/apps/console/internal/app/graph/resolver-utils.go b/apps/console/internal/app/graph/resolver-utils.go index 86bb6894b..40f7832c1 100644 --- a/apps/console/internal/app/graph/resolver-utils.go +++ b/apps/console/internal/app/graph/resolver-utils.go @@ -91,6 +91,7 @@ var ( errNilConfig = errors.Newf("config obj is nil") errNilSecret = errors.Newf("secret obj is nil") errNilEnvironment = errors.Newf("environment obj is nil") + errNilRegistryImage = errors.Newf("registry image obj is nil") errNilVPNDevice = errors.Newf("vpn device obj is nil") errNilImagePullSecret = errors.Newf("imagePullSecret obj is nil") errNilManagedResource = errors.Newf("managed resource obj is nil") diff --git a/apps/console/internal/app/graph/schema.graphqls b/apps/console/internal/app/graph/schema.graphqls index 743871f79..2cc5fa3b0 100644 --- a/apps/console/internal/app/graph/schema.graphqls +++ b/apps/console/internal/app/graph/schema.graphqls @@ -11,6 +11,7 @@ enum ConsoleResType { managed_resource imported_managed_resource environment + registry_image vpn_device } @@ -37,6 +38,10 @@ input SearchEnvironments { markedForDeletion: MatchFilterIn } +input SearchRegistryImages { + text: MatchFilterIn +} + input SearchApps { text: MatchFilterIn isReady: MatchFilterIn @@ -111,6 +116,10 @@ type Query { core_getImagePullSecret(name: String!): ImagePullSecret @isLoggedInAndVerified @hasAccount core_resyncImagePullSecret(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_getRegistryImageURL(image: String!, meta: Map!): RegistryImageURL! @isLoggedInAndVerified @hasAccount + core_getRegistryImage(image: String!,): RegistryImage @isLoggedInAndVerified @hasAccount + core_listRegistryImages(pq: CursorPaginationIn): RegistryImagePaginatedRecords @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 @@ -157,6 +166,8 @@ type Mutation { core_updateImagePullSecret(pullSecret: ImagePullSecretIn!): ImagePullSecret @isLoggedInAndVerified @hasAccount core_deleteImagePullSecret(name: String!): Boolean! @isLoggedInAndVerified @hasAccount + core_deleteRegistryImage(image: 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 diff --git a/apps/console/internal/app/graph/schema.resolvers.go b/apps/console/internal/app/graph/schema.resolvers.go index 2b4477ef9..1e3c9e648 100644 --- a/apps/console/internal/app/graph/schema.resolvers.go +++ b/apps/console/internal/app/graph/schema.resolvers.go @@ -122,6 +122,18 @@ func (r *mutationResolver) CoreDeleteImagePullSecret(ctx context.Context, name s return true, nil } +// CoreDeleteRegistryImage is the resolver for the core_deleteRegistryImage field. +func (r *mutationResolver) CoreDeleteRegistryImage(ctx context.Context, image string) (bool, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return false, errors.NewE(err) + } + if err := r.Domain.DeleteRegistryImage(cc, image); 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, envName string, app entities.App) (*entities.App, error) { cc, err := toConsoleContext(ctx) @@ -513,6 +525,43 @@ func (r *queryResolver) CoreResyncImagePullSecret(ctx context.Context, name stri return true, nil } +// CoreGetRegistryImageURL is the resolver for the core_getRegistryImageURL field. +func (r *queryResolver) CoreGetRegistryImageURL(ctx context.Context, image string, meta map[string]interface{}) (*model.RegistryImageURL, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + imageURL, err := r.Domain.GetRegistryImageURL(cc, image, meta) + if err != nil { + return nil, errors.NewE(err) + } + return fn.JsonConvertP[model.RegistryImageURL](imageURL) +} + +// CoreGetRegistryImage is the resolver for the core_getRegistryImage field. +func (r *queryResolver) CoreGetRegistryImage(ctx context.Context, image string) (*entities.RegistryImage, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + return r.Domain.GetRegistryImage(cc, image) +} + +// CoreListRegistryImages is the resolver for the core_listRegistryImages field. +func (r *queryResolver) CoreListRegistryImages(ctx context.Context, pq *repos.CursorPagination) (*model.RegistryImagePaginatedRecords, error) { + cc, err := toConsoleContext(ctx) + if err != nil { + return nil, errors.NewE(err) + } + + pImages, err := r.Domain.ListRegistryImages(cc, fn.DefaultIfNil(pq, repos.DefaultCursorPagination)) + if err != nil { + return nil, errors.NewE(err) + } + + return fn.JsonConvertP[model.RegistryImagePaginatedRecords](pImages) +} + // CoreListApps is the resolver for the core_listApps field. func (r *queryResolver) CoreListApps(ctx context.Context, envName string, search *model.SearchApps, pq *repos.CursorPagination) (*model.AppPaginatedRecords, error) { cc, err := toConsoleContext(ctx) diff --git a/apps/console/internal/app/graph/struct-to-graphql/registryimage.graphqls b/apps/console/internal/app/graph/struct-to-graphql/registryimage.graphqls new file mode 100644 index 000000000..70a4447a9 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/registryimage.graphqls @@ -0,0 +1,30 @@ +type RegistryImage @shareable { + accountName: String! + creationTime: Date! + id: ID! + imageName: String! + imageTag: String! + markedForDeletion: Boolean + meta: Map! + recordVersion: Int! + updateTime: Date! +} + +type RegistryImageEdge @shareable { + cursor: String! + node: RegistryImage! +} + +type RegistryImagePaginatedRecords @shareable { + edges: [RegistryImageEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RegistryImageIn { + accountName: String! + imageName: String! + imageTag: String! + meta: Map! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/registryimagecredentials.graphqls b/apps/console/internal/app/graph/struct-to-graphql/registryimagecredentials.graphqls new file mode 100644 index 000000000..3a22dac56 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/registryimagecredentials.graphqls @@ -0,0 +1,27 @@ +type RegistryImageCredentials @shareable { + accountName: String! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! + creationTime: Date! + id: ID! + markedForDeletion: Boolean + password: String! + recordVersion: Int! + updateTime: Date! +} + +type RegistryImageCredentialsEdge @shareable { + cursor: String! + node: RegistryImageCredentials! +} + +type RegistryImageCredentialsPaginatedRecords @shareable { + edges: [RegistryImageCredentialsEdge!]! + pageInfo: PageInfo! + totalCount: Int! +} + +input RegistryImageCredentialsIn { + accountName: String! + password: String! +} + diff --git a/apps/console/internal/app/graph/struct-to-graphql/registryimageurl.graphqls b/apps/console/internal/app/graph/struct-to-graphql/registryimageurl.graphqls new file mode 100644 index 000000000..3a5d15b17 --- /dev/null +++ b/apps/console/internal/app/graph/struct-to-graphql/registryimageurl.graphqls @@ -0,0 +1,10 @@ +type RegistryImageURL @shareable { + scriptUrl: String! + url: String! +} + +input RegistryImageURLIn { + scriptUrl: String! + url: String! +} + diff --git a/apps/console/internal/app/process-resource-updates.go b/apps/console/internal/app/process-resource-updates.go index c337c1073..73469bebf 100644 --- a/apps/console/internal/app/process-resource-updates.go +++ b/apps/console/internal/app/process-resource-updates.go @@ -23,7 +23,10 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) -type ResourceUpdateConsumer messaging.Consumer +type ( + ResourceUpdateConsumer messaging.Consumer + WebhookConsumer messaging.Consumer +) func newResourceContext(ctx domain.ConsoleContext, environmentName string) domain.ResourceContext { return domain.ResourceContext{ diff --git a/apps/console/internal/app/webhook-consumer.go b/apps/console/internal/app/webhook-consumer.go new file mode 100644 index 000000000..d46ac3642 --- /dev/null +++ b/apps/console/internal/app/webhook-consumer.go @@ -0,0 +1,52 @@ +package app + +import ( + "context" + "encoding/json" + "github.com/kloudlite/api/apps/console/internal/domain" + "github.com/kloudlite/api/pkg/errors" + "github.com/kloudlite/api/pkg/logging" + msgTypes "github.com/kloudlite/api/pkg/messaging/types" +) + +func processWebhooks(consumer WebhookConsumer, d domain.Domain, logger logging.Logger) error { + err := consumer.Consume(func(msg *msgTypes.ConsumeMsg) error { + logger := logger.WithName("webhook-consumer") + logger.Infof("started processing message") + + defer func() { + logger.Infof("finished processing message") + }() + + webhook := &domain.ImageHookPayload{} + if err := json.Unmarshal(msg.Payload, &webhook); err != nil { + logger.Errorf(err, "could not unmarshal into *ImageHookPayload") + return errors.NewE(err) + } + if webhook.Image == "" || webhook.AccountName == "" { + return errors.Newf("invalid webhook payload") + } + hook := &domain.ImageHookPayload{ + Image: webhook.Image, + AccountName: webhook.AccountName, + Meta: webhook.Meta, + } + + _, err := d.CreateRegistryImage(context.TODO(), hook.AccountName, hook.Image, hook.Meta) + if err != nil { + logger.Errorf(err, "could not process image hook") + return errors.NewE(err) + } + return nil + }, msgTypes.ConsumeOpts{ + OnError: func(err error) error { + logger.Errorf(err, "error while consuming message") + return nil + }, + }) + if err != nil { + return errors.NewE(err) + } + + return nil +} diff --git a/apps/console/internal/domain/api.go b/apps/console/internal/domain/api.go index ca17846ca..52b574555 100644 --- a/apps/console/internal/domain/api.go +++ b/apps/console/internal/domain/api.go @@ -168,6 +168,12 @@ type Domain interface { ResyncEnvironment(ctx ConsoleContext, name string) error + GetRegistryImageURL(ctx ConsoleContext, image string, meta map[string]any) (*entities.RegistryImageURL, error) + GetRegistryImage(ctx ConsoleContext, image string) (*entities.RegistryImage, error) + DeleteRegistryImage(ctx ConsoleContext, image string) error + CreateRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) + ListRegistryImages(ctx ConsoleContext, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.RegistryImage], 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) diff --git a/apps/console/internal/domain/domain.go b/apps/console/internal/domain/domain.go index 7e3fe5be4..ddf0fc44c 100644 --- a/apps/console/internal/domain/domain.go +++ b/apps/console/internal/domain/domain.go @@ -57,6 +57,8 @@ type domain struct { importedMresRepo repos.DbRepo[*entities.ImportedManagedResource] pullSecretsRepo repos.DbRepo[*entities.ImagePullSecret] + registryImageRepo repos.DbRepo[*entities.RegistryImage] + serviceBindingRepo repos.DbRepo[*entities.ServiceBinding] clusterManagedServiceRepo repos.DbRepo[*entities.ClusterManagedService] @@ -555,6 +557,7 @@ var Module = fx.Module("domain", infraClient infra.InfraClient, environmentRepo repos.DbRepo[*entities.Environment], + registryImageRepo repos.DbRepo[*entities.RegistryImage], appRepo repos.DbRepo[*entities.App], externalAppRepo repos.DbRepo[*entities.ExternalApp], @@ -596,6 +599,7 @@ var Module = fx.Module("domain", resourceMappingRepo: resourceMappingRepo, serviceBindingRepo: serviceBindingRepo, clusterManagedServiceRepo: clusterManagedServiceRepo, + registryImageRepo: registryImageRepo, envVars: ev, diff --git a/apps/console/internal/domain/registry-image.go b/apps/console/internal/domain/registry-image.go new file mode 100644 index 000000000..ffdd4fef2 --- /dev/null +++ b/apps/console/internal/domain/registry-image.go @@ -0,0 +1,145 @@ +package domain + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "fmt" + "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/fields" + "github.com/kloudlite/api/pkg/errors" + fn "github.com/kloudlite/api/pkg/functions" + "github.com/kloudlite/api/pkg/repos" + "strings" +) + +type ImageHookPayload struct { + Image string `json:"image"` + AccountName string `json:"accountName"` + Meta map[string]any `json:"meta"` +} + +func encodeAccessToken(accountName string, tokenSecret string) string { + info := fmt.Sprintf("account=%s", accountName) + + fn.FxErrorHandler() + + h := sha256.New() + h.Write([]byte(info + tokenSecret)) + sum := fmt.Sprintf("%x", h.Sum(nil)) + + info += fmt.Sprintf(";sha256sum=%s", sum) + + return base64.StdEncoding.EncodeToString([]byte(info)) +} + +func getImageNameTag(image string) (string, string) { + parts := strings.Split(image, ":") + + if len(parts) == 2 { + return parts[0], parts[1] + } + + return parts[0], "latest" +} + +func (d *domain) GetRegistryImageURL(ctx ConsoleContext, image string, meta map[string]any) (*entities.RegistryImageURL, error) { + encodedToken := encodeAccessToken(ctx.AccountName, d.envVars.WebhookTokenHashingSecret) + + imageName, imageTag := getImageNameTag(image) + + metaJSON, err := json.Marshal(meta) + if err != nil { + return nil, err + } + + return &entities.RegistryImageURL{ + URL: fmt.Sprintf(`curl -X POST "%s" -H "Authorization: %s" -H "Content-Type: application/json" -d '{"image": "%s:%s", "meta": %s}'`, d.envVars.WebhookURL, encodedToken, imageName, imageTag, metaJSON), + ScriptURL: "", + }, nil +} + +func (d *domain) CreateRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) { + imageName, imageTag := getImageNameTag(image) + + createdImage, err := d.registryImageRepo.Upsert(ctx, repos.Filter{ + fields.AccountName: accountName, + fc.RegistryImageImageName: imageName, + fc.RegistryImageImageTag: imageTag, + }, &entities.RegistryImage{ + AccountName: accountName, + ImageName: imageName, + ImageTag: imageTag, + Meta: meta, + }) + if err != nil { + return nil, errors.NewE(err) + } + + return createdImage, nil + +} + +func (d *domain) DeleteRegistryImage(ctx ConsoleContext, image string) error { + imageName, imageTag := getImageNameTag(image) + + matched, err := d.registryImageRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.RegistryImageImageName: imageName, + fc.RegistryImageImageTag: imageTag, + }) + + if err != nil { + return errors.NewE(err) + } + + if matched == nil { + return errors.Newf("image not found for account %s", ctx.AccountName) + } + + err = d.registryImageRepo.DeleteOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.RegistryImageImageName: imageName, + fc.RegistryImageImageTag: imageTag, + }) + + if err != nil { + return errors.NewE(err) + } + + return nil +} + +func (d *domain) GetRegistryImage(ctx ConsoleContext, image string) (*entities.RegistryImage, error) { + imageName, imageTag := getImageNameTag(image) + matched, err := d.registryImageRepo.FindOne(ctx, repos.Filter{ + fields.AccountName: ctx.AccountName, + fc.RegistryImageImageName: imageName, + fc.RegistryImageImageTag: imageTag, + }) + + if err != nil { + return nil, errors.NewE(err) + } + + if matched == nil { + return nil, errors.Newf("image not found for account %s", ctx.AccountName) + } + + return matched, nil +} + +func (d *domain) ListRegistryImages(ctx ConsoleContext, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.RegistryImage], error) { + if err := d.canPerformActionInAccount(ctx, iamT.ListRegistryImages); err != nil { + return nil, errors.NewE(err) + } + + filters := repos.Filter{ + fields.AccountName: ctx.AccountName, + } + + return d.registryImageRepo.FindPaginated(ctx, filters, pq) +} diff --git a/apps/console/internal/entities/field-constants/generated_constants.go b/apps/console/internal/entities/field-constants/generated_constants.go index dbfe519ac..5cec8a8d9 100644 --- a/apps/console/internal/entities/field-constants/generated_constants.go +++ b/apps/console/internal/entities/field-constants/generated_constants.go @@ -200,6 +200,13 @@ const ( ManagedResourceRefNamespace = "namespace" ) +// constant vars generated for struct RegistryImage +const ( + RegistryImageImageName = "imageName" + RegistryImageImageTag = "imageTag" + RegistryImageMeta = "meta" +) + // constant vars generated for struct ResourceMapping const ( ResourceMappingBaseEntity = "BaseEntity" diff --git a/apps/console/internal/entities/registry-image.go b/apps/console/internal/entities/registry-image.go new file mode 100644 index 000000000..b01d4927a --- /dev/null +++ b/apps/console/internal/entities/registry-image.go @@ -0,0 +1,37 @@ +package entities + +import ( + fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" + "github.com/kloudlite/api/common/fields" + "github.com/kloudlite/api/pkg/repos" +) + +type RegistryImage struct { + repos.BaseEntity `json:",inline" graphql:"noinput"` + AccountName string `json:"accountName"` + ImageName string `json:"imageName"` + ImageTag string `json:"imageTag"` + Meta map[string]any `json:"meta"` +} + +type RegistryImageURL struct { + URL string `json:"url"` + ScriptURL string `json:"scriptUrl"` +} + +var RegistryImageIndexes = []repos.IndexField{ + { + Field: []repos.IndexKey{ + {Key: fields.Id, Value: repos.IndexAsc}, + }, + Unique: true, + }, + { + Field: []repos.IndexKey{ + {Key: fields.AccountName, Value: repos.IndexAsc}, + {Key: fc.RegistryImageImageName, Value: repos.IndexAsc}, + {Key: fc.RegistryImageImageTag, Value: repos.IndexAsc}, + }, + Unique: true, + }, +} diff --git a/apps/console/internal/env/env.go b/apps/console/internal/env/env.go index 1a2bf74f1..4d7b08fa1 100644 --- a/apps/console/internal/env/env.go +++ b/apps/console/internal/env/env.go @@ -20,6 +20,9 @@ type Env struct { NatsURL string `env:"NATS_URL" required:"true"` NatsReceiveFromAgentStream string `env:"NATS_RECEIVE_FROM_AGENT_STREAM" required:"true"` + EventsNatsStream string `env:"EVENTS_NATS_STREAM" required:"true"` + WebhookTokenHashingSecret string `env:"WEBHOOK_TOKEN_HASHING_SECRET" required:"true"` + WebhookURL string `env:"WEBHOOK_URL" required:"true"` IAMGrpcAddr string `env:"IAM_GRPC_ADDR" required:"true"` InfraGrpcAddr string `env:"INFRA_GRPC_ADDR" required:"true"` diff --git a/apps/iam/internal/app/action-role-binding.go b/apps/iam/internal/app/action-role-binding.go index fed10ef4d..e6c2a0937 100644 --- a/apps/iam/internal/app/action-role-binding.go +++ b/apps/iam/internal/app/action-role-binding.go @@ -89,6 +89,9 @@ var roleBindings RoleBindingMap = RoleBindingMap{ t.ListImagePullSecrets: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, t.GetImagePullSecret: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, + // registry images + t.ListRegistryImages: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, + // for projects t.CreateProject: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember}, t.ListProjects: []t.Role{t.RoleAccountOwner, t.RoleAccountAdmin, t.RoleAccountMember, t.RoleProjectAdmin, t.RoleProjectMember}, diff --git a/apps/iam/types/types.go b/apps/iam/types/types.go index 451cf5698..8a3ce7098 100644 --- a/apps/iam/types/types.go +++ b/apps/iam/types/types.go @@ -176,6 +176,9 @@ const ( UpdateImagePullSecret Action = "update-image-pull-secret" CreateImagePullSecret Action = "create-image-pull-secret" DeleteImagePullSecret Action = "delete-image-pull-secret" + + // registry images + ListRegistryImages Action = "list-registry-images" ) func NewResourceRef(accountName string, resourceType ResourceType, resourceName string) string { diff --git a/apps/webhook/Taskfile.yml b/apps/webhook/Taskfile.yml index d1f49b09b..6e83cb28b 100644 --- a/apps/webhook/Taskfile.yml +++ b/apps/webhook/Taskfile.yml @@ -13,9 +13,7 @@ tasks: dotenv: - .secrets/env cmds: - - task: build - # - dlv exec -l 127.0.0.1:31117 --headless /tmp/webhook -- --dev - - ./bin/{{.app}} --dev + - go run ./main.go --dev build: cmds: diff --git a/apps/webhook/internal/app/app.go b/apps/webhook/internal/app/app.go index fc053d5e4..89283b42e 100644 --- a/apps/webhook/internal/app/app.go +++ b/apps/webhook/internal/app/app.go @@ -27,4 +27,6 @@ var Module = fx.Module( domain.Module, LoadGitWebhook(), + + LoadImageHook(), ) diff --git a/apps/webhook/internal/app/image-hook.go b/apps/webhook/internal/app/image-hook.go new file mode 100644 index 000000000..d03e07631 --- /dev/null +++ b/apps/webhook/internal/app/image-hook.go @@ -0,0 +1,143 @@ +package app + +import ( + "crypto/sha256" + "encoding/base64" + "encoding/json" + "fmt" + "github.com/gofiber/fiber/v2" + "github.com/kloudlite/api/apps/webhook/internal/domain" + "github.com/kloudlite/api/apps/webhook/internal/env" + "github.com/kloudlite/api/common" + httpServer "github.com/kloudlite/api/pkg/http-server" + "github.com/kloudlite/api/pkg/logging" + "github.com/kloudlite/api/pkg/messaging" + types2 "github.com/kloudlite/api/pkg/messaging/types" + "github.com/pkg/errors" + "go.uber.org/fx" + "net/http" + "strings" + "time" +) + +func validateAndDecodeAccessToken(accessToken string, tokenSecret string) (accountName string, err error) { + b, err := base64.StdEncoding.DecodeString(accessToken) + if err != nil { + return "", errors.Wrap(err, "invalid access token, incorrect format") + } + + info := string(b) + + sp := strings.SplitN(info, ";sha256sum=", 2) + + if len(sp) != 2 { + return "", errors.New("invalid access token, incorrect format") + } + data := sp[0] + sum := sp[1] + + h := sha256.New() + h.Write([]byte(data + tokenSecret)) + calculatedSum := fmt.Sprintf("%x", h.Sum(nil)) + + if sum != calculatedSum { + return "", errors.New("invalid access token, checksum mismatch") + } + + s := strings.SplitN(data, ";", 2) + + if len(s) != 1 { + return "", errors.New("invalid access token, incorrect data format") + } + for _, v := range strings.Split(s[0], ";") { + sp := strings.SplitN(v, "=", 2) + if len(sp) != 2 { + return "", errors.New("invalid access token, incorrect data format") + } + if sp[0] == "account" { + accountName = sp[1] + } + } + return accountName, nil +} + +func LoadImageHook() fx.Option { + return fx.Invoke( + func(server httpServer.Server, envVars *env.Env, producer messaging.Producer, logr logging.Logger, d domain.Domain) error { + + app := server.Raw() + + app.Post("/image", func(ctx *fiber.Ctx) error { + logger := logr.WithName("image-hook") + + headers := ctx.GetReqHeaders() + v, ok := headers["Authorization"] + if !ok { + return ctx.Status(fiber.StatusUnauthorized).SendString("no authorization header passed") + } + + accountName, err := validateAndDecodeAccessToken(v[0], envVars.WebhookTokenHashingSecret) + if err != nil { + return ctx.Status(fiber.StatusUnauthorized).SendString(err.Error()) + } + + data := struct { + Image string `json:"image"` + AccountName string `json:"accountName"` + Meta map[string]any `json:"meta"` + }{} + + body := ctx.Body() + if err := json.Unmarshal(body, &data); err != nil { + return ctx.Status(fiber.StatusBadRequest).SendString(err.Error()) + } + data.AccountName = accountName + + logger = logger.WithKV("account", data.AccountName, "image", data.Image, "meta", data.Meta) + logger.Infof("received image-hook") + + jsonPayload, err := json.Marshal(data) + if err != nil { + return err + } + + err = producer.Produce(ctx.Context(), types2.ProduceMsg{ + Subject: string(common.ImageRegistryHookTopicName), + Payload: jsonPayload, + }) + if err != nil { + return err + } + + if err != nil { + errMsg := fmt.Sprintf("failed to produce message: %s", "webhook-provider") + logger.Errorf(err, errMsg) + return ctx.Status(http.StatusInternalServerError).JSON(errMsg) + } + logger.WithKV( + "produced.subject", string(common.ImageRegistryHookTopicName), + "produced.timestamp", time.Now(), + ).Infof("queued webhook") + + err = producer.Produce(ctx.Context(), types2.ProduceMsg{ + Subject: string(common.ImageUpdateRegistryHookTopicName), + Payload: jsonPayload, + }) + if err != nil { + return err + } + + if err != nil { + errMsg := fmt.Sprintf("failed to produce message: %s", "webhook-provider") + logger.Errorf(err, errMsg) + return ctx.Status(http.StatusInternalServerError).JSON(errMsg) + } + logger.WithKV( + "produced.subject", string(common.ImageUpdateRegistryHookTopicName), + "produced.timestamp", time.Now(), + ).Infof("queued webhook") + return ctx.Status(http.StatusAccepted).JSON(map[string]string{"status": "ok"}) + }) + return nil + }) +} diff --git a/apps/webhook/internal/env/env.go b/apps/webhook/internal/env/env.go index a3ee6688b..772b771be 100644 --- a/apps/webhook/internal/env/env.go +++ b/apps/webhook/internal/env/env.go @@ -12,4 +12,6 @@ type Env struct { CommsService string `env:"COMMS_SERVICE" required:"true"` DiscordWebhookUrl string `env:"DISCORD_WEBHOOK_URL" required:"false"` + + WebhookTokenHashingSecret string `env:"WEBHOOK_TOKEN_HASHING_SECRET" required:"true"` } diff --git a/common/kafka-topic-name.go b/common/kafka-topic-name.go index 53c3ab1b4..966b43009 100644 --- a/common/kafka-topic-name.go +++ b/common/kafka-topic-name.go @@ -8,14 +8,17 @@ import ( type topicName string const ( - GitWebhookTopicName topicName = "events.webhooks.git" - AuditEventLogTopicName topicName = "events.audit.event-log" - NotificationTopicName topicName = "events.notification" + GitWebhookTopicName topicName = "events.webhooks.git" + AuditEventLogTopicName topicName = "events.audit.event-log" + NotificationTopicName topicName = "events.notification" + ImageRegistryHookTopicName topicName = "events.webhooks.image" + ImageUpdateRegistryHookTopicName topicName = "events.webhooks.image-update" ) const ( sendToAgentSubjectPrefix = "send-to-agent" receiveFromAgentSubjectPrefix = "receive-from-agent" + //receiveFromWebhookSubjectPrefix = "receive-from-webhook" ) func SendToAgentSubjectPrefix(accountName string, clusterName string) string {