diff --git a/apps/console/internal/app/graph/common-types.resolvers.go b/apps/console/internal/app/graph/common-types.resolvers.go index bfb026ce5..bbf2ab306 100644 --- a/apps/console/internal/app/graph/common-types.resolvers.go +++ b/apps/console/internal/app/graph/common-types.resolvers.go @@ -38,6 +38,15 @@ func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) SyncSc return fn.New(obj.SyncScheduledAt.Format(time.RFC3339)), nil } +// CheckList is the resolver for the checkList field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) CheckList(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta, error) { + if obj == nil { + return nil, errors.Newf("obj is nil") + } + + return fn.JsonConvert[[]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta](obj.CheckList) +} + // Checks is the resolver for the checks field. func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) { if obj == nil { diff --git a/apps/console/internal/app/graph/generated/generated.go b/apps/console/internal/app/graph/generated/generated.go index 7060eb4b2..0bc61fc79 100644 --- a/apps/console/internal/app/graph/generated/generated.go +++ b/apps/console/internal/app/graph/generated/generated.go @@ -478,11 +478,22 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Check struct { + Debug func(childComplexity int) int + Error func(childComplexity int) int Generation func(childComplexity int) int + Info func(childComplexity int) int Message func(childComplexity int) int + StartedAt func(childComplexity int) int + State func(childComplexity int) int Status func(childComplexity int) int } + Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { + Description func(childComplexity int) int + Name func(childComplexity int) int + Title func(childComplexity int) int + } + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { APIVersion func(childComplexity int) int Kind func(childComplexity int) int @@ -491,6 +502,7 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Status struct { + CheckList func(childComplexity int) int Checks func(childComplexity int) int IsReady func(childComplexity int) int LastReadyGeneration func(childComplexity int) int @@ -894,6 +906,7 @@ type Github__com___kloudlite___api___pkg___types__SyncStatusResolver interface { SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) } type Github__com___kloudlite___operator___pkg___operator__StatusResolver interface { + CheckList(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta, error) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) @@ -2793,6 +2806,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___wireguard___v1__Port.TargetPort(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.debug": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.error": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { break @@ -2800,6 +2827,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.info": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.message": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { break @@ -2807,6 +2841,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.startedAt": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.state": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.status": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { break @@ -2814,6 +2862,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.description": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.title": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { break @@ -2842,6 +2911,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checkList": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { break @@ -5597,11 +5673,22 @@ type Github__com___kloudlite___operator___apis___wireguard___v1__Port @shareable } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -5610,6 +5697,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -5917,6 +6005,13 @@ enum Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMo public } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + enum K8s__io___api___core___v1__SecretType { bootstrap__kubernetes__io___token kubernetes__io___basic____auth @@ -9418,6 +9513,8 @@ func (ec *executionContext) fieldContext_App_status(ctx context.Context, field g 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": @@ -11968,6 +12065,8 @@ func (ec *executionContext) fieldContext_ConsoleVPNDevice_status(ctx context.Con 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": @@ -13293,6 +13392,8 @@ func (ec *executionContext) fieldContext_Environment_status(ctx context.Context, 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": @@ -19639,6 +19740,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_debug(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.Debug, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_error(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.Error, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) if err != nil { @@ -19680,6 +19863,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_info(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.Info, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field) if err != nil { @@ -19721,6 +19945,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(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.StartedAt, 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.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(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.State, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgOperatorState) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___pkg___operator__State does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field) if err != nil { @@ -19765,6 +20071,135 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(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.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(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.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) if err != nil { @@ -19941,6 +20376,55 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(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.Github__com___kloudlite___operator___pkg___operator__Status().CheckList(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + case "title": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__CheckMeta", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) if err != nil { @@ -22569,6 +23053,8 @@ func (ec *executionContext) fieldContext_ManagedResource_status(ctx context.Cont 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": @@ -28108,6 +28594,8 @@ func (ec *executionContext) fieldContext_Project_status(ctx context.Context, fie 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": @@ -28982,6 +29470,8 @@ func (ec *executionContext) fieldContext_ProjectManagedService_status(ctx contex 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": @@ -33878,6 +34368,8 @@ func (ec *executionContext) fieldContext_Router_status(ctx context.Context, fiel 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": @@ -43515,14 +44007,34 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "debug": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx, field, obj) + + case "error": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_error(ctx, field, obj) + case "generation": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) + case "info": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_info(ctx, field, obj) + case "message": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) + case "startedAt": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx, field, obj) + + case "state": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_state(ctx, field, obj) + case "status": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) @@ -43541,6 +44053,45 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator return out } +var github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__CheckMeta"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__CheckMeta") + case "description": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "title": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { @@ -43600,6 +44151,23 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checkList": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "checks": field := field @@ -48058,6 +48626,16 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx, sel, v) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -48998,7 +49576,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -49006,7 +49584,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -50100,6 +50678,53 @@ func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis_ return res, nil } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(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) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { if v == nil { return graphql.Null @@ -50147,6 +50772,22 @@ func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___o return ret } +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgOperatorState, error) { + if v == nil { + return nil, nil + } + var res = new(model.GithubComKloudliteOperatorPkgOperatorState) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋconsoleᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorState) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { return ec._Github__com___kloudlite___operator___pkg___operator__Status(ctx, sel, &v) } diff --git a/apps/console/internal/app/graph/model/models_gen.go b/apps/console/internal/app/graph/model/models_gen.go index b82721027..2e682a4cb 100644 --- a/apps/console/internal/app/graph/model/models_gen.go +++ b/apps/console/internal/app/graph/model/models_gen.go @@ -514,9 +514,20 @@ type GithubComKloudliteOperatorApisWireguardV1PortIn struct { } type GithubComKloudliteOperatorPkgOperatorCheck struct { - Generation *int `json:"generation,omitempty"` - Message *string `json:"message,omitempty"` - Status bool `json:"status"` + Debug *string `json:"debug,omitempty"` + Error *string `json:"error,omitempty"` + Generation *int `json:"generation,omitempty"` + Info *string `json:"info,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + State *GithubComKloudliteOperatorPkgOperatorState `json:"state,omitempty"` + Status bool `json:"status"` +} + +type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Title string `json:"title"` } type GithubComKloudliteOperatorPkgOperatorResourceRef struct { @@ -785,6 +796,51 @@ func (e GithubComKloudliteOperatorApisCrdsV1ConfigOrSecret) MarshalGQL(w io.Writ fmt.Fprint(w, strconv.Quote(e.String())) } +type GithubComKloudliteOperatorPkgOperatorState string + +const ( + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation GithubComKloudliteOperatorPkgOperatorState = "errored____during____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation GithubComKloudliteOperatorPkgOperatorState = "finished____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation GithubComKloudliteOperatorPkgOperatorState = "under____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled GithubComKloudliteOperatorPkgOperatorState = "yet____to____be____reconciled" +) + +var AllGithubComKloudliteOperatorPkgOperatorState = []GithubComKloudliteOperatorPkgOperatorState{ + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled, +} + +func (e GithubComKloudliteOperatorPkgOperatorState) IsValid() bool { + switch e { + case GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled: + return true + } + return false +} + +func (e GithubComKloudliteOperatorPkgOperatorState) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorPkgOperatorState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorPkgOperatorState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___pkg___operator__State", str) + } + return nil +} + +func (e GithubComKloudliteOperatorPkgOperatorState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type K8sIoAPICoreV1SecretType string const ( diff --git a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls index b2091067b..42756daac 100644 --- a/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/console/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -239,11 +239,22 @@ type Github__com___kloudlite___operator___apis___wireguard___v1__Port @shareable } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -252,6 +263,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -559,6 +571,13 @@ enum Github__com___kloudlite___operator___apis___crds___v1__EnvironmentRoutingMo public } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + enum K8s__io___api___core___v1__SecretType { bootstrap__kubernetes__io___token kubernetes__io___basic____auth diff --git a/apps/console/internal/domain/app.go b/apps/console/internal/domain/app.go index 4b8ea6f7a..3eb584603 100644 --- a/apps/console/internal/domain/app.go +++ b/apps/console/internal/domain/app.go @@ -1,6 +1,8 @@ package domain import ( + "fmt" + "github.com/kloudlite/api/apps/console/internal/entities" fc "github.com/kloudlite/api/apps/console/internal/entities/field-constants" "github.com/kloudlite/api/common" @@ -200,6 +202,7 @@ func (d *domain) RestartApp(ctx ResourceContext, appName string) error { } func (d *domain) OnAppUpdateMessage(ctx ResourceContext, app entities.App, status types.ResourceStatus, opts UpdateAndDeleteOpts) error { + fmt.Printf("OnAppUpdateMessage: %v\n", app) xApp, err := d.findApp(ctx, app.Name) if err != nil { return errors.NewE(err) diff --git a/apps/container-registry/internal/app/graph/generated/generated.go b/apps/container-registry/internal/app/graph/generated/generated.go index a31944964..961017efb 100644 --- a/apps/container-registry/internal/app/graph/generated/generated.go +++ b/apps/container-registry/internal/app/graph/generated/generated.go @@ -344,11 +344,22 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Check struct { + Debug func(childComplexity int) int + Error func(childComplexity int) int Generation func(childComplexity int) int + Info func(childComplexity int) int Message func(childComplexity int) int + StartedAt func(childComplexity int) int + State func(childComplexity int) int Status func(childComplexity int) int } + Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { + Description func(childComplexity int) int + Name func(childComplexity int) int + Title func(childComplexity int) int + } + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { APIVersion func(childComplexity int) int Kind func(childComplexity int) int @@ -357,6 +368,7 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Status struct { + CheckList func(childComplexity int) int Checks func(childComplexity int) int IsReady func(childComplexity int) int LastReadyGeneration func(childComplexity int) int @@ -1867,6 +1879,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___distribution___v1__Resource.MemoryInMb(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.debug": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.error": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { break @@ -1874,6 +1900,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.info": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.message": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { break @@ -1881,6 +1914,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.startedAt": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.state": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.status": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { break @@ -1888,6 +1935,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.description": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.title": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { break @@ -1916,6 +1984,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checkList": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { break @@ -2787,6 +2862,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__RepoIn, ec.unmarshalInputGithub__com___kloudlite___operator___apis___distribution___v1__ResourceIn, ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckIn, + ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn, ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn, ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__StatusIn, ec.unmarshalInputGithub__com___kloudlite___operator___pkg___raw____json__RawJsonIn, @@ -2888,7 +2964,7 @@ type CRCheckNameAvailabilityOutput @shareable { } type Query { - cr_listRepos(search:SearchRepos, pagination:CursorPaginationIn) : RepositoryPaginatedRecords @isLoggedInAndVerified @hasAccount + cr_listRepos(search: SearchRepos, pagination: CursorPaginationIn): RepositoryPaginatedRecords @isLoggedInAndVerified @hasAccount cr_listCreds(search:SearchCreds, pagination:CursorPaginationIn) : CredentialPaginatedRecords @isLoggedInAndVerified @hasAccount cr_listDigests(repoName:String!, search: SearchRepos, pagination:CursorPaginationIn) : DigestPaginatedRecords @isLoggedInAndVerified @hasAccount @@ -2900,8 +2976,8 @@ type Query { cr_listBuilds(repoName:String!, search:SearchBuilds, pagination:CursorPaginationIn) : BuildPaginatedRecords @isLoggedInAndVerified @hasAccount cr_listGithubInstallations(pagination:PaginationIn) : [GithubInstallation!] @isLoggedInAndVerified - cr_listGithubRepos(installationId:Int!, pagination:PaginationIn) : GithubListRepository @isLoggedInAndVerified - cr_searchGithubRepos(organization:String!, search:String!, pagination:PaginationIn) : GithubSearchRepository @isLoggedInAndVerified + cr_listGithubRepos(installationId:Int!, pagination:PaginationIn): GithubListRepository @isLoggedInAndVerified + cr_searchGithubRepos(organization:String!, search:String!, pagination:PaginationIn): GithubSearchRepository @isLoggedInAndVerified cr_listGithubBranches(repoUrl:String!, pagination:PaginationIn) : [GitBranch!] @isLoggedInAndVerified cr_listGitlabGroups(query:String, pagination:PaginationIn) : [GitlabGroup!] @isLoggedInAndVerified @@ -3005,12 +3081,12 @@ input BuildCacheKeyIn { `, BuiltIn: false}, {Name: "../struct-to-graphql/buildrun.graphqls", Input: `type BuildRun @shareable { accountName: String! - apiVersion: String! + apiVersion: String buildName: String! clusterName: String! creationTime: Date! id: String! - kind: String! + kind: String markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") recordVersion: Int! @@ -3126,11 +3202,22 @@ type Github__com___kloudlite___operator___apis___distribution___v1__Resource @sh } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -3139,6 +3226,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -3218,17 +3306,31 @@ input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn } input Github__com___kloudlite___operator___pkg___operator__CheckIn { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +input Github__com___kloudlite___operator___pkg___operator__CheckMetaIn { + description: String + name: String! + title: String! +} + input Github__com___kloudlite___operator___pkg___operator__ResourceRefIn { + apiVersion: String! + kind: String! name: String! namespace: String! } input Github__com___kloudlite___operator___pkg___operator__StatusIn { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMetaIn!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -3288,10 +3390,16 @@ enum Github__com___kloudlite___api___pkg___types__SyncState { ERRORED_AT_AGENT IDLE IN_QUEUE - RECEIVED_UPDATE_FROM_AGENT UPDATED_AT_AGENT } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + `, BuiltIn: false}, {Name: "../struct-to-graphql/credential.graphqls", Input: `type Credential @shareable { access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! @@ -6019,14 +6127,11 @@ func (ec *executionContext) _BuildRun_apiVersion(ctx context.Context, field grap 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) + return ec.marshalOString2string(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_BuildRun_apiVersion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -6239,14 +6344,11 @@ func (ec *executionContext) _BuildRun_kind(ctx context.Context, field graphql.Co 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) + return ec.marshalOString2string(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_BuildRun_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -6493,6 +6595,8 @@ func (ec *executionContext) fieldContext_BuildRun_status(ctx context.Context, fi IsResolver: true, 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": @@ -12266,6 +12370,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_debug(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.Debug, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_error(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.Error, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) if err != nil { @@ -12307,6 +12493,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_info(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.Info, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field) if err != nil { @@ -12348,6 +12575,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(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.StartedAt, 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.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(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.State, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgOperatorState) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___pkg___operator__State does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheck) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field) if err != nil { @@ -12392,6 +12701,135 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(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.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(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.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) if err != nil { @@ -12568,6 +13006,55 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(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.CheckList, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + case "title": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__CheckMeta", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorStatus) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) if err != nil { @@ -20844,13 +21331,29 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p asMap[k] = v } - fieldsInOrder := [...]string{"generation", "message", "status"} + fieldsInOrder := [...]string{"debug", "error", "generation", "info", "message", "startedAt", "state", "status"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { + case "debug": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("debug")) + it.Debug, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "error": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("error")) + it.Error, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } case "generation": var err error @@ -20859,6 +21362,14 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p if err != nil { return it, err } + case "info": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("info")) + it.Info, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } case "message": var err error @@ -20867,6 +21378,22 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p if err != nil { return it, err } + case "startedAt": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("startedAt")) + it.StartedAt, err = ec.unmarshalODate2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "state": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("state")) + it.State, err = ec.unmarshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx, v) + if err != nil { + return it, err + } case "status": var err error @@ -20881,6 +21408,50 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p return it, nil } +func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgOperatorCheckMetaIn, error) { + var it model.GithubComKloudliteOperatorPkgOperatorCheckMetaIn + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"description", "name", "title"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "description": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) + it.Description, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "title": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + it.Title, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___pkg___operator__ResourceRefIn(ctx context.Context, obj interface{}) (model.GithubComKloudliteOperatorPkgOperatorResourceRefIn, error) { var it model.GithubComKloudliteOperatorPkgOperatorResourceRefIn asMap := map[string]interface{}{} @@ -20888,13 +21459,29 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p asMap[k] = v } - fieldsInOrder := [...]string{"name", "namespace"} + fieldsInOrder := [...]string{"apiVersion", "kind", "name", "namespace"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { + case "apiVersion": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("apiVersion")) + it.APIVersion, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "kind": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + it.Kind, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } case "name": var err error @@ -20924,13 +21511,21 @@ func (ec *executionContext) unmarshalInputGithub__com___kloudlite___operator___p asMap[k] = v } - fieldsInOrder := [...]string{"checks", "isReady", "lastReadyGeneration", "lastReconcileTime", "message", "resources"} + fieldsInOrder := [...]string{"checkList", "checks", "isReady", "lastReadyGeneration", "lastReconcileTime", "message", "resources"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { + case "checkList": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("checkList")) + it.CheckList, err = ec.unmarshalOGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaInᚄ(ctx, v) + if err != nil { + return it, err + } case "checks": var err error @@ -21864,9 +22459,6 @@ func (ec *executionContext) _BuildRun(ctx context.Context, sel ast.SelectionSet, out.Values[i] = ec._BuildRun_apiVersion(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } case "buildName": out.Values[i] = ec._BuildRun_buildName(ctx, field, obj) @@ -21925,9 +22517,6 @@ func (ec *executionContext) _BuildRun(ctx context.Context, sel ast.SelectionSet, out.Values[i] = ec._BuildRun_kind(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } case "markedForDeletion": out.Values[i] = ec._BuildRun_markedForDeletion(ctx, field, obj) @@ -23430,14 +24019,34 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "debug": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx, field, obj) + + case "error": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_error(ctx, field, obj) + case "generation": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) + case "info": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_info(ctx, field, obj) + case "message": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) + case "startedAt": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx, field, obj) + + case "state": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_state(ctx, field, obj) + case "status": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) @@ -23456,6 +24065,45 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator return out } +var github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__CheckMeta"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__CheckMeta") + case "description": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "title": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var github__com___kloudlite___operator___pkg___operator__ResourceRefImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__ResourceRef"} func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { @@ -23515,6 +24163,10 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checkList": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field, obj) + case "checks": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field, obj) @@ -25832,6 +26484,21 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaIn(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgOperatorCheckMetaIn, error) { + res, err := ec.unmarshalInputGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRef(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -26348,7 +27015,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -26356,7 +27023,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -26670,6 +27337,73 @@ func (ec *executionContext) marshalOGithub__com___kloudlite___operator___apis___ return ec._Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec(ctx, sel, v) } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaInᚄ(ctx context.Context, v interface{}) ([]*model.GithubComKloudliteOperatorPkgOperatorCheckMetaIn, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*model.GithubComKloudliteOperatorPkgOperatorCheckMetaIn, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNGithub__com___kloudlite___operator___pkg___operator__CheckMetaIn2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaIn(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorResourceRef) graphql.Marshaler { if v == nil { return graphql.Null @@ -26737,6 +27471,22 @@ func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg__ return res, nil } +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgOperatorState, error) { + if v == nil { + return nil, nil + } + var res = new(model.GithubComKloudliteOperatorPkgOperatorState) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorState) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋcontainerᚑregistryᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorStatus(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorStatus) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/apps/container-registry/internal/app/graph/model/models_gen.go b/apps/container-registry/internal/app/graph/model/models_gen.go index ff47a7655..9ba5c1af1 100644 --- a/apps/container-registry/internal/app/graph/model/models_gen.go +++ b/apps/container-registry/internal/app/graph/model/models_gen.go @@ -208,15 +208,37 @@ type GithubComKloudliteOperatorApisDistributionV1ResourceIn struct { } type GithubComKloudliteOperatorPkgOperatorCheck struct { - Generation *int `json:"generation,omitempty"` - Message *string `json:"message,omitempty"` - Status bool `json:"status"` + Debug *string `json:"debug,omitempty"` + Error *string `json:"error,omitempty"` + Generation *int `json:"generation,omitempty"` + Info *string `json:"info,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + State *GithubComKloudliteOperatorPkgOperatorState `json:"state,omitempty"` + Status bool `json:"status"` } type GithubComKloudliteOperatorPkgOperatorCheckIn struct { - Generation *int `json:"generation,omitempty"` - Message *string `json:"message,omitempty"` - Status bool `json:"status"` + Debug *string `json:"debug,omitempty"` + Error *string `json:"error,omitempty"` + Generation *int `json:"generation,omitempty"` + Info *string `json:"info,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt *string `json:"startedAt,omitempty"` + State *GithubComKloudliteOperatorPkgOperatorState `json:"state,omitempty"` + Status bool `json:"status"` +} + +type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Title string `json:"title"` +} + +type GithubComKloudliteOperatorPkgOperatorCheckMetaIn struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Title string `json:"title"` } type GithubComKloudliteOperatorPkgOperatorResourceRef struct { @@ -227,11 +249,14 @@ type GithubComKloudliteOperatorPkgOperatorResourceRef struct { } type GithubComKloudliteOperatorPkgOperatorResourceRefIn struct { - Name string `json:"name"` - Namespace string `json:"namespace"` + APIVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Name string `json:"name"` + Namespace string `json:"namespace"` } type GithubComKloudliteOperatorPkgOperatorStatus struct { + CheckList []*GithubComKloudliteOperatorPkgOperatorCheckMeta `json:"checkList,omitempty"` Checks map[string]interface{} `json:"checks,omitempty"` IsReady bool `json:"isReady"` LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` @@ -241,6 +266,7 @@ type GithubComKloudliteOperatorPkgOperatorStatus struct { } type GithubComKloudliteOperatorPkgOperatorStatusIn struct { + CheckList []*GithubComKloudliteOperatorPkgOperatorCheckMetaIn `json:"checkList,omitempty"` Checks map[string]interface{} `json:"checks,omitempty"` IsReady bool `json:"isReady"` LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` @@ -530,14 +556,13 @@ func (e GithubComKloudliteAPIPkgTypesSyncAction) MarshalGQL(w io.Writer) { type GithubComKloudliteAPIPkgTypesSyncState string const ( - GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "APPLIED_AT_AGENT" - GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETED_AT_AGENT" - GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETING_AT_AGENT" - GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent GithubComKloudliteAPIPkgTypesSyncState = "ERRORED_AT_AGENT" - GithubComKloudliteAPIPkgTypesSyncStateIDLe GithubComKloudliteAPIPkgTypesSyncState = "IDLE" - GithubComKloudliteAPIPkgTypesSyncStateInQueue GithubComKloudliteAPIPkgTypesSyncState = "IN_QUEUE" - GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent GithubComKloudliteAPIPkgTypesSyncState = "RECEIVED_UPDATE_FROM_AGENT" - GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "UPDATED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "APPLIED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent GithubComKloudliteAPIPkgTypesSyncState = "DELETING_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent GithubComKloudliteAPIPkgTypesSyncState = "ERRORED_AT_AGENT" + GithubComKloudliteAPIPkgTypesSyncStateIDLe GithubComKloudliteAPIPkgTypesSyncState = "IDLE" + GithubComKloudliteAPIPkgTypesSyncStateInQueue GithubComKloudliteAPIPkgTypesSyncState = "IN_QUEUE" + GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent GithubComKloudliteAPIPkgTypesSyncState = "UPDATED_AT_AGENT" ) var AllGithubComKloudliteAPIPkgTypesSyncState = []GithubComKloudliteAPIPkgTypesSyncState{ @@ -547,13 +572,12 @@ var AllGithubComKloudliteAPIPkgTypesSyncState = []GithubComKloudliteAPIPkgTypesS GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent, GithubComKloudliteAPIPkgTypesSyncStateIDLe, GithubComKloudliteAPIPkgTypesSyncStateInQueue, - GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent, GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent, } func (e GithubComKloudliteAPIPkgTypesSyncState) IsValid() bool { switch e { - case GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent, GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent, GithubComKloudliteAPIPkgTypesSyncStateIDLe, GithubComKloudliteAPIPkgTypesSyncStateInQueue, GithubComKloudliteAPIPkgTypesSyncStateReceivedUpdateFromAgent, GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent: + case GithubComKloudliteAPIPkgTypesSyncStateAppliedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletedAtAgent, GithubComKloudliteAPIPkgTypesSyncStateDeletingAtAgent, GithubComKloudliteAPIPkgTypesSyncStateErroredAtAgent, GithubComKloudliteAPIPkgTypesSyncStateIDLe, GithubComKloudliteAPIPkgTypesSyncStateInQueue, GithubComKloudliteAPIPkgTypesSyncStateUpdatedAtAgent: return true } return false @@ -579,3 +603,48 @@ func (e *GithubComKloudliteAPIPkgTypesSyncState) UnmarshalGQL(v interface{}) err func (e GithubComKloudliteAPIPkgTypesSyncState) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } + +type GithubComKloudliteOperatorPkgOperatorState string + +const ( + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation GithubComKloudliteOperatorPkgOperatorState = "errored____during____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation GithubComKloudliteOperatorPkgOperatorState = "finished____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation GithubComKloudliteOperatorPkgOperatorState = "under____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled GithubComKloudliteOperatorPkgOperatorState = "yet____to____be____reconciled" +) + +var AllGithubComKloudliteOperatorPkgOperatorState = []GithubComKloudliteOperatorPkgOperatorState{ + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled, +} + +func (e GithubComKloudliteOperatorPkgOperatorState) IsValid() bool { + switch e { + case GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled: + return true + } + return false +} + +func (e GithubComKloudliteOperatorPkgOperatorState) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorPkgOperatorState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorPkgOperatorState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___pkg___operator__State", str) + } + return nil +} + +func (e GithubComKloudliteOperatorPkgOperatorState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls index f9b4d61f4..cd206d0eb 100644 --- a/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/buildrun.graphqls @@ -1,11 +1,11 @@ type BuildRun @shareable { accountName: String! - apiVersion: String! + apiVersion: String buildName: String! clusterName: String! creationTime: Date! id: String! - kind: String! + kind: String markedForDeletion: Boolean metadata: Metadata @goField(name: "objectMeta") recordVersion: Int! diff --git a/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls index 4d6db420e..c7f03154c 100644 --- a/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/container-registry/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -92,11 +92,22 @@ type Github__com___kloudlite___operator___apis___distribution___v1__Resource @sh } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -105,6 +116,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -184,17 +196,31 @@ input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn } input Github__com___kloudlite___operator___pkg___operator__CheckIn { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +input Github__com___kloudlite___operator___pkg___operator__CheckMetaIn { + description: String + name: String! + title: String! +} + input Github__com___kloudlite___operator___pkg___operator__ResourceRefIn { + apiVersion: String! + kind: String! name: String! namespace: String! } input Github__com___kloudlite___operator___pkg___operator__StatusIn { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMetaIn!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -254,7 +280,13 @@ enum Github__com___kloudlite___api___pkg___types__SyncState { ERRORED_AT_AGENT IDLE IN_QUEUE - RECEIVED_UPDATE_FROM_AGENT UPDATED_AT_AGENT } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + diff --git a/apps/infra/internal/app/graph/common-types.resolvers.go b/apps/infra/internal/app/graph/common-types.resolvers.go index a3ac74a7c..4588c622d 100644 --- a/apps/infra/internal/app/graph/common-types.resolvers.go +++ b/apps/infra/internal/app/graph/common-types.resolvers.go @@ -88,6 +88,34 @@ func (r *github__com___kloudlite___api___pkg___types__SyncStatusResolver) SyncSc return fn.New(obj.SyncScheduledAt.Format(time.RFC3339)), nil } +// StartedAt is the resolver for the startedAt field. +func (r *github__com___kloudlite___operator___pkg___operator__CheckResolver) StartedAt(ctx context.Context, obj *operator.Check) (*string, error) { + if obj == nil { + return nil, errors.Newf("check is nil") + } + + if obj.StartedAt == nil { + return nil, nil + } + + sa := obj.StartedAt.Format(time.RFC3339) + return &sa, nil +} + +// State is the resolver for the state field. +func (r *github__com___kloudlite___operator___pkg___operator__CheckResolver) State(ctx context.Context, obj *operator.Check) (*model.GithubComKloudliteOperatorPkgOperatorState, error) { + if obj == nil { + return nil, errors.Newf("check is nil") + } + + return fn.JsonConvert[*model.GithubComKloudliteOperatorPkgOperatorState](obj.State) +} + +// CheckList is the resolver for the checkList field. +func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) CheckList(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta, error) { + return fn.JsonConvert[[]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta](obj.CheckList) +} + // Checks is the resolver for the checks field. func (r *github__com___kloudlite___operator___pkg___operator__StatusResolver) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) { var m map[string]any @@ -195,6 +223,11 @@ func (r *Resolver) Github__com___kloudlite___api___pkg___types__SyncStatus() gen return &github__com___kloudlite___api___pkg___types__SyncStatusResolver{r} } +// Github__com___kloudlite___operator___pkg___operator__Check returns generated.Github__com___kloudlite___operator___pkg___operator__CheckResolver implementation. +func (r *Resolver) Github__com___kloudlite___operator___pkg___operator__Check() generated.Github__com___kloudlite___operator___pkg___operator__CheckResolver { + return &github__com___kloudlite___operator___pkg___operator__CheckResolver{r} +} + // Github__com___kloudlite___operator___pkg___operator__Status returns generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver implementation. func (r *Resolver) Github__com___kloudlite___operator___pkg___operator__Status() generated.Github__com___kloudlite___operator___pkg___operator__StatusResolver { return &github__com___kloudlite___operator___pkg___operator__StatusResolver{r} @@ -209,6 +242,7 @@ func (r *Resolver) MetadataIn() generated.MetadataInResolver { return &metadataI type github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver struct{ *Resolver } type github__com___kloudlite___api___common__CreatedOrUpdatedByResolver struct{ *Resolver } type github__com___kloudlite___api___pkg___types__SyncStatusResolver struct{ *Resolver } +type github__com___kloudlite___operator___pkg___operator__CheckResolver struct{ *Resolver } type github__com___kloudlite___operator___pkg___operator__StatusResolver struct{ *Resolver } type metadataResolver struct{ *Resolver } type metadataInResolver struct{ *Resolver } diff --git a/apps/infra/internal/app/graph/generated/generated.go b/apps/infra/internal/app/graph/generated/generated.go index f43cc5dc2..4b9c80279 100644 --- a/apps/infra/internal/app/graph/generated/generated.go +++ b/apps/infra/internal/app/graph/generated/generated.go @@ -51,6 +51,7 @@ type ResolverRoot interface { Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntry() Github__com___kloudlite___api___apps___infra___internal___entities__MsvcTemplateEntryResolver Github__com___kloudlite___api___common__CreatedOrUpdatedBy() Github__com___kloudlite___api___common__CreatedOrUpdatedByResolver Github__com___kloudlite___api___pkg___types__SyncStatus() Github__com___kloudlite___api___pkg___types__SyncStatusResolver + Github__com___kloudlite___operator___pkg___operator__Check() Github__com___kloudlite___operator___pkg___operator__CheckResolver Github__com___kloudlite___operator___pkg___operator__Status() Github__com___kloudlite___operator___pkg___operator__StatusResolver HelmRelease() HelmReleaseResolver Metadata() MetadataResolver @@ -442,6 +443,7 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus struct { + CheckList func(childComplexity int) int Checks func(childComplexity int) int IsReady func(childComplexity int) int LastReadyGeneration func(childComplexity int) int @@ -472,11 +474,22 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Check struct { + Debug func(childComplexity int) int + Error func(childComplexity int) int Generation func(childComplexity int) int + Info func(childComplexity int) int Message func(childComplexity int) int + StartedAt func(childComplexity int) int + State func(childComplexity int) int Status func(childComplexity int) int } + Github__com___kloudlite___operator___pkg___operator__CheckMeta struct { + Description func(childComplexity int) int + Name func(childComplexity int) int + Title func(childComplexity int) int + } + Github__com___kloudlite___operator___pkg___operator__ResourceRef struct { APIVersion func(childComplexity int) int Kind func(childComplexity int) int @@ -485,6 +498,7 @@ type ComplexityRoot struct { } Github__com___kloudlite___operator___pkg___operator__Status struct { + CheckList func(childComplexity int) int Checks func(childComplexity int) int IsReady func(childComplexity int) int LastReadyGeneration func(childComplexity int) int @@ -1250,7 +1264,12 @@ type Github__com___kloudlite___api___pkg___types__SyncStatusResolver interface { SyncScheduledAt(ctx context.Context, obj *types.SyncStatus) (*string, error) } +type Github__com___kloudlite___operator___pkg___operator__CheckResolver interface { + StartedAt(ctx context.Context, obj *operator.Check) (*string, error) + State(ctx context.Context, obj *operator.Check) (*model.GithubComKloudliteOperatorPkgOperatorState, error) +} type Github__com___kloudlite___operator___pkg___operator__StatusResolver interface { + CheckList(ctx context.Context, obj *operator.Status) ([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta, error) Checks(ctx context.Context, obj *operator.Status) (map[string]interface{}, error) LastReconcileTime(ctx context.Context, obj *operator.Status) (*string, error) @@ -3039,6 +3058,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec.Values(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.checkList": + if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.CheckList == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.CheckList(childComplexity), true + case "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.checks": if e.complexity.Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus.Checks == nil { break @@ -3165,6 +3191,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate.Spec(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.debug": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Debug(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.error": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Error(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.generation": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation == nil { break @@ -3172,6 +3212,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Generation(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.info": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Info(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.message": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message == nil { break @@ -3179,6 +3226,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Message(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.startedAt": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.StartedAt(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__Check.state": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.State(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Check.status": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status == nil { break @@ -3186,6 +3247,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__Check.Status(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.description": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Description(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.name": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Name(childComplexity), true + + case "Github__com___kloudlite___operator___pkg___operator__CheckMeta.title": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__CheckMeta.Title(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__ResourceRef.apiVersion": if e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.APIVersion == nil { break @@ -3214,6 +3296,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Github__com___kloudlite___operator___pkg___operator__ResourceRef.Namespace(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checkList": + if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList == nil { + break + } + + return e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.CheckList(childComplexity), true + case "Github__com___kloudlite___operator___pkg___operator__Status.checks": if e.complexity.Github__com___kloudlite___operator___pkg___operator__Status.Checks == nil { break @@ -7286,6 +7375,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec @share } type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -7316,11 +7406,22 @@ type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @sha } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -7329,6 +7430,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -8332,6 +8434,13 @@ enum Github__com___kloudlite___operator___apis___common____types__CloudProvider gcp } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + enum K8s__io___api___core___v1__ConditionStatus { False True @@ -11457,6 +11566,8 @@ func (ec *executionContext) fieldContext_Cluster_status(ctx context.Context, fie 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": @@ -12378,6 +12489,8 @@ func (ec *executionContext) fieldContext_ClusterManagedService_status(ctx contex 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": @@ -20333,6 +20446,55 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checkList(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checkList(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.CheckList, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checkList(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + case "title": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__CheckMeta", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorApisCrdsV1HelmChartStatus) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field) if err != nil { @@ -21146,6 +21308,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___ap return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_debug(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.Debug, 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_Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_error(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.Error, 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_Github__com___kloudlite___operator___pkg___operator__Check_error(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field) if err != nil { @@ -21187,6 +21431,47 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_info(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.Info, 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_Github__com___kloudlite___operator___pkg___operator__Check_info(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_message(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field) if err != nil { @@ -21228,6 +21513,88 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(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.Github__com___kloudlite___operator___pkg___operator__Check().StartedAt(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalODate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + 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) _Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(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.Github__com___kloudlite___operator___pkg___operator__Check().State(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.GithubComKloudliteOperatorPkgOperatorState) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_state(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Check", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Github__com___kloudlite___operator___pkg___operator__State does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Check_status(ctx context.Context, field graphql.CollectedField, obj *operator.Check) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field) if err != nil { @@ -21272,6 +21639,135 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(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.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(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.Title, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__CheckMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx context.Context, field graphql.CollectedField, obj *operator.ResourceRef) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__ResourceRef_apiVersion(ctx, field) if err != nil { @@ -21448,6 +21944,55 @@ func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pk return fc, nil } +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(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.Github__com___kloudlite___operator___pkg___operator__Status().CheckList(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) + fc.Result = res + return ec.marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Github__com___kloudlite___operator___pkg___operator__Status", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field) + case "name": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field) + case "title": + return ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Github__com___kloudlite___operator___pkg___operator__CheckMeta", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx context.Context, field graphql.CollectedField, obj *operator.Status) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Github__com___kloudlite___operator___pkg___operator__Status_checks(ctx, field) if err != nil { @@ -22399,6 +22944,8 @@ func (ec *executionContext) fieldContext_HelmRelease_status(ctx context.Context, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { + case "checkList": + return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checkList(ctx, field) case "checks": return ec.fieldContext_Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field) case "isReady": @@ -37580,6 +38127,8 @@ func (ec *executionContext) fieldContext_Node_status(ctx context.Context, field 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": @@ -38607,6 +39156,8 @@ func (ec *executionContext) fieldContext_NodePool_status(ctx context.Context, fi 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": @@ -54202,6 +54753,10 @@ func (ec *executionContext) _Github__com___kloudlite___operator___apis___crds___ switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus") + case "checkList": + + out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checkList(ctx, field, obj) + case "checks": out.Values[i] = ec._Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus_checks(ctx, field, obj) @@ -54379,18 +54934,103 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Check") + case "debug": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_debug(ctx, field, obj) + + case "error": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_error(ctx, field, obj) + case "generation": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_generation(ctx, field, obj) + case "info": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_info(ctx, field, obj) + case "message": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_message(ctx, field, obj) + case "startedAt": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Check_startedAt(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "state": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Check_state(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "status": out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__Check_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors = []string{"Github__com___kloudlite___operator___pkg___operator__CheckMeta"} + +func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___pkg___operator__CheckMetaImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__CheckMeta") + case "description": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_description(ctx, field, obj) + + case "name": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "title": + + out.Values[i] = ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta_title(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -54464,6 +55104,23 @@ func (ec *executionContext) _Github__com___kloudlite___operator___pkg___operator switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___pkg___operator__Status") + case "checkList": + field := field + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Github__com___kloudlite___operator___pkg___operator__Status_checkList(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) case "checks": field := field @@ -60749,6 +61406,16 @@ func (ec *executionContext) unmarshalNGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Github__com___kloudlite___operator___pkg___operator__CheckMeta(ctx, sel, v) +} + func (ec *executionContext) marshalNGithub__com___kloudlite___operator___pkg___operator__ResourceRef2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRef(ctx context.Context, sel ast.SelectionSet, v operator.ResourceRef) graphql.Marshaler { return ec._Github__com___kloudlite___operator___pkg___operator__ResourceRef(ctx, sel, &v) } @@ -61992,7 +62659,7 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (interface{}, error) { +func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v interface{}) (any, error) { if v == nil { return nil, nil } @@ -62000,7 +62667,7 @@ func (ec *executionContext) unmarshalOAny2interface(ctx context.Context, v inter return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { +func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.SelectionSet, v any) graphql.Marshaler { if v == nil { return graphql.Null } @@ -62408,6 +63075,53 @@ func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___apis_ return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚕᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMetaᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.GithubComKloudliteOperatorPkgOperatorCheckMeta) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNGithub__com___kloudlite___operator___pkg___operator__CheckMeta2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorCheckMeta(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) marshalOGithub__com___kloudlite___operator___pkg___operator__ResourceRef2ᚕgithubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐResourceRefᚄ(ctx context.Context, sel ast.SelectionSet, v []operator.ResourceRef) graphql.Marshaler { if v == nil { return graphql.Null @@ -62502,6 +63216,22 @@ func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___o return ret } +func (ec *executionContext) unmarshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, v interface{}) (*model.GithubComKloudliteOperatorPkgOperatorState, error) { + if v == nil { + return nil, nil + } + var res = new(model.GithubComKloudliteOperatorPkgOperatorState) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__State2ᚖgithubᚗcomᚋkloudliteᚋapiᚋappsᚋinfraᚋinternalᚋappᚋgraphᚋmodelᚐGithubComKloudliteOperatorPkgOperatorState(ctx context.Context, sel ast.SelectionSet, v *model.GithubComKloudliteOperatorPkgOperatorState) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return v +} + func (ec *executionContext) marshalOGithub__com___kloudlite___operator___pkg___operator__Status2githubᚗcomᚋkloudliteᚋoperatorᚋpkgᚋoperatorᚐStatus(ctx context.Context, sel ast.SelectionSet, v operator.Status) graphql.Marshaler { return ec._Github__com___kloudlite___operator___pkg___operator__Status(ctx, sel, &v) } diff --git a/apps/infra/internal/app/graph/model/models_gen.go b/apps/infra/internal/app/graph/model/models_gen.go index 0a68ca798..a911f2684 100644 --- a/apps/infra/internal/app/graph/model/models_gen.go +++ b/apps/infra/internal/app/graph/model/models_gen.go @@ -362,14 +362,15 @@ type GithubComKloudliteOperatorApisCrdsV1HelmChartSpecIn struct { } type GithubComKloudliteOperatorApisCrdsV1HelmChartStatus struct { - Checks map[string]interface{} `json:"checks,omitempty"` - IsReady bool `json:"isReady"` - LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` - LastReconcileTime *string `json:"lastReconcileTime,omitempty"` - Message *GithubComKloudliteOperatorPkgRawJSONRawJSON `json:"message,omitempty"` - ReleaseNotes string `json:"releaseNotes"` - ReleaseStatus string `json:"releaseStatus"` - Resources []*operator.ResourceRef `json:"resources,omitempty"` + CheckList []*GithubComKloudliteOperatorPkgOperatorCheckMeta `json:"checkList,omitempty"` + Checks map[string]interface{} `json:"checks,omitempty"` + IsReady bool `json:"isReady"` + LastReadyGeneration *int `json:"lastReadyGeneration,omitempty"` + LastReconcileTime *string `json:"lastReconcileTime,omitempty"` + Message *GithubComKloudliteOperatorPkgRawJSONRawJSON `json:"message,omitempty"` + ReleaseNotes string `json:"releaseNotes"` + ReleaseStatus string `json:"releaseStatus"` + Resources []*operator.ResourceRef `json:"resources,omitempty"` } type GithubComKloudliteOperatorApisCrdsV1JobVars struct { @@ -410,6 +411,12 @@ type GithubComKloudliteOperatorApisCrdsV1ServiceTemplateIn struct { Spec map[string]interface{} `json:"spec"` } +type GithubComKloudliteOperatorPkgOperatorCheckMeta struct { + Description *string `json:"description,omitempty"` + Name string `json:"name"` + Title string `json:"title"` +} + type GithubComKloudliteOperatorPkgRawJSONRawJSON struct { RawMessage interface{} `json:"RawMessage,omitempty"` } @@ -1499,6 +1506,51 @@ func (e GithubComKloudliteOperatorApisCommonTypesCloudProvider) MarshalGQL(w io. fmt.Fprint(w, strconv.Quote(e.String())) } +type GithubComKloudliteOperatorPkgOperatorState string + +const ( + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation GithubComKloudliteOperatorPkgOperatorState = "errored____during____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation GithubComKloudliteOperatorPkgOperatorState = "finished____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation GithubComKloudliteOperatorPkgOperatorState = "under____reconcilation" + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled GithubComKloudliteOperatorPkgOperatorState = "yet____to____be____reconciled" +) + +var AllGithubComKloudliteOperatorPkgOperatorState = []GithubComKloudliteOperatorPkgOperatorState{ + GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, + GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, + GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, + GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled, +} + +func (e GithubComKloudliteOperatorPkgOperatorState) IsValid() bool { + switch e { + case GithubComKloudliteOperatorPkgOperatorStateErroredDuringReconcilation, GithubComKloudliteOperatorPkgOperatorStateFinishedReconcilation, GithubComKloudliteOperatorPkgOperatorStateUnderReconcilation, GithubComKloudliteOperatorPkgOperatorStateYetToBeReconciled: + return true + } + return false +} + +func (e GithubComKloudliteOperatorPkgOperatorState) String() string { + return string(e) +} + +func (e *GithubComKloudliteOperatorPkgOperatorState) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = GithubComKloudliteOperatorPkgOperatorState(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid Github__com___kloudlite___operator___pkg___operator__State", str) + } + return nil +} + +func (e GithubComKloudliteOperatorPkgOperatorState) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type K8sIoAPICoreV1ConditionStatus string const ( diff --git a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls index 5a4064e6f..b8a1951e7 100644 --- a/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls +++ b/apps/infra/internal/app/graph/struct-to-graphql/common-types.graphqls @@ -225,6 +225,7 @@ type Github__com___kloudlite___operator___apis___crds___v1__HelmChartSpec @share } type Github__com___kloudlite___operator___apis___crds___v1__HelmChartStatus @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -255,11 +256,22 @@ type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate @sha } type Github__com___kloudlite___operator___pkg___operator__Check @shareable { + debug: String + error: String generation: Int + info: String message: String + startedAt: Date + state: Github__com___kloudlite___operator___pkg___operator__State status: Boolean! } +type Github__com___kloudlite___operator___pkg___operator__CheckMeta @shareable { + description: String + name: String! + title: String! +} + type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable { apiVersion: String! kind: String! @@ -268,6 +280,7 @@ type Github__com___kloudlite___operator___pkg___operator__ResourceRef @shareable } type Github__com___kloudlite___operator___pkg___operator__Status @shareable { + checkList: [Github__com___kloudlite___operator___pkg___operator__CheckMeta!] checks: Map isReady: Boolean! lastReadyGeneration: Int @@ -1271,6 +1284,13 @@ enum Github__com___kloudlite___operator___apis___common____types__CloudProvider gcp } +enum Github__com___kloudlite___operator___pkg___operator__State { + errored____during____reconcilation + finished____reconcilation + under____reconcilation + yet____to____be____reconciled +} + enum K8s__io___api___core___v1__ConditionStatus { False True diff --git a/apps/infra/internal/entities/field-constants/generated_constants.go b/apps/infra/internal/entities/field-constants/generated_constants.go index 616b03b81..d967e4cf1 100644 --- a/apps/infra/internal/entities/field-constants/generated_constants.go +++ b/apps/infra/internal/entities/field-constants/generated_constants.go @@ -684,6 +684,7 @@ const ( StatusAttached = "status.attached" StatusAttachmentMetadata = "status.attachmentMetadata" StatusCapacity = "status.capacity" + StatusCheckList = "status.checkList" StatusChecks = "status.checks" StatusConditions = "status.conditions" StatusDetachError = "status.detachError" diff --git a/go.mod b/go.mod index 6ee49df15..c3b3febed 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( require ( github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 - github.com/kloudlite/operator v1.0.4-0.20240305112630-9048b76e9997 + github.com/kloudlite/operator v1.0.4-0.20240308095549-4095d51d810a github.com/nats-io/nats.go v1.31.0 github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 diff --git a/go.sum b/go.sum index a7dfde213..053795b04 100644 --- a/go.sum +++ b/go.sum @@ -162,8 +162,8 @@ github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJw github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55 h1:YnZh3TL6AG4EfoInx1/L5zcPHd2QxgLKseJB1KtHjdQ= github.com/kloudlite/container-registry-authorizer v0.0.0-20231021122509-161dc30fde55/go.mod h1:GZj3wZmIw/qCciclRhgQTgmGiqe8wxoVzMXQjbOfnbc= -github.com/kloudlite/operator v1.0.4-0.20240305112630-9048b76e9997 h1:O2+MX8Fah90KzFLly7gf25CD1Euob3WIz14mBHWLjCM= -github.com/kloudlite/operator v1.0.4-0.20240305112630-9048b76e9997/go.mod h1:kMXogvCB4qSG56WlJ5lhyL6JVeVLJ+IyyE18g/1FF1I= +github.com/kloudlite/operator v1.0.4-0.20240308095549-4095d51d810a h1:dxMWxaDJhEkZcnIzXH/eLQU2+OHHw/bmGeDiuFKukDU= +github.com/kloudlite/operator v1.0.4-0.20240308095549-4095d51d810a/go.mod h1:kMXogvCB4qSG56WlJ5lhyL6JVeVLJ+IyyE18g/1FF1I= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=