From 846e016168666d4b15420d80203e6d31bf94cca7 Mon Sep 17 00:00:00 2001 From: Piyush Singariya Date: Fri, 25 Mar 2022 19:35:08 +0530 Subject: [PATCH 01/50] getOAMComponents Graphql Signed-off-by: Piyush Singariya --- internal/graphql/generated/generated.go | 2783 +++++++++++++---- internal/graphql/model/models_gen.go | 9 + internal/graphql/resolver/error.go | 11 + internal/graphql/resolver/kubernetes.go | 162 + internal/graphql/resolver/schema.resolvers.go | 12 + internal/graphql/schema/schema.graphql | 581 ++-- 6 files changed, 2640 insertions(+), 918 deletions(-) diff --git a/internal/graphql/generated/generated.go b/internal/graphql/generated/generated.go index 553bb8a3161..410a556f0a7 100644 --- a/internal/graphql/generated/generated.go +++ b/internal/graphql/generated/generated.go @@ -60,13 +60,13 @@ type ComplexityRoot struct { Status func(childComplexity int) int } - ContainerPort struct { + Container_Port struct { ContainerPort func(childComplexity int) int Name func(childComplexity int) int Protocol func(childComplexity int) int } - ContainerStatus struct { + Container_Status struct { ContainerID func(childComplexity int) int ContainerStatusName func(childComplexity int) int Image func(childComplexity int) int @@ -125,6 +125,15 @@ type ComplexityRoot struct { Namespace func(childComplexity int) int } + OAMCapability struct { + Host func(childComplexity int) int + ID func(childComplexity int) int + Metadata func(childComplexity int) int + OamDefinition func(childComplexity int) int + OamRefSchema func(childComplexity int) int + Restricted func(childComplexity int) int + } + OperatorControllerStatus struct { Error func(childComplexity int) int Name func(childComplexity int) int @@ -214,6 +223,9 @@ type ComplexityRoot struct { GetOperatorStatus func(childComplexity int) int GetPerfResult func(childComplexity int, id string) int GetPerformanceProfiles func(childComplexity int, selector model.PageFilter) int + GetScopes func(childComplexity int, name *string, id *string, trim *bool) int + GetTraits func(childComplexity int, name *string, id *string, trim *bool) int + GetWorkloads func(childComplexity int, name *string, id *string, trim *bool) int ResyncCluster func(childComplexity int, selector *model.ReSyncActions) int } @@ -249,6 +261,9 @@ type QueryResolver interface { GetPerformanceProfiles(ctx context.Context, selector model.PageFilter) (*model.PerfPageProfiles, error) FetchAllResults(ctx context.Context, selector model.PageFilter) (*model.PerfPageResult, error) FetchPatterns(ctx context.Context, selector model.PageFilter) (*model.PatternPageResult, error) + GetWorkloads(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) + GetTraits(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) + GetScopes(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) } type SubscriptionResolver interface { ListenToAddonState(ctx context.Context, selector *model.MeshType) (<-chan []*model.AddonList, error) @@ -340,88 +355,88 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Container.Status(childComplexity), true case "Container_Port.containerPort": - if e.complexity.ContainerPort.ContainerPort == nil { + if e.complexity.Container_Port.ContainerPort == nil { break } - return e.complexity.ContainerPort.ContainerPort(childComplexity), true + return e.complexity.Container_Port.ContainerPort(childComplexity), true case "Container_Port.name": - if e.complexity.ContainerPort.Name == nil { + if e.complexity.Container_Port.Name == nil { break } - return e.complexity.ContainerPort.Name(childComplexity), true + return e.complexity.Container_Port.Name(childComplexity), true case "Container_Port.protocol": - if e.complexity.ContainerPort.Protocol == nil { + if e.complexity.Container_Port.Protocol == nil { break } - return e.complexity.ContainerPort.Protocol(childComplexity), true + return e.complexity.Container_Port.Protocol(childComplexity), true case "Container_Status.containerID": - if e.complexity.ContainerStatus.ContainerID == nil { + if e.complexity.Container_Status.ContainerID == nil { break } - return e.complexity.ContainerStatus.ContainerID(childComplexity), true + return e.complexity.Container_Status.ContainerID(childComplexity), true case "Container_Status.containerStatusName": - if e.complexity.ContainerStatus.ContainerStatusName == nil { + if e.complexity.Container_Status.ContainerStatusName == nil { break } - return e.complexity.ContainerStatus.ContainerStatusName(childComplexity), true + return e.complexity.Container_Status.ContainerStatusName(childComplexity), true case "Container_Status.image": - if e.complexity.ContainerStatus.Image == nil { + if e.complexity.Container_Status.Image == nil { break } - return e.complexity.ContainerStatus.Image(childComplexity), true + return e.complexity.Container_Status.Image(childComplexity), true case "Container_Status.imageID": - if e.complexity.ContainerStatus.ImageID == nil { + if e.complexity.Container_Status.ImageID == nil { break } - return e.complexity.ContainerStatus.ImageID(childComplexity), true + return e.complexity.Container_Status.ImageID(childComplexity), true case "Container_Status.lastState": - if e.complexity.ContainerStatus.LastState == nil { + if e.complexity.Container_Status.LastState == nil { break } - return e.complexity.ContainerStatus.LastState(childComplexity), true + return e.complexity.Container_Status.LastState(childComplexity), true case "Container_Status.ready": - if e.complexity.ContainerStatus.Ready == nil { + if e.complexity.Container_Status.Ready == nil { break } - return e.complexity.ContainerStatus.Ready(childComplexity), true + return e.complexity.Container_Status.Ready(childComplexity), true case "Container_Status.restartCount": - if e.complexity.ContainerStatus.RestartCount == nil { + if e.complexity.Container_Status.RestartCount == nil { break } - return e.complexity.ContainerStatus.RestartCount(childComplexity), true + return e.complexity.Container_Status.RestartCount(childComplexity), true case "Container_Status.started": - if e.complexity.ContainerStatus.Started == nil { + if e.complexity.Container_Status.Started == nil { break } - return e.complexity.ContainerStatus.Started(childComplexity), true + return e.complexity.Container_Status.Started(childComplexity), true case "Container_Status.state": - if e.complexity.ContainerStatus.State == nil { + if e.complexity.Container_Status.State == nil { break } - return e.complexity.ContainerStatus.State(childComplexity), true + return e.complexity.Container_Status.State(childComplexity), true case "ControlPlane.members": if e.complexity.ControlPlane.Members == nil { @@ -615,6 +630,48 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.NameSpace.Namespace(childComplexity), true + case "OAMCapability.host": + if e.complexity.OAMCapability.Host == nil { + break + } + + return e.complexity.OAMCapability.Host(childComplexity), true + + case "OAMCapability.id": + if e.complexity.OAMCapability.ID == nil { + break + } + + return e.complexity.OAMCapability.ID(childComplexity), true + + case "OAMCapability.metadata": + if e.complexity.OAMCapability.Metadata == nil { + break + } + + return e.complexity.OAMCapability.Metadata(childComplexity), true + + case "OAMCapability.oam_definition": + if e.complexity.OAMCapability.OamDefinition == nil { + break + } + + return e.complexity.OAMCapability.OamDefinition(childComplexity), true + + case "OAMCapability.oam_ref_schema": + if e.complexity.OAMCapability.OamRefSchema == nil { + break + } + + return e.complexity.OAMCapability.OamRefSchema(childComplexity), true + + case "OAMCapability.restricted": + if e.complexity.OAMCapability.Restricted == nil { + break + } + + return e.complexity.OAMCapability.Restricted(childComplexity), true + case "OperatorControllerStatus.error": if e.complexity.OperatorControllerStatus.Error == nil { break @@ -1103,6 +1160,42 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.GetPerformanceProfiles(childComplexity, args["selector"].(model.PageFilter)), true + case "Query.getScopes": + if e.complexity.Query.GetScopes == nil { + break + } + + args, err := ec.field_Query_getScopes_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetScopes(childComplexity, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)), true + + case "Query.getTraits": + if e.complexity.Query.GetTraits == nil { + break + } + + args, err := ec.field_Query_getTraits_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetTraits(childComplexity, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)), true + + case "Query.getWorkloads": + if e.complexity.Query.GetWorkloads == nil { + break + } + + args, err := ec.field_Query_getWorkloads_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetWorkloads(childComplexity, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)), true + case "Query.resyncCluster": if e.complexity.Query.ResyncCluster == nil { break @@ -1278,8 +1371,8 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "schema/schema.graphql", Input: `# We assume a few things about the schema. We use the graphql-ruby gem to generate docs, which enforces: - # - All mutations have a single input field named 'input' -# If these things change, then doc geneartion for GraphQL will break. +# - All mutations have a single input field named 'input' +# If these things change, then doc generation for GraphQL will break. # ================= COMMONS ========================= @@ -1289,444 +1382,441 @@ scalar Any # Service Mesh Types enum MeshType { + # All meshes that Meshery supports + ALL_MESH - # All meshes that Meshery supports - ALL_MESH + # Invalid Mesh + INVALID_MESH - # Invalid Mesh - INVALID_MESH + # AWS App Mesh + APP_MESH - # AWS App Mesh - APP_MESH + # Citrix Service Mesh + CITRIX_SERVICE_MESH - # Citrix Service Mesh - CITRIX_SERVICE_MESH + # Consul by HashiCorp + CONSUL - # Consul by HashiCorp - CONSUL + # Istio Service Mesh + ISTIO - # Istio Service Mesh - ISTIO + # Kuma + KUMA - # Kuma - KUMA + # LinkerD Service Mesh + LINKERD - # LinkerD Service Mesh - LINKERD + # Traefik Mesh + TRAEFIK_MESH - # Traefik Mesh - TRAEFIK_MESH + # Octarine Mesh + OCTARINE - # Octarine Mesh - OCTARINE + # Network Service Mesh + NETWORK_SERVICE_MESH - # Network Service Mesh - NETWORK_SERVICE_MESH + # VMware Tanzu Service Mesh + TANZU - # VMware Tanzu Service Mesh - TANZU + # Open Service Mesh + OPEN_SERVICE_MESH - # Open Service Mesh - OPEN_SERVICE_MESH - - # NGINX Service Mesh - NGINX_SERVICE_MESH + # NGINX Service Mesh + NGINX_SERVICE_MESH } enum Status { + # Enabled + ENABLED - # Enabled - ENABLED - - # Connected (Applicable only for NATS status for now) - CONNECTED + # Connected (Applicable only for NATS status for now) + CONNECTED - # Disabled - DISABLED + # Disabled + DISABLED - # Processing - PROCESSING + # Processing + PROCESSING - # Unknown - UNKNOWN + # Unknown + UNKNOWN } type Error { + # Error Code + code: String! - # Error Code - code: String! - - # Error Details - description: String! + # Error Details + description: String! } # =================== ADDONS ===================== # Input for changing Addon Status input AddonStatusInput { - - # Filter by Serice Mesh - selector: MeshType, + # Filter by Serice Mesh + selector: MeshType - # Desired Status - targetStatus: Status! + # Desired Status + targetStatus: Status! } # Deatils about the Addon Component type AddonList { + # Name + name: String! - # Name - name: String! - - # Owner - owner: String! + # Owner + owner: String! - # Endpoint (if applicable) - endpoint: String! + # Endpoint (if applicable) + endpoint: String! } - # ============== DATA PLANE ======================= # Data Plane for a particular Mesh type DataPlane { + # Service Mesh Name + name: String! - # Service Mesh Name - name: String! - - # Members of the Mesh - proxies: [Container!]! + # Members of the Mesh + proxies: [Container!]! } type Container { - controlPlaneMemberName: String! - containerName: String! - image: String! - status: Container_Status - # args: NOT IMPLEMENTED - ports: [Container_Port] - # env: NOT IMPLEMENTED, - resources: Any + controlPlaneMemberName: String! + containerName: String! + image: String! + status: Container_Status + # args: NOT IMPLEMENTED + ports: [Container_Port] + # env: NOT IMPLEMENTED, + resources: Any } type Container_Status { - containerStatusName: String! - image: String! - state: Any - lastState: Any - ready: Boolean! - restartCount: Any - # image: String! - # imageID: String! - # containerID: String! - started: Boolean! - imageID: Any - containerID: Any - + containerStatusName: String! + image: String! + state: Any + lastState: Any + ready: Boolean! + restartCount: Any + # image: String! + # imageID: String! + # containerID: String! + started: Boolean! + imageID: Any + containerID: Any } type Container_Port { - name: String - containerPort: Int! - protocol: String! - + name: String + containerPort: Int! + protocol: String! } # ============== CONTROL PLANE ======================= # Filter Control Plane Query input ServiceMeshFilter { - - # Filter by Service Mesh - type: MeshType + # Filter by Service Mesh + type: MeshType } # Control Plane data for a particular Mesh type ControlPlane { + # Service Mesh Name + name: String! - # Service Mesh Name - name: String! - - # Members of the Mesh - members: [ControlPlaneMember!]! + # Members of the Mesh + members: [ControlPlaneMember!]! } # Member Details type ControlPlaneMember { + # Name + name: String! - # Name - name: String! + # Component + component: String! - # Component - component: String! + # Version + version: String! - # Version - version: String! + # Namespace + namespace: String! - # Namespace - namespace: String! - - # DataPlanes - data_planes: [Container!] + # DataPlanes + data_planes: [Container!] } # ============== OPERATOR ============================= # Input for status change of Meshery Operator input OperatorStatusInput { - - # Desired status for Meshery Operator - targetStatus: Status! + # Desired status for Meshery Operator + targetStatus: Status! } # Status of Meshery Operator and its controllers type OperatorStatus { + # Status of Meshery Operator + status: Status! - # Status of Meshery Operator - status: Status! + # Verion of Meshery Operator + version: String! - # Verion of Meshery Operator - version: String! + # Details about various Controllers of Meshery Operator + controllers: [OperatorControllerStatus!]! - # Details about various Controllers of Meshery Operator - controllers: [OperatorControllerStatus!]! - - # Error Logs encountered by Meshery Operator - error: Error + # Error Logs encountered by Meshery Operator + error: Error } # Controllers of Meshery Operator type OperatorControllerStatus { + # Controller Name + name: String! - # Controller Name - name: String! - - # Controller Verison - version: String! + # Controller Verison + version: String! - # Controller Status - status: Status! + # Controller Status + status: Status! - # Controller Error Log - error: Error + # Controller Error Log + error: Error } # ============== NAMESPACE ============================= # Type to define a k8s Namespace type NameSpace { - - # Namespace Name - namespace: String! + # Namespace Name + namespace: String! } # ============== Patterns ================================= type PatternPageResult { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - patterns: [PatternResult] + patterns: [PatternResult] } type PatternResult { - id: ID! - name: String! - user_id: String! - location: PatternLocation! - pattern_file: String! - canSupport: Boolean! - errmsg: String - created_at: String - updated_at: String + id: ID! + name: String! + user_id: String! + location: PatternLocation! + pattern_file: String! + canSupport: Boolean! + errmsg: String + created_at: String + updated_at: String } type PatternLocation { - branch: String - host: String - path: String - type: String + branch: String + host: String + path: String + type: String } # ============== Perf ================================= type PerfPageResult { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - results: [MesheryResult] + results: [MesheryResult] } type PerfPageProfiles { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - profiles: [PerfProfile] + profiles: [PerfProfile] } type PerfProfile { - concurrent_request: Int! - created_at: String - duration: String! - endpoints: [String] - id: String! - last_run: String - load_generators: [String] - name: String - qps: Int - total_results: Int - updated_at: String - user_id: String! - request_headers: String - request_cookies: String - request_body: String - content_type: String - service_mesh: String + concurrent_request: Int! + created_at: String + duration: String! + endpoints: [String] + id: String! + last_run: String + load_generators: [String] + name: String + qps: Int + total_results: Int + updated_at: String + user_id: String! + request_headers: String + request_cookies: String + request_body: String + content_type: String + service_mesh: String } type MesheryResult { - meshery_id: String - name: String - mesh: String - performance_profile: String - test_id: String - runner_results: Map - server_metrics: String - server_board_config: String - test_start_time: String - user_id: String - updated_at: String - created_at: String + meshery_id: String + name: String + mesh: String + performance_profile: String + test_id: String + runner_results: Map + server_metrics: String + server_board_config: String + test_start_time: String + user_id: String + updated_at: String + created_at: String } input PageFilter { - page: String! - pageSize: String! - order: String - search: String - from: String - to: String + page: String! + pageSize: String! + order: String + search: String + from: String + to: String } + # ============== RESYNC ============================= # Type ReSyncActions define the actions involved during resync input ReSyncActions { - clearDB: String! - ReSync: String! + clearDB: String! + ReSync: String! } # ============== ROOT ================================= type Query { - - # Query details about Addons available (Eg. Prometheus and Grafana) - getAvailableAddons( - # Select Mesh Type - selector: MeshType - ): [AddonList!]! + # Query details about Addons available (Eg. Prometheus and Grafana) + getAvailableAddons( + # Select Mesh Type + selector: MeshType + ): [AddonList!]! - # Query Control Plane data for a Service Mesh (or all) in your cluster - getControlPlanes( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [ControlPlane!]! + # Query Control Plane data for a Service Mesh (or all) in your cluster + getControlPlanes( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [ControlPlane!]! - # Query Data Plane information for a Service Mesh (or all) in your cluster - getDataPlanes( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [DataPlane!]! - - # Query status of Meshery Operator in your cluster - getOperatorStatus: OperatorStatus - - # Query to resync the cluster discovery - resyncCluster( - # Selector to control several resync actions - selector: ReSyncActions - ): Status! + # Query Data Plane information for a Service Mesh (or all) in your cluster + getDataPlanes( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [DataPlane!]! - # Check the Meshsync Status - getMeshsyncStatus: OperatorControllerStatus! + # Query status of Meshery Operator in your cluster + getOperatorStatus: OperatorStatus - # Check the Meshsync Status and deploy if not enabled - deployMeshsync: Status! + # Query to resync the cluster discovery + resyncCluster( + # Selector to control several resync actions + selector: ReSyncActions + ): Status! - # Check is Meshey Server is connected to NATS - getNatsStatus: OperatorControllerStatus! + # Check the Meshsync Status + getMeshsyncStatus: OperatorControllerStatus! - # Check is Meshey Server is connected to NATS, if not connect to the NATS Server - connectToNats: Status! + # Check the Meshsync Status and deploy if not enabled + deployMeshsync: Status! - # Query available Namesapces in your cluster - getAvailableNamespaces: [NameSpace!]! + # Check is Meshey Server is connected to NATS + getNatsStatus: OperatorControllerStatus! - # Query for performance result - getPerfResult(id: ID!): MesheryResult + # Check is Meshey Server is connected to NATS, if not connect to the NATS Server + connectToNats: Status! - # Query for fetching all results for profile ID - fetchResults(selector: PageFilter!, profileID: String!): PerfPageResult! + # Query available Namesapces in your cluster + getAvailableNamespaces: [NameSpace!]! - # Query for fetching all results for profile ID - getPerformanceProfiles(selector: PageFilter!): PerfPageProfiles! + # Query for performance result + getPerfResult(id: ID!): MesheryResult - # Query for fetching all results for profile ID - fetchAllResults(selector: PageFilter!): PerfPageResult! + # Query for fetching all results for profile ID + fetchResults(selector: PageFilter!, profileID: String!): PerfPageResult! - # Query for fetching all patterns with selector - fetchPatterns(selector: PageFilter!): PatternPageResult! -} + # Query for fetching all results for profile ID + getPerformanceProfiles(selector: PageFilter!): PerfPageProfiles! -# + # Query for fetching all results for profile ID + fetchAllResults(selector: PageFilter!): PerfPageResult! -type Mutation { + # Query for fetching all patterns with selector + fetchPatterns(selector: PageFilter!): PatternPageResult! + + # Query for getting workloads + getWorkloads(name: String, id: ID, trim: Boolean): [OAMCapability] + # Query for getting traits + getTraits(name: String, id: ID, trim: Boolean): [OAMCapability] + # Query for getting scopes + getScopes(name: String, id: ID, trim: Boolean): [OAMCapability] + # getOAMComponents(type: String!, name: String, id: ID, trim: Boolean): Any +} - # Change the Addon Status - changeAddonStatus(input: AddonStatusInput): Status! +# - # Change the Operator Status - changeOperatorStatus(input: OperatorStatusInput): Status! +type Mutation { + # Change the Addon Status + changeAddonStatus(input: AddonStatusInput): Status! + # Change the Operator Status + changeOperatorStatus(input: OperatorStatusInput): Status! } type Subscription { + # Listen to changes in status of Addons available (Eg. Prometheus and Grafana) + listenToAddonState( + # Select Mesh Type + selector: MeshType + ): [AddonList!]! - # Listen to changes in status of Addons available (Eg. Prometheus and Grafana) - listenToAddonState( - # Select Mesh Type - selector: MeshType - ): [AddonList!]! + # Listen to changes in Control Plane data for a Service Mesh (or all) in your cluster + listenToControlPlaneState( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [ControlPlane!]! - # Listen to changes in Control Plane data for a Service Mesh (or all) in your cluster - listenToControlPlaneState( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [ControlPlane!]! + # Listen to changes in Data Plane data for a Service Mesh (or all) in your cluster + listenToDataPlaneState( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [DataPlane!]! - # Listen to changes in Data Plane data for a Service Mesh (or all) in your cluster - listenToDataPlaneState( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [DataPlane!]! + # Listen to changes in status of Meshery Operator in your cluster + listenToOperatorState: OperatorStatus! - # Listen to changes in status of Meshery Operator in your cluster - listenToOperatorState: OperatorStatus! + # Listen to changes in the list of available Namesapces in your cluster + listenToMeshSyncEvents: OperatorControllerStatus! - # Listen to changes in the list of available Namesapces in your cluster - listenToMeshSyncEvents: OperatorControllerStatus! + # Listen to changes in Performance Profiles + subscribePerfProfiles(selector: PageFilter!): PerfPageProfiles! - # Listen to changes in Performance Profiles - subscribePerfProfiles(selector: PageFilter!): PerfPageProfiles! + # Listen to all results for profile ID + subscribePerfResults(selector: PageFilter!, profileID: String!): PerfPageResult! - # Listen to all results for profile ID - subscribePerfResults(selector: PageFilter!, profileID: String!): PerfPageResult! - - # Listen to changes in Broker (NATS) Connection - subscribeBrokerConnection: Boolean! + # Listen to changes in Broker (NATS) Connection + subscribeBrokerConnection: Boolean! +} +type OAMCapability { + oam_definition: Any + id: String + oam_ref_schema: String + host: String + restricted: Boolean + metadata: Any } `, BuiltIn: false}, } @@ -1910,6 +2000,105 @@ func (ec *executionContext) field_Query_getPerformanceProfiles_args(ctx context. return args, nil } +func (ec *executionContext) field_Query_getScopes_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg1 + var arg2 *bool + if tmp, ok := rawArgs["trim"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("trim")) + arg2, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["trim"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_getTraits_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg1 + var arg2 *bool + if tmp, ok := rawArgs["trim"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("trim")) + arg2, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["trim"] = arg2 + return args, nil +} + +func (ec *executionContext) field_Query_getWorkloads_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + var arg1 *string + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg1 + var arg2 *bool + if tmp, ok := rawArgs["trim"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("trim")) + arg2, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["trim"] = arg2 + return args, nil +} + func (ec *executionContext) field_Query_resyncCluster_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -3640,7 +3829,7 @@ func (ec *executionContext) _NameSpace_namespace(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorControllerStatus_name(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_oam_definition(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3648,7 +3837,7 @@ func (ec *executionContext) _OperatorControllerStatus_name(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "OperatorControllerStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3658,24 +3847,21 @@ func (ec *executionContext) _OperatorControllerStatus_name(ctx context.Context, ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.OamDefinition, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(interface{}) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOAny2interface(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorControllerStatus_version(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_id(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3683,7 +3869,7 @@ func (ec *executionContext) _OperatorControllerStatus_version(ctx context.Contex } }() fc := &graphql.FieldContext{ - Object: "OperatorControllerStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3693,24 +3879,21 @@ func (ec *executionContext) _OperatorControllerStatus_version(ctx context.Contex ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Version, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorControllerStatus_status(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_oam_ref_schema(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3718,7 +3901,7 @@ func (ec *executionContext) _OperatorControllerStatus_status(ctx context.Context } }() fc := &graphql.FieldContext{ - Object: "OperatorControllerStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3728,24 +3911,21 @@ func (ec *executionContext) _OperatorControllerStatus_status(ctx context.Context ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.OamRefSchema, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(model.Status) + res := resTmp.(*string) fc.Result = res - return ec.marshalNStatus2githubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐStatus(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorControllerStatus_error(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_host(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3753,7 +3933,7 @@ func (ec *executionContext) _OperatorControllerStatus_error(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "OperatorControllerStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3763,7 +3943,7 @@ func (ec *executionContext) _OperatorControllerStatus_error(ctx context.Context, ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Error, nil + return obj.Host, nil }) if err != nil { ec.Error(ctx, err) @@ -3772,12 +3952,12 @@ func (ec *executionContext) _OperatorControllerStatus_error(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*model.Error) + res := resTmp.(*string) fc.Result = res - return ec.marshalOError2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐError(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorStatus_status(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_restricted(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3785,7 +3965,7 @@ func (ec *executionContext) _OperatorStatus_status(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "OperatorStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3795,24 +3975,21 @@ func (ec *executionContext) _OperatorStatus_status(ctx context.Context, field gr ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.Restricted, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(model.Status) + res := resTmp.(*bool) fc.Result = res - return ec.marshalNStatus2githubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐStatus(ctx, field.Selections, res) + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorStatus_version(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OAMCapability_metadata(ctx context.Context, field graphql.CollectedField, obj *model.OAMCapability) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3820,7 +3997,7 @@ func (ec *executionContext) _OperatorStatus_version(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "OperatorStatus", + Object: "OAMCapability", Field: field, Args: nil, IsMethod: false, @@ -3830,24 +4007,21 @@ func (ec *executionContext) _OperatorStatus_version(ctx context.Context, field g ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Version, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(interface{}) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOAny2interface(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorStatus_controllers(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorControllerStatus_name(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3855,7 +4029,7 @@ func (ec *executionContext) _OperatorStatus_controllers(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "OperatorStatus", + Object: "OperatorControllerStatus", Field: field, Args: nil, IsMethod: false, @@ -3865,7 +4039,7 @@ func (ec *executionContext) _OperatorStatus_controllers(ctx context.Context, fie ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Controllers, nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) @@ -3877,12 +4051,12 @@ func (ec *executionContext) _OperatorStatus_controllers(ctx context.Context, fie } return graphql.Null } - res := resTmp.([]*model.OperatorControllerStatus) + res := resTmp.(string) fc.Result = res - return ec.marshalNOperatorControllerStatus2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOperatorControllerStatusᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _OperatorStatus_error(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorControllerStatus_version(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3890,7 +4064,7 @@ func (ec *executionContext) _OperatorStatus_error(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "OperatorStatus", + Object: "OperatorControllerStatus", Field: field, Args: nil, IsMethod: false, @@ -3900,21 +4074,24 @@ func (ec *executionContext) _OperatorStatus_error(ctx context.Context, field gra ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Error, nil + return obj.Version, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*model.Error) + res := resTmp.(string) fc.Result = res - return ec.marshalOError2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐError(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _PatternLocation_branch(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorControllerStatus_status(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3922,7 +4099,7 @@ func (ec *executionContext) _PatternLocation_branch(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "PatternLocation", + Object: "OperatorControllerStatus", Field: field, Args: nil, IsMethod: false, @@ -3932,21 +4109,24 @@ func (ec *executionContext) _PatternLocation_branch(ctx context.Context, field g ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Branch, nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(model.Status) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNStatus2githubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) _PatternLocation_host(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorControllerStatus_error(ctx context.Context, field graphql.CollectedField, obj *model.OperatorControllerStatus) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3954,7 +4134,7 @@ func (ec *executionContext) _PatternLocation_host(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "PatternLocation", + Object: "OperatorControllerStatus", Field: field, Args: nil, IsMethod: false, @@ -3964,7 +4144,7 @@ func (ec *executionContext) _PatternLocation_host(ctx context.Context, field gra ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Host, nil + return obj.Error, nil }) if err != nil { ec.Error(ctx, err) @@ -3973,12 +4153,12 @@ func (ec *executionContext) _PatternLocation_host(ctx context.Context, field gra if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Error) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOError2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐError(ctx, field.Selections, res) } -func (ec *executionContext) _PatternLocation_path(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorStatus_status(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3986,7 +4166,7 @@ func (ec *executionContext) _PatternLocation_path(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "PatternLocation", + Object: "OperatorStatus", Field: field, Args: nil, IsMethod: false, @@ -3996,21 +4176,222 @@ func (ec *executionContext) _PatternLocation_path(ctx context.Context, field gra ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Path, nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(model.Status) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNStatus2githubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐStatus(ctx, field.Selections, res) } -func (ec *executionContext) _PatternLocation_type(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { +func (ec *executionContext) _OperatorStatus_version(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "OperatorStatus", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Version, 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) _OperatorStatus_controllers(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "OperatorStatus", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Controllers, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.OperatorControllerStatus) + fc.Result = res + return ec.marshalNOperatorControllerStatus2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOperatorControllerStatusᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _OperatorStatus_error(ctx context.Context, field graphql.CollectedField, obj *model.OperatorStatus) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "OperatorStatus", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + 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.(*model.Error) + fc.Result = res + return ec.marshalOError2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐError(ctx, field.Selections, res) +} + +func (ec *executionContext) _PatternLocation_branch(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "PatternLocation", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Branch, 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) _PatternLocation_host(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "PatternLocation", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Host, 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) _PatternLocation_path(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "PatternLocation", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Path, 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) _PatternLocation_type(ctx context.Context, field graphql.CollectedField, obj *model.PatternLocation) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5897,7 +6278,7 @@ func (ec *executionContext) _Query_fetchPatterns(ctx context.Context, field grap return ec.marshalNPatternPageResult2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐPatternPageResult(ctx, field.Selections, res) } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Query_getWorkloads(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5909,12 +6290,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col Field: field, Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query___type_args(ctx, rawArgs) + args, err := ec.field_Query_getWorkloads_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -5922,7 +6303,7 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectType(args["name"].(string)) + return ec.resolvers.Query().GetWorkloads(rctx, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -5931,12 +6312,12 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]*model.OAMCapability) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOOAMCapability2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx, field.Selections, res) } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Query_getTraits(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5948,13 +6329,20 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C Field: field, Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_getTraits_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() + return ec.resolvers.Query().GetTraits(rctx, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -5963,20 +6351,20 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Schema) + res := resTmp.([]*model.OAMCapability) fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + return ec.marshalOOAMCapability2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx, field.Selections, res) } -func (ec *executionContext) _Subscription_listenToAddonState(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { +func (ec *executionContext) _Query_getScopes(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil + ret = graphql.Null } }() fc := &graphql.FieldContext{ - Object: "Subscription", + Object: "Query", Field: field, Args: nil, IsMethod: true, @@ -5985,59 +6373,169 @@ func (ec *executionContext) _Subscription_listenToAddonState(ctx context.Context ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Subscription_listenToAddonState_args(ctx, rawArgs) + args, err := ec.field_Query_getScopes_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) - return nil + return graphql.Null } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Subscription().ListenToAddonState(rctx, args["selector"].(*model.MeshType)) + return ec.resolvers.Query().GetScopes(rctx, args["name"].(*string), args["id"].(*string), args["trim"].(*bool)) }) if err != nil { ec.Error(ctx, err) - return nil + return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return nil - } - return func() graphql.Marshaler { - res, ok := <-resTmp.(<-chan []*model.AddonList) - if !ok { - return nil - } - return graphql.WriterFunc(func(w io.Writer) { - w.Write([]byte{'{'}) - graphql.MarshalString(field.Alias).MarshalGQL(w) - w.Write([]byte{':'}) - ec.marshalNAddonList2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐAddonListᚄ(ctx, field.Selections, res).MarshalGQL(w) - w.Write([]byte{'}'}) - }) + return graphql.Null } + res := resTmp.([]*model.OAMCapability) + fc.Result = res + return ec.marshalOOAMCapability2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx, field.Selections, res) } -func (ec *executionContext) _Subscription_listenToControlPlaneState(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil + ret = graphql.Null } }() fc := &graphql.FieldContext{ - Object: "Subscription", + Object: "Query", Field: field, Args: nil, IsMethod: true, - IsResolver: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Subscription_listenToControlPlaneState_args(ctx, rawArgs) + args, err := ec.field_Query___type_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) _Subscription_listenToAddonState(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_listenToAddonState_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ListenToAddonState(rctx, args["selector"].(*model.MeshType)) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan []*model.AddonList) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalNAddonList2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐAddonListᚄ(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_listenToControlPlaneState(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_listenToControlPlaneState_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return nil @@ -6409,14 +6907,14 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field Object: "__Directive", Field: field, Args: nil, - IsMethod: false, + IsMethod: true, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -6425,9 +6923,9 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { @@ -6581,14 +7079,14 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field Object: "__EnumValue", Field: field, Args: nil, - IsMethod: false, + IsMethod: true, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -6597,9 +7095,9 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { @@ -6715,14 +7213,14 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap Object: "__Field", Field: field, Args: nil, - IsMethod: false, + IsMethod: true, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -6731,9 +7229,9 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { @@ -6919,14 +7417,14 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field Object: "__InputValue", Field: field, Args: nil, - IsMethod: false, + IsMethod: true, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -6935,9 +7433,9 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { @@ -7007,6 +7505,38 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + 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) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -7270,9 +7800,9 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { @@ -7481,6 +8011,38 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), 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) +} + // endregion **************************** field.gotpl ***************************** // region **************************** input.gotpl ***************************** @@ -7668,7 +8230,6 @@ var addonListImplementors = []string{"AddonList"} func (ec *executionContext) _AddonList(ctx context.Context, sel ast.SelectionSet, obj *model.AddonList) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, addonListImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7676,17 +8237,32 @@ func (ec *executionContext) _AddonList(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("AddonList") case "name": - out.Values[i] = ec._AddonList_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._AddonList_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "owner": - out.Values[i] = ec._AddonList_owner(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._AddonList_owner(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "endpoint": - out.Values[i] = ec._AddonList_endpoint(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._AddonList_endpoint(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -7705,7 +8281,6 @@ var containerImplementors = []string{"Container"} func (ec *executionContext) _Container(ctx context.Context, sel ast.SelectionSet, obj *model.Container) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, containerImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7713,26 +8288,56 @@ func (ec *executionContext) _Container(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("Container") case "controlPlaneMemberName": - out.Values[i] = ec._Container_controlPlaneMemberName(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_controlPlaneMemberName(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "containerName": - out.Values[i] = ec._Container_containerName(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_containerName(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "image": - out.Values[i] = ec._Container_image(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_image(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "status": - out.Values[i] = ec._Container_status(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_status(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "ports": - out.Values[i] = ec._Container_ports(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_ports(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "resources": - out.Values[i] = ec._Container_resources(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_resources(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7748,7 +8353,6 @@ var container_PortImplementors = []string{"Container_Port"} func (ec *executionContext) _Container_Port(ctx context.Context, sel ast.SelectionSet, obj *model.ContainerPort) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, container_PortImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7756,14 +8360,29 @@ func (ec *executionContext) _Container_Port(ctx context.Context, sel ast.Selecti case "__typename": out.Values[i] = graphql.MarshalString("Container_Port") case "name": - out.Values[i] = ec._Container_Port_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Port_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "containerPort": - out.Values[i] = ec._Container_Port_containerPort(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Port_containerPort(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "protocol": - out.Values[i] = ec._Container_Port_protocol(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Port_protocol(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -7782,7 +8401,6 @@ var container_StatusImplementors = []string{"Container_Status"} func (ec *executionContext) _Container_Status(ctx context.Context, sel ast.SelectionSet, obj *model.ContainerStatus) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, container_StatusImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7790,35 +8408,80 @@ func (ec *executionContext) _Container_Status(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("Container_Status") case "containerStatusName": - out.Values[i] = ec._Container_Status_containerStatusName(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_containerStatusName(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "image": - out.Values[i] = ec._Container_Status_image(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_image(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "state": - out.Values[i] = ec._Container_Status_state(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_state(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "lastState": - out.Values[i] = ec._Container_Status_lastState(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_lastState(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "ready": - out.Values[i] = ec._Container_Status_ready(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_ready(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "restartCount": - out.Values[i] = ec._Container_Status_restartCount(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_restartCount(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "started": - out.Values[i] = ec._Container_Status_started(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_started(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "imageID": - out.Values[i] = ec._Container_Status_imageID(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_imageID(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "containerID": - out.Values[i] = ec._Container_Status_containerID(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Container_Status_containerID(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7834,7 +8497,6 @@ var controlPlaneImplementors = []string{"ControlPlane"} func (ec *executionContext) _ControlPlane(ctx context.Context, sel ast.SelectionSet, obj *model.ControlPlane) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, controlPlaneImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7842,12 +8504,22 @@ func (ec *executionContext) _ControlPlane(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("ControlPlane") case "name": - out.Values[i] = ec._ControlPlane_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlane_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "members": - out.Values[i] = ec._ControlPlane_members(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlane_members(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -7866,7 +8538,6 @@ var controlPlaneMemberImplementors = []string{"ControlPlaneMember"} func (ec *executionContext) _ControlPlaneMember(ctx context.Context, sel ast.SelectionSet, obj *model.ControlPlaneMember) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, controlPlaneMemberImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7874,27 +8545,52 @@ func (ec *executionContext) _ControlPlaneMember(ctx context.Context, sel ast.Sel case "__typename": out.Values[i] = graphql.MarshalString("ControlPlaneMember") case "name": - out.Values[i] = ec._ControlPlaneMember_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlaneMember_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "component": - out.Values[i] = ec._ControlPlaneMember_component(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlaneMember_component(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "version": - out.Values[i] = ec._ControlPlaneMember_version(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlaneMember_version(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "namespace": - out.Values[i] = ec._ControlPlaneMember_namespace(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlaneMember_namespace(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "data_planes": - out.Values[i] = ec._ControlPlaneMember_data_planes(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._ControlPlaneMember_data_planes(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7910,7 +8606,6 @@ var dataPlaneImplementors = []string{"DataPlane"} func (ec *executionContext) _DataPlane(ctx context.Context, sel ast.SelectionSet, obj *model.DataPlane) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, dataPlaneImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7918,12 +8613,22 @@ func (ec *executionContext) _DataPlane(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("DataPlane") case "name": - out.Values[i] = ec._DataPlane_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._DataPlane_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "proxies": - out.Values[i] = ec._DataPlane_proxies(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._DataPlane_proxies(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -7942,7 +8647,6 @@ var errorImplementors = []string{"Error"} func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, obj *model.Error) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, errorImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7950,12 +8654,22 @@ func (ec *executionContext) _Error(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Error") case "code": - out.Values[i] = ec._Error_code(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Error_code(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "description": - out.Values[i] = ec._Error_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Error_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -7974,7 +8688,6 @@ var mesheryResultImplementors = []string{"MesheryResult"} func (ec *executionContext) _MesheryResult(ctx context.Context, sel ast.SelectionSet, obj *model.MesheryResult) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, mesheryResultImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7982,29 +8695,89 @@ func (ec *executionContext) _MesheryResult(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("MesheryResult") case "meshery_id": - out.Values[i] = ec._MesheryResult_meshery_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_meshery_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "name": - out.Values[i] = ec._MesheryResult_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "mesh": - out.Values[i] = ec._MesheryResult_mesh(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_mesh(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "performance_profile": - out.Values[i] = ec._MesheryResult_performance_profile(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_performance_profile(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "test_id": - out.Values[i] = ec._MesheryResult_test_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_test_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "runner_results": - out.Values[i] = ec._MesheryResult_runner_results(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_runner_results(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "server_metrics": - out.Values[i] = ec._MesheryResult_server_metrics(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_server_metrics(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "server_board_config": - out.Values[i] = ec._MesheryResult_server_board_config(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_server_board_config(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "test_start_time": - out.Values[i] = ec._MesheryResult_test_start_time(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_test_start_time(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "user_id": - out.Values[i] = ec._MesheryResult_user_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_user_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "updated_at": - out.Values[i] = ec._MesheryResult_updated_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_updated_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "created_at": - out.Values[i] = ec._MesheryResult_created_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._MesheryResult_created_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8020,7 +8793,6 @@ var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ Object: "Mutation", }) @@ -8028,16 +8800,31 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "changeAddonStatus": - out.Values[i] = ec._Mutation_changeAddonStatus(ctx, field) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_changeAddonStatus(ctx, field) + } + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + if out.Values[i] == graphql.Null { invalids++ } case "changeOperatorStatus": - out.Values[i] = ec._Mutation_changeOperatorStatus(ctx, field) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_changeOperatorStatus(ctx, field) + } + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + if out.Values[i] == graphql.Null { invalids++ } @@ -8056,7 +8843,6 @@ var nameSpaceImplementors = []string{"NameSpace"} func (ec *executionContext) _NameSpace(ctx context.Context, sel ast.SelectionSet, obj *model.NameSpace) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, nameSpaceImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8064,7 +8850,12 @@ func (ec *executionContext) _NameSpace(ctx context.Context, sel ast.SelectionSet case "__typename": out.Values[i] = graphql.MarshalString("NameSpace") case "namespace": - out.Values[i] = ec._NameSpace_namespace(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._NameSpace_namespace(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -8079,11 +8870,73 @@ func (ec *executionContext) _NameSpace(ctx context.Context, sel ast.SelectionSet return out } +var oAMCapabilityImplementors = []string{"OAMCapability"} + +func (ec *executionContext) _OAMCapability(ctx context.Context, sel ast.SelectionSet, obj *model.OAMCapability) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oAMCapabilityImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("OAMCapability") + case "oam_definition": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_oam_definition(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "id": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "oam_ref_schema": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_oam_ref_schema(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "host": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_host(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "restricted": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_restricted(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "metadata": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OAMCapability_metadata(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var operatorControllerStatusImplementors = []string{"OperatorControllerStatus"} func (ec *executionContext) _OperatorControllerStatus(ctx context.Context, sel ast.SelectionSet, obj *model.OperatorControllerStatus) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, operatorControllerStatusImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8091,22 +8944,42 @@ func (ec *executionContext) _OperatorControllerStatus(ctx context.Context, sel a case "__typename": out.Values[i] = graphql.MarshalString("OperatorControllerStatus") case "name": - out.Values[i] = ec._OperatorControllerStatus_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorControllerStatus_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "version": - out.Values[i] = ec._OperatorControllerStatus_version(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorControllerStatus_version(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "status": - out.Values[i] = ec._OperatorControllerStatus_status(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorControllerStatus_status(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "error": - out.Values[i] = ec._OperatorControllerStatus_error(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorControllerStatus_error(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8122,7 +8995,6 @@ var operatorStatusImplementors = []string{"OperatorStatus"} func (ec *executionContext) _OperatorStatus(ctx context.Context, sel ast.SelectionSet, obj *model.OperatorStatus) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, operatorStatusImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8130,22 +9002,42 @@ func (ec *executionContext) _OperatorStatus(ctx context.Context, sel ast.Selecti case "__typename": out.Values[i] = graphql.MarshalString("OperatorStatus") case "status": - out.Values[i] = ec._OperatorStatus_status(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorStatus_status(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "version": - out.Values[i] = ec._OperatorStatus_version(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorStatus_version(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "controllers": - out.Values[i] = ec._OperatorStatus_controllers(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorStatus_controllers(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "error": - out.Values[i] = ec._OperatorStatus_error(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._OperatorStatus_error(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8161,7 +9053,6 @@ var patternLocationImplementors = []string{"PatternLocation"} func (ec *executionContext) _PatternLocation(ctx context.Context, sel ast.SelectionSet, obj *model.PatternLocation) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, patternLocationImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8169,13 +9060,33 @@ func (ec *executionContext) _PatternLocation(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("PatternLocation") case "branch": - out.Values[i] = ec._PatternLocation_branch(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternLocation_branch(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "host": - out.Values[i] = ec._PatternLocation_host(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternLocation_host(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "path": - out.Values[i] = ec._PatternLocation_path(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternLocation_path(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "type": - out.Values[i] = ec._PatternLocation_type(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternLocation_type(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8191,7 +9102,6 @@ var patternPageResultImplementors = []string{"PatternPageResult"} func (ec *executionContext) _PatternPageResult(ctx context.Context, sel ast.SelectionSet, obj *model.PatternPageResult) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, patternPageResultImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8199,22 +9109,42 @@ func (ec *executionContext) _PatternPageResult(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("PatternPageResult") case "page": - out.Values[i] = ec._PatternPageResult_page(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternPageResult_page(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "page_size": - out.Values[i] = ec._PatternPageResult_page_size(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternPageResult_page_size(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "total_count": - out.Values[i] = ec._PatternPageResult_total_count(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternPageResult_total_count(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "patterns": - out.Values[i] = ec._PatternPageResult_patterns(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternPageResult_patterns(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8230,7 +9160,6 @@ var patternResultImplementors = []string{"PatternResult"} func (ec *executionContext) _PatternResult(ctx context.Context, sel ast.SelectionSet, obj *model.PatternResult) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, patternResultImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8238,41 +9167,86 @@ func (ec *executionContext) _PatternResult(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("PatternResult") case "id": - out.Values[i] = ec._PatternResult_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "name": - out.Values[i] = ec._PatternResult_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "user_id": - out.Values[i] = ec._PatternResult_user_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_user_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "location": - out.Values[i] = ec._PatternResult_location(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_location(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "pattern_file": - out.Values[i] = ec._PatternResult_pattern_file(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_pattern_file(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "canSupport": - out.Values[i] = ec._PatternResult_canSupport(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_canSupport(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "errmsg": - out.Values[i] = ec._PatternResult_errmsg(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_errmsg(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "created_at": - out.Values[i] = ec._PatternResult_created_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_created_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "updated_at": - out.Values[i] = ec._PatternResult_updated_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PatternResult_updated_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8288,7 +9262,6 @@ var perfPageProfilesImplementors = []string{"PerfPageProfiles"} func (ec *executionContext) _PerfPageProfiles(ctx context.Context, sel ast.SelectionSet, obj *model.PerfPageProfiles) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, perfPageProfilesImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8296,22 +9269,42 @@ func (ec *executionContext) _PerfPageProfiles(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("PerfPageProfiles") case "page": - out.Values[i] = ec._PerfPageProfiles_page(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageProfiles_page(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "page_size": - out.Values[i] = ec._PerfPageProfiles_page_size(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageProfiles_page_size(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "total_count": - out.Values[i] = ec._PerfPageProfiles_total_count(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageProfiles_total_count(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "profiles": - out.Values[i] = ec._PerfPageProfiles_profiles(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageProfiles_profiles(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8327,7 +9320,6 @@ var perfPageResultImplementors = []string{"PerfPageResult"} func (ec *executionContext) _PerfPageResult(ctx context.Context, sel ast.SelectionSet, obj *model.PerfPageResult) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, perfPageResultImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8335,22 +9327,42 @@ func (ec *executionContext) _PerfPageResult(ctx context.Context, sel ast.Selecti case "__typename": out.Values[i] = graphql.MarshalString("PerfPageResult") case "page": - out.Values[i] = ec._PerfPageResult_page(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageResult_page(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "page_size": - out.Values[i] = ec._PerfPageResult_page_size(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageResult_page_size(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "total_count": - out.Values[i] = ec._PerfPageResult_total_count(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageResult_total_count(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "results": - out.Values[i] = ec._PerfPageResult_results(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfPageResult_results(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8366,7 +9378,6 @@ var perfProfileImplementors = []string{"PerfProfile"} func (ec *executionContext) _PerfProfile(ctx context.Context, sel ast.SelectionSet, obj *model.PerfProfile) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, perfProfileImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8374,51 +9385,136 @@ func (ec *executionContext) _PerfProfile(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("PerfProfile") case "concurrent_request": - out.Values[i] = ec._PerfProfile_concurrent_request(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_concurrent_request(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "created_at": - out.Values[i] = ec._PerfProfile_created_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_created_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "duration": - out.Values[i] = ec._PerfProfile_duration(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_duration(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "endpoints": - out.Values[i] = ec._PerfProfile_endpoints(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_endpoints(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "id": - out.Values[i] = ec._PerfProfile_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "last_run": - out.Values[i] = ec._PerfProfile_last_run(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_last_run(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "load_generators": - out.Values[i] = ec._PerfProfile_load_generators(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_load_generators(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "name": - out.Values[i] = ec._PerfProfile_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "qps": - out.Values[i] = ec._PerfProfile_qps(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_qps(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "total_results": - out.Values[i] = ec._PerfProfile_total_results(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_total_results(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "updated_at": - out.Values[i] = ec._PerfProfile_updated_at(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_updated_at(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "user_id": - out.Values[i] = ec._PerfProfile_user_id(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_user_id(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "request_headers": - out.Values[i] = ec._PerfProfile_request_headers(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_request_headers(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "request_cookies": - out.Values[i] = ec._PerfProfile_request_cookies(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_request_cookies(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "request_body": - out.Values[i] = ec._PerfProfile_request_body(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_request_body(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "content_type": - out.Values[i] = ec._PerfProfile_content_type(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_content_type(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "service_mesh": - out.Values[i] = ec._PerfProfile_service_mesh(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._PerfProfile_service_mesh(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8434,7 +9530,6 @@ var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ Object: "Query", }) @@ -8442,12 +9537,18 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") case "getAvailableAddons": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8458,10 +9559,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getControlPlanes": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8472,10 +9582,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getDataPlanes": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8486,10 +9605,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getOperatorStatus": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8497,10 +9625,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getOperatorStatus(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "resyncCluster": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8511,10 +9648,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getMeshsyncStatus": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8525,10 +9671,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "deployMeshsync": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8539,10 +9694,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getNatsStatus": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8553,10 +9717,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "connectToNats": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8567,10 +9740,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getAvailableNamespaces": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8581,10 +9763,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getPerfResult": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8592,10 +9783,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getPerfResult(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "fetchResults": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8606,10 +9806,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getPerformanceProfiles": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8620,10 +9829,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "fetchAllResults": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8634,10 +9852,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "fetchPatterns": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8648,11 +9875,89 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "getWorkloads": + 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._Query_getWorkloads(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "getTraits": + 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._Query_getTraits(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) + }) + case "getScopes": + 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._Query_getScopes(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "__type": - out.Values[i] = ec._Query___type(ctx, field) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + } + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + case "__schema": - out.Values[i] = ec._Query___schema(ctx, field) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + } + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, innerFunc) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8702,7 +10007,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8710,24 +10014,49 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": - out.Values[i] = ec.___Directive_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Directive_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "description": - out.Values[i] = ec.___Directive_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Directive_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "locations": - out.Values[i] = ec.___Directive_locations(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Directive_locations(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "args": - out.Values[i] = ec.___Directive_args(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Directive_args(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Directive_isRepeatable(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -8746,7 +10075,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8754,19 +10082,39 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___EnumValue_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "description": - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___EnumValue_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "isDeprecated": - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___EnumValue_isDeprecated(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___EnumValue_deprecationReason(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8782,7 +10130,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8790,29 +10137,59 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": - out.Values[i] = ec.___Field_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "description": - out.Values[i] = ec.___Field_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "args": - out.Values[i] = ec.___Field_args(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_args(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "type": - out.Values[i] = ec.___Field_type(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_type(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_isDeprecated(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Field_deprecationReason(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8828,7 +10205,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8836,19 +10212,39 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": - out.Values[i] = ec.___InputValue_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___InputValue_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "description": - out.Values[i] = ec.___InputValue_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___InputValue_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "type": - out.Values[i] = ec.___InputValue_type(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___InputValue_type(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___InputValue_defaultValue(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -8864,29 +10260,60 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Schema") + case "description": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "types": - out.Values[i] = ec.___Schema_types(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_types(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "queryType": - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_queryType(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "mutationType": - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_mutationType(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "subscriptionType": - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_subscriptionType(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "directives": - out.Values[i] = ec.___Schema_directives(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Schema_directives(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } @@ -8905,7 +10332,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -8913,26 +10339,78 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": - out.Values[i] = ec.___Type_kind(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_kind(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + if out.Values[i] == graphql.Null { invalids++ } case "name": - out.Values[i] = ec.___Type_name(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_name(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "description": - out.Values[i] = ec.___Type_description(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_description(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "fields": - out.Values[i] = ec.___Type_fields(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_fields(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "interfaces": - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_interfaces(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "possibleTypes": - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_possibleTypes(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "enumValues": - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_enumValues(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "inputFields": - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_inputFields(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + case "ofType": - out.Values[i] = ec.___Type_ofType(ctx, field, obj) + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_ofType(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + + case "specifiedByURL": + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { + return ec.___Type_specifiedByURL(ctx, field, obj) + } + + out.Values[i] = innerFunc(ctx) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -9537,11 +11015,7 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]string, len(vSlice)) @@ -9748,7 +11222,8 @@ func (ec *executionContext) marshalOAny2interface(ctx context.Context, sel ast.S if v == nil { return graphql.Null } - return graphql.MarshalAny(v) + res := graphql.MarshalAny(v) + return res } func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { @@ -9757,7 +11232,8 @@ func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interf } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - return graphql.MarshalBoolean(v) + res := graphql.MarshalBoolean(v) + return res } func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { @@ -9772,7 +11248,8 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast if v == nil { return graphql.Null } - return graphql.MarshalBoolean(*v) + res := graphql.MarshalBoolean(*v) + return res } func (ec *executionContext) marshalOContainer2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐContainerᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Container) graphql.Marshaler { @@ -9884,6 +11361,22 @@ func (ec *executionContext) marshalOError2ᚖgithubᚗcomᚋlayer5ioᚋmeshery return ec._Error(ctx, sel, v) } +func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalID(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalID(*v) + return res +} + func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { if v == nil { return nil, nil @@ -9896,7 +11389,8 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele if v == nil { return graphql.Null } - return graphql.MarshalInt(*v) + res := graphql.MarshalInt(*v) + return res } func (ec *executionContext) unmarshalOMap2map(ctx context.Context, v interface{}) (map[string]interface{}, error) { @@ -9911,7 +11405,8 @@ func (ec *executionContext) marshalOMap2map(ctx context.Context, sel ast.Selecti if v == nil { return graphql.Null } - return graphql.MarshalMap(v) + res := graphql.MarshalMap(v) + return res } func (ec *executionContext) unmarshalOMeshType2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐMeshType(ctx context.Context, v interface{}) (*model.MeshType, error) { @@ -9978,6 +11473,54 @@ func (ec *executionContext) marshalOMesheryResult2ᚖgithubᚗcomᚋlayer5ioᚋm return ec._MesheryResult(ctx, sel, v) } +func (ec *executionContext) marshalOOAMCapability2ᚕᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx context.Context, sel ast.SelectionSet, v []*model.OAMCapability) 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.marshalOOAMCapability2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOOAMCapability2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOAMCapability(ctx context.Context, sel ast.SelectionSet, v *model.OAMCapability) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._OAMCapability(ctx, sel, v) +} + func (ec *executionContext) marshalOOperatorStatus2ᚖgithubᚗcomᚋlayer5ioᚋmesheryᚋinternalᚋgraphqlᚋmodelᚐOperatorStatus(ctx context.Context, sel ast.SelectionSet, v *model.OperatorStatus) graphql.Marshaler { if v == nil { return graphql.Null @@ -10105,26 +11648,13 @@ func (ec *executionContext) unmarshalOServiceMeshFilter2ᚖgithubᚗcomᚋlayer5 return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - return graphql.MarshalString(v) -} - func (ec *executionContext) unmarshalOString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { if v == nil { return nil, nil } var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]*string, len(vSlice)) @@ -10162,7 +11692,8 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as if v == nil { return graphql.Null } - return graphql.MarshalString(*v) + res := graphql.MarshalString(*v) + return res } func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { diff --git a/internal/graphql/model/models_gen.go b/internal/graphql/model/models_gen.go index f4190e3bc8c..de8f3caeefe 100644 --- a/internal/graphql/model/models_gen.go +++ b/internal/graphql/model/models_gen.go @@ -88,6 +88,15 @@ type NameSpace struct { Namespace string `json:"namespace"` } +type OAMCapability struct { + OamDefinition interface{} `json:"oam_definition"` + ID *string `json:"id"` + OamRefSchema *string `json:"oam_ref_schema"` + Host *string `json:"host"` + Restricted *bool `json:"restricted"` + Metadata interface{} `json:"metadata"` +} + type OperatorControllerStatus struct { Name string `json:"name"` Version string `json:"version"` diff --git a/internal/graphql/resolver/error.go b/internal/graphql/resolver/error.go index 917a8a32281..d5586a513a4 100644 --- a/internal/graphql/resolver/error.go +++ b/internal/graphql/resolver/error.go @@ -22,6 +22,7 @@ const ( ErrBrokerNotConnectedCode = "2151" ErrGettingNamespaceCode = "1014" ErrFetchingPatternsCode = "1015" + ErrInvalidOAMTypeCode = "not set" ) var ( @@ -84,3 +85,13 @@ func ErrGettingNamespace(err error) error { func ErrFetchingPatterns(err error) error { return errors.New(ErrFetchingPatternsCode, errors.Alert, []string{"Cannot fetch patterns"}, []string{err.Error()}, []string{"There might be something wrong with the Meshery or Meshery Cloud"}, []string{"Try again, if still exist, please post an issue on Meshery repository"}) } + +func ErrInvalidOAMType() error { + return errors.New( + ErrInvalidOAMTypeCode, + errors.Alert, + []string{"invalid oam type is requested"}, + []string{"invalid oam type requested, supported types are workload, scope, trait "}, + nil, nil, + ) +} diff --git a/internal/graphql/resolver/kubernetes.go b/internal/graphql/resolver/kubernetes.go index f5a31337267..7f1f2bda737 100644 --- a/internal/graphql/resolver/kubernetes.go +++ b/internal/graphql/resolver/kubernetes.go @@ -5,6 +5,7 @@ import ( "github.com/layer5io/meshery/internal/graphql/model" "github.com/layer5io/meshery/models" + "github.com/layer5io/meshery/models/pattern/core" meshsyncmodel "github.com/layer5io/meshsync/pkg/model" ) @@ -25,3 +26,164 @@ func (r *Resolver) getAvailableNamespaces(ctx context.Context, provider models.P return namespaces, nil } + +// getWorkloads return workloads +func (r *Resolver) getWorkloads(ctx context.Context, name, id *string, trim *bool) (res []*model.OAMCapability, err error) { + if name != nil && *name != "" && id != nil && *id != "" { + workload := core.GetWorkloadByID(*name, *id) + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + workload.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: workload.OAMDefinition, + OamRefSchema: &workload.OAMRefSchema, + Host: &workload.Host, + ID: &workload.ID, + Restricted: &workload.Restricted, + Metadata: workload.Metadata, + }) + } else if name != nil && *name != "" { + workloads := core.GetWorkload(*name) + for _, w := range workloads { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + w.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: w.OAMDefinition, + OamRefSchema: &w.OAMRefSchema, + Host: &w.Host, + ID: &w.ID, + Restricted: &w.Restricted, + Metadata: w.Metadata, + }) + } + } else { + // return all the workloads + workloads := core.GetWorkloads() + for _, w := range workloads { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + w.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: w.OAMDefinition, + OamRefSchema: &w.OAMRefSchema, + Host: &w.Host, + ID: &w.ID, + Restricted: &w.Restricted, + Metadata: w.Metadata, + }) + } + } + return +} + +// getTraits return traits +func (r *Resolver) getTraits(ctx context.Context, name, id *string, trim *bool) (res []*model.OAMCapability, err error) { + if name != nil && *name != "" && id != nil && *id != "" { + trait := core.GetTraitByID(*name, *id) + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + trait.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: trait.OAMDefinition, + OamRefSchema: &trait.OAMRefSchema, + Host: &trait.Host, + ID: &trait.ID, + Restricted: &trait.Restricted, + Metadata: trait.Metadata, + }) + } else if name != nil && *name != "" { + traits := core.GetWorkload(*name) + for _, t := range traits { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + t.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: t.OAMDefinition, + OamRefSchema: &t.OAMRefSchema, + Host: &t.Host, + ID: &t.ID, + Restricted: &t.Restricted, + Metadata: t.Metadata, + }) + } + } else { + // return all the traits + traits := core.GetWorkloads() + for _, t := range traits { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + t.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: t.OAMDefinition, + OamRefSchema: &t.OAMRefSchema, + Host: &t.Host, + ID: &t.ID, + Restricted: &t.Restricted, + Metadata: t.Metadata, + }) + } + } + + return +} + +// getScopes return scopes +func (r *Resolver) getScopes(ctx context.Context, name, id *string, trim *bool) (res []*model.OAMCapability, err error) { + if name != nil && *name != "" && id != nil && *id != "" { + scope := core.GetScopeByID(*name, *id) + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + scope.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: scope.OAMDefinition, + OamRefSchema: &scope.OAMRefSchema, + Host: &scope.Host, + ID: &scope.ID, + Restricted: &scope.Restricted, + Metadata: scope.Metadata, + }) + } else if name != nil && *name != "" { + scopes := core.GetWorkload(*name) + for _, s := range scopes { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + s.OAMRefSchema = "" + } + + res = append(res, &model.OAMCapability{ + OamDefinition: s.OAMDefinition, + OamRefSchema: &s.OAMRefSchema, + Host: &s.Host, + ID: &s.ID, + Restricted: &s.Restricted, + Metadata: s.Metadata, + }) + } + } else { + // return all the scopes + scopes := core.GetWorkloads() + for _, s := range scopes { + // If trim is set to true then remove the schema from the response + if trim != nil && *trim { + s.OAMRefSchema = "" + } + res = append(res, &model.OAMCapability{ + OamDefinition: s.OAMDefinition, + OamRefSchema: &s.OAMRefSchema, + Host: &s.Host, + ID: &s.ID, + Restricted: &s.Restricted, + Metadata: s.Metadata, + }) + } + } + return +} diff --git a/internal/graphql/resolver/schema.resolvers.go b/internal/graphql/resolver/schema.resolvers.go index 7643c9f355b..c662175fd13 100644 --- a/internal/graphql/resolver/schema.resolvers.go +++ b/internal/graphql/resolver/schema.resolvers.go @@ -114,6 +114,18 @@ func (r *queryResolver) FetchPatterns(ctx context.Context, selector model.PageFi return r.fetchPatterns(ctx, provider, selector) } +func (r *queryResolver) GetWorkloads(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) { + return r.getWorkloads(ctx, name, id, trim) +} + +func (r *queryResolver) GetTraits(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) { + return r.getTraits(ctx, name, id, trim) +} + +func (r *queryResolver) GetScopes(ctx context.Context, name *string, id *string, trim *bool) ([]*model.OAMCapability, error) { + return r.getScopes(ctx, name, id, trim) +} + func (r *subscriptionResolver) ListenToAddonState(ctx context.Context, selector *model.MeshType) (<-chan []*model.AddonList, error) { provider := ctx.Value(models.ProviderCtxKey).(models.Provider) if selector != nil { diff --git a/internal/graphql/schema/schema.graphql b/internal/graphql/schema/schema.graphql index 21db8bfa58f..996144dc70e 100644 --- a/internal/graphql/schema/schema.graphql +++ b/internal/graphql/schema/schema.graphql @@ -1,6 +1,6 @@ # We assume a few things about the schema. We use the graphql-ruby gem to generate docs, which enforces: - # - All mutations have a single input field named 'input' -# If these things change, then doc geneartion for GraphQL will break. +# - All mutations have a single input field named 'input' +# If these things change, then doc generation for GraphQL will break. # ================= COMMONS ========================= @@ -10,442 +10,439 @@ scalar Any # Service Mesh Types enum MeshType { + # All meshes that Meshery supports + ALL_MESH - # All meshes that Meshery supports - ALL_MESH + # Invalid Mesh + INVALID_MESH - # Invalid Mesh - INVALID_MESH + # AWS App Mesh + APP_MESH - # AWS App Mesh - APP_MESH + # Citrix Service Mesh + CITRIX_SERVICE_MESH - # Citrix Service Mesh - CITRIX_SERVICE_MESH + # Consul by HashiCorp + CONSUL - # Consul by HashiCorp - CONSUL + # Istio Service Mesh + ISTIO - # Istio Service Mesh - ISTIO + # Kuma + KUMA - # Kuma - KUMA + # LinkerD Service Mesh + LINKERD - # LinkerD Service Mesh - LINKERD + # Traefik Mesh + TRAEFIK_MESH - # Traefik Mesh - TRAEFIK_MESH + # Octarine Mesh + OCTARINE - # Octarine Mesh - OCTARINE + # Network Service Mesh + NETWORK_SERVICE_MESH - # Network Service Mesh - NETWORK_SERVICE_MESH + # VMware Tanzu Service Mesh + TANZU - # VMware Tanzu Service Mesh - TANZU + # Open Service Mesh + OPEN_SERVICE_MESH - # Open Service Mesh - OPEN_SERVICE_MESH - - # NGINX Service Mesh - NGINX_SERVICE_MESH + # NGINX Service Mesh + NGINX_SERVICE_MESH } enum Status { + # Enabled + ENABLED - # Enabled - ENABLED - - # Connected (Applicable only for NATS status for now) - CONNECTED + # Connected (Applicable only for NATS status for now) + CONNECTED - # Disabled - DISABLED + # Disabled + DISABLED - # Processing - PROCESSING + # Processing + PROCESSING - # Unknown - UNKNOWN + # Unknown + UNKNOWN } type Error { + # Error Code + code: String! - # Error Code - code: String! - - # Error Details - description: String! + # Error Details + description: String! } # =================== ADDONS ===================== # Input for changing Addon Status input AddonStatusInput { - - # Filter by Serice Mesh - selector: MeshType, + # Filter by Serice Mesh + selector: MeshType - # Desired Status - targetStatus: Status! + # Desired Status + targetStatus: Status! } # Deatils about the Addon Component type AddonList { + # Name + name: String! - # Name - name: String! - - # Owner - owner: String! + # Owner + owner: String! - # Endpoint (if applicable) - endpoint: String! + # Endpoint (if applicable) + endpoint: String! } - # ============== DATA PLANE ======================= # Data Plane for a particular Mesh type DataPlane { + # Service Mesh Name + name: String! - # Service Mesh Name - name: String! - - # Members of the Mesh - proxies: [Container!]! + # Members of the Mesh + proxies: [Container!]! } type Container { - controlPlaneMemberName: String! - containerName: String! - image: String! - status: Container_Status - # args: NOT IMPLEMENTED - ports: [Container_Port] - # env: NOT IMPLEMENTED, - resources: Any + controlPlaneMemberName: String! + containerName: String! + image: String! + status: Container_Status + # args: NOT IMPLEMENTED + ports: [Container_Port] + # env: NOT IMPLEMENTED, + resources: Any } type Container_Status { - containerStatusName: String! - image: String! - state: Any - lastState: Any - ready: Boolean! - restartCount: Any - # image: String! - # imageID: String! - # containerID: String! - started: Boolean! - imageID: Any - containerID: Any - + containerStatusName: String! + image: String! + state: Any + lastState: Any + ready: Boolean! + restartCount: Any + # image: String! + # imageID: String! + # containerID: String! + started: Boolean! + imageID: Any + containerID: Any } type Container_Port { - name: String - containerPort: Int! - protocol: String! - + name: String + containerPort: Int! + protocol: String! } # ============== CONTROL PLANE ======================= # Filter Control Plane Query input ServiceMeshFilter { - - # Filter by Service Mesh - type: MeshType + # Filter by Service Mesh + type: MeshType } # Control Plane data for a particular Mesh type ControlPlane { + # Service Mesh Name + name: String! - # Service Mesh Name - name: String! - - # Members of the Mesh - members: [ControlPlaneMember!]! + # Members of the Mesh + members: [ControlPlaneMember!]! } # Member Details type ControlPlaneMember { + # Name + name: String! - # Name - name: String! + # Component + component: String! - # Component - component: String! + # Version + version: String! - # Version - version: String! + # Namespace + namespace: String! - # Namespace - namespace: String! - - # DataPlanes - data_planes: [Container!] + # DataPlanes + data_planes: [Container!] } # ============== OPERATOR ============================= # Input for status change of Meshery Operator input OperatorStatusInput { - - # Desired status for Meshery Operator - targetStatus: Status! + # Desired status for Meshery Operator + targetStatus: Status! } # Status of Meshery Operator and its controllers type OperatorStatus { + # Status of Meshery Operator + status: Status! - # Status of Meshery Operator - status: Status! - - # Verion of Meshery Operator - version: String! + # Verion of Meshery Operator + version: String! - # Details about various Controllers of Meshery Operator - controllers: [OperatorControllerStatus!]! + # Details about various Controllers of Meshery Operator + controllers: [OperatorControllerStatus!]! - # Error Logs encountered by Meshery Operator - error: Error + # Error Logs encountered by Meshery Operator + error: Error } # Controllers of Meshery Operator type OperatorControllerStatus { + # Controller Name + name: String! - # Controller Name - name: String! + # Controller Verison + version: String! - # Controller Verison - version: String! + # Controller Status + status: Status! - # Controller Status - status: Status! - - # Controller Error Log - error: Error + # Controller Error Log + error: Error } # ============== NAMESPACE ============================= # Type to define a k8s Namespace type NameSpace { - - # Namespace Name - namespace: String! + # Namespace Name + namespace: String! } # ============== Patterns ================================= type PatternPageResult { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - patterns: [PatternResult] + patterns: [PatternResult] } type PatternResult { - id: ID! - name: String! - user_id: String! - location: PatternLocation! - pattern_file: String! - canSupport: Boolean! - errmsg: String - created_at: String - updated_at: String + id: ID! + name: String! + user_id: String! + location: PatternLocation! + pattern_file: String! + canSupport: Boolean! + errmsg: String + created_at: String + updated_at: String } type PatternLocation { - branch: String - host: String - path: String - type: String + branch: String + host: String + path: String + type: String } # ============== Perf ================================= type PerfPageResult { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - results: [MesheryResult] + results: [MesheryResult] } type PerfPageProfiles { - page: Int! - page_size: Int! - total_count: Int! + page: Int! + page_size: Int! + total_count: Int! - profiles: [PerfProfile] + profiles: [PerfProfile] } type PerfProfile { - concurrent_request: Int! - created_at: String - duration: String! - endpoints: [String] - id: String! - last_run: String - load_generators: [String] - name: String - qps: Int - total_results: Int - updated_at: String - user_id: String! - request_headers: String - request_cookies: String - request_body: String - content_type: String - service_mesh: String + concurrent_request: Int! + created_at: String + duration: String! + endpoints: [String] + id: String! + last_run: String + load_generators: [String] + name: String + qps: Int + total_results: Int + updated_at: String + user_id: String! + request_headers: String + request_cookies: String + request_body: String + content_type: String + service_mesh: String } type MesheryResult { - meshery_id: String - name: String - mesh: String - performance_profile: String - test_id: String - runner_results: Map - server_metrics: String - server_board_config: String - test_start_time: String - user_id: String - updated_at: String - created_at: String + meshery_id: String + name: String + mesh: String + performance_profile: String + test_id: String + runner_results: Map + server_metrics: String + server_board_config: String + test_start_time: String + user_id: String + updated_at: String + created_at: String } input PageFilter { - page: String! - pageSize: String! - order: String - search: String - from: String - to: String + page: String! + pageSize: String! + order: String + search: String + from: String + to: String } + # ============== RESYNC ============================= # Type ReSyncActions define the actions involved during resync input ReSyncActions { - clearDB: String! - ReSync: String! + clearDB: String! + ReSync: String! } # ============== ROOT ================================= type Query { - - # Query details about Addons available (Eg. Prometheus and Grafana) - getAvailableAddons( - # Select Mesh Type - selector: MeshType - ): [AddonList!]! - - # Query Control Plane data for a Service Mesh (or all) in your cluster - getControlPlanes( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [ControlPlane!]! - - # Query Data Plane information for a Service Mesh (or all) in your cluster - getDataPlanes( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [DataPlane!]! - - # Query status of Meshery Operator in your cluster - getOperatorStatus: OperatorStatus - - # Query to resync the cluster discovery - resyncCluster( - # Selector to control several resync actions - selector: ReSyncActions - ): Status! - - # Check the Meshsync Status - getMeshsyncStatus: OperatorControllerStatus! - - # Check the Meshsync Status and deploy if not enabled - deployMeshsync: Status! - - # Check is Meshey Server is connected to NATS - getNatsStatus: OperatorControllerStatus! - - # Check is Meshey Server is connected to NATS, if not connect to the NATS Server - connectToNats: Status! - - # Query available Namesapces in your cluster - getAvailableNamespaces: [NameSpace!]! - - # Query for performance result - getPerfResult(id: ID!): MesheryResult - - # Query for fetching all results for profile ID - fetchResults(selector: PageFilter!, profileID: String!): PerfPageResult! - - # Query for fetching all results for profile ID - getPerformanceProfiles(selector: PageFilter!): PerfPageProfiles! - - # Query for fetching all results for profile ID - fetchAllResults(selector: PageFilter!): PerfPageResult! - - # Query for fetching all patterns with selector - fetchPatterns(selector: PageFilter!): PatternPageResult! + # Query details about Addons available (Eg. Prometheus and Grafana) + getAvailableAddons( + # Select Mesh Type + selector: MeshType + ): [AddonList!]! + + # Query Control Plane data for a Service Mesh (or all) in your cluster + getControlPlanes( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [ControlPlane!]! + + # Query Data Plane information for a Service Mesh (or all) in your cluster + getDataPlanes( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [DataPlane!]! + + # Query status of Meshery Operator in your cluster + getOperatorStatus: OperatorStatus + + # Query to resync the cluster discovery + resyncCluster( + # Selector to control several resync actions + selector: ReSyncActions + ): Status! + + # Check the Meshsync Status + getMeshsyncStatus: OperatorControllerStatus! + + # Check the Meshsync Status and deploy if not enabled + deployMeshsync: Status! + + # Check is Meshey Server is connected to NATS + getNatsStatus: OperatorControllerStatus! + + # Check is Meshey Server is connected to NATS, if not connect to the NATS Server + connectToNats: Status! + + # Query available Namesapces in your cluster + getAvailableNamespaces: [NameSpace!]! + + # Query for performance result + getPerfResult(id: ID!): MesheryResult + + # Query for fetching all results for profile ID + fetchResults(selector: PageFilter!, profileID: String!): PerfPageResult! + + # Query for fetching all results for profile ID + getPerformanceProfiles(selector: PageFilter!): PerfPageProfiles! + + # Query for fetching all results for profile ID + fetchAllResults(selector: PageFilter!): PerfPageResult! + + # Query for fetching all patterns with selector + fetchPatterns(selector: PageFilter!): PatternPageResult! + + # Query for getting workloads + getWorkloads(name: String, id: ID, trim: Boolean): [OAMCapability] + # Query for getting traits + getTraits(name: String, id: ID, trim: Boolean): [OAMCapability] + # Query for getting scopes + getScopes(name: String, id: ID, trim: Boolean): [OAMCapability] + # getOAMComponents(type: String!, name: String, id: ID, trim: Boolean): Any } -# +# type Mutation { + # Change the Addon Status + changeAddonStatus(input: AddonStatusInput): Status! - # Change the Addon Status - changeAddonStatus(input: AddonStatusInput): Status! - - # Change the Operator Status - changeOperatorStatus(input: OperatorStatusInput): Status! - + # Change the Operator Status + changeOperatorStatus(input: OperatorStatusInput): Status! } type Subscription { + # Listen to changes in status of Addons available (Eg. Prometheus and Grafana) + listenToAddonState( + # Select Mesh Type + selector: MeshType + ): [AddonList!]! + + # Listen to changes in Control Plane data for a Service Mesh (or all) in your cluster + listenToControlPlaneState( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [ControlPlane!]! + + # Listen to changes in Data Plane data for a Service Mesh (or all) in your cluster + listenToDataPlaneState( + # Filter Control Plane Query + filter: ServiceMeshFilter + ): [DataPlane!]! + + # Listen to changes in status of Meshery Operator in your cluster + listenToOperatorState: OperatorStatus! + + # Listen to changes in the list of available Namesapces in your cluster + listenToMeshSyncEvents: OperatorControllerStatus! + + # Listen to changes in Performance Profiles + subscribePerfProfiles(selector: PageFilter!): PerfPageProfiles! + + # Listen to all results for profile ID + subscribePerfResults(selector: PageFilter!, profileID: String!): PerfPageResult! + + # Listen to changes in Broker (NATS) Connection + subscribeBrokerConnection: Boolean! +} - # Listen to changes in status of Addons available (Eg. Prometheus and Grafana) - listenToAddonState( - # Select Mesh Type - selector: MeshType - ): [AddonList!]! - - # Listen to changes in Control Plane data for a Service Mesh (or all) in your cluster - listenToControlPlaneState( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [ControlPlane!]! - - # Listen to changes in Data Plane data for a Service Mesh (or all) in your cluster - listenToDataPlaneState( - # Filter Control Plane Query - filter: ServiceMeshFilter - ): [DataPlane!]! - - # Listen to changes in status of Meshery Operator in your cluster - listenToOperatorState: OperatorStatus! - - # Listen to changes in the list of available Namesapces in your cluster - listenToMeshSyncEvents: OperatorControllerStatus! - - # Listen to changes in Performance Profiles - subscribePerfProfiles(selector: PageFilter!): PerfPageProfiles! - - # Listen to all results for profile ID - subscribePerfResults(selector: PageFilter!, profileID: String!): PerfPageResult! - - # Listen to changes in Broker (NATS) Connection - subscribeBrokerConnection: Boolean! - +type OAMCapability { + oam_definition: Any + id: String + oam_ref_schema: String + host: String + restricted: Boolean + metadata: Any } From 6749e300677ee991fea96b231961d0b2ac876bf7 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Sun, 27 Mar 2022 10:16:46 -0500 Subject: [PATCH 02/50] Restructure makefile Signed-off-by: leecalcote --- Makefile | 102 ++++++++++++++++++++++----------------- install/Makefile.core.mk | 48 ++++++++++++++++++ 2 files changed, 106 insertions(+), 44 deletions(-) create mode 100644 install/Makefile.core.mk diff --git a/Makefile b/Makefile index 86435682dcf..74ddf13529d 100644 --- a/Makefile +++ b/Makefile @@ -1,42 +1,57 @@ -ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10002 localhost:10004 localhost:10005 localhost:10006 localhost:10007 localhost:10008 localhost:10009 localhost:10010 localhost:10012" - -MESHERY_CLOUD_LOCAL="http://localhost:9876" -MESHERY_CLOUD_DEV="http://localhost:9876" -MESHERY_CLOUD_PROD="https://meshery.layer5.io" -MESHERY_CLOUD_STAGING="https://staging-meshery.layer5.io" -GIT_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`) -GIT_COMMITSHA=$(shell git rev-list -1 HEAD) -RELEASE_CHANNEL="edge" -MESHERY_K8S_SKIP_COMP_GEN ?= TRUE -# Please do not remove the code below(the code already removed several times), those constant will help on local CI check, like $ make chart-readme or $ make golangci-run -GOPATH = $(shell go env GOPATH) -GOBIN = $(GOPATH)/bin -APPLICATIONCONFIGPATH="../install/apps.json" +# Copyright Meshery Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include install/Makefile.core.mk + +all: error run + +#----------------------------------------------------------------------------- +# Meshery Server, CLI and API Errors +#----------------------------------------------------------------------------- +.PHONY: error +error: + go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers --skip-dirs mesheryctl + +#----------------------------------------------------------------------------- +# Meshery CLI Native Build +#----------------------------------------------------------------------------- # Build the CLI for Meshery - `mesheryctl`. -# Build Meshery inside of a multi-stage Docker container. mesheryctl: cd mesheryctl; go build -o mesheryctl cmd/mesheryctl/main.go - DOCKER_BUILDKIT=1 docker build -t layer5/meshery . +#----------------------------------------------------------------------------- +# Meshery Server and UI Containerized Builds +#----------------------------------------------------------------------------- # `make docker` builds Meshery inside of a multi-stage Docker container. # This method does NOT require that you have Go, NPM, etc. installed locally. docker: DOCKER_BUILDKIT=1 docker build -t layer5/meshery --build-arg TOKEN=$(GLOBAL_TOKEN) --build-arg GIT_COMMITSHA=$(GIT_COMMITSHA) --build-arg GIT_VERSION=$(GIT_VERSION) --build-arg RELEASE_CHANNEL=${RELEASE_CHANNEL} . # Runs Meshery in a container locally and points to locally-running -# Meshery Cloud for user authentication. +# Meshery Cloud for user authentication. docker-run-local-cloud: (docker rm -f meshery) || true docker run --name meshery -d \ --link meshery-cloud:meshery-cloud \ - -e PROVIDER_BASE_URLS=$(MESHERY_CLOUD_LOCAL) \ + -e PROVIDER_BASE_URLS=$(REMOTE_PROVIDER_LOCAL) \ -e DEBUG=true \ -e ADAPTER_URLS=$(ADAPTER_URLS) \ -p 9081:8080 \ layer5/meshery ./meshery # Runs Meshery in a container locally and points to remote -# Meshery Cloud for user authentication. +# Remote Provider for user authentication. docker-run-cloud: (docker rm -f meshery) || true docker run --name meshery -d \ @@ -48,9 +63,19 @@ docker-run-cloud: -p 9081:8080 \ layer5/meshery ./meshery +#----------------------------------------------------------------------------- +# Meshery Server Native Builds +#----------------------------------------------------------------------------- +# setup wrk2 for local dev +# NOTE: setup-wrk does not work on Mac Catalina at the moment +setup-wrk2: + cd cmd; git clone https://github.com/layer5io/wrk2.git; cd wrk2; make; cd .. + +setup-nighthawk: + cd cmd; git clone https://github.com/layer5io/nighthawk-go.git; cd nighthawk-go; make setup; cd .. + # Runs Meshery on your local machine and points to locally-running # Meshery Cloud for user authentication. - run-local-cloud: error cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ @@ -66,7 +91,7 @@ run-local-cloud: error run-local: error cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ - PROVIDER_BASE_URLS=$(MESHERY_CLOUD_LOCAL) \ + PROVIDER_BASE_URLS=$(REMOTE_PROVIDER_LOCAL) \ PORT=9081 \ DEBUG=true \ ADAPTER_URLS=$(ADAPTER_URLS) \ @@ -106,15 +131,6 @@ run-fast-no-content: SKIP_DOWNLOAD_CONTENT=true \ go run main.go; -run-fast-cloud: error - cd cmd; go mod tidy; \ - PROVIDER_BASE_URLS=$(MESHERY_CLOUD_DEV) \ - PORT=9081 \ - DEBUG=true \ - ADAPTER_URLS=$(ADAPTER_URLS) \ - go run main.go; - - golangci-run: error GO111MODULE=off GOPROXY=direct GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.30.0; $(GOPATH)/bin/golangci-lint run @@ -128,6 +144,9 @@ proto: # export PATH=$PATH:`pwd`/../protoc/bin:$GOPATH/bin protoc -I meshes/ meshes/meshops.proto --go-grpc_out=./meshes/ --go_out=./meshes/ +#----------------------------------------------------------------------------- +# Meshery UI Native Builds +#----------------------------------------------------------------------------- # Installs dependencies for building the user interface. setup-ui-libs: cd ui; npm i; cd .. @@ -166,31 +185,27 @@ build-meshery-ui: build-provider-ui: cd provider-ui; npm run build && npm run export; cd .. -# setup wrk2 for local dev -# NOTE: setup-wrk does not work on Mac Catalina at the moment -setup-wrk2: - cd cmd; git clone https://github.com/layer5io/wrk2.git; cd wrk2; make; cd .. - -setup-nighthawk: - cd cmd; git clone https://github.com/layer5io/nighthawk-go.git; cd nighthawk-go; make setup; cd .. - +#----------------------------------------------------------------------------- +# Meshery Docs +#----------------------------------------------------------------------------- #Incorporating Make docs commands from the Docs Makefile jekyll=bundle exec jekyll site: cd docs; bundle install; $(jekyll) serve --drafts --livereload --config _config_dev.yml - build-docs: cd docs; $(jekyll) build --drafts docker-docs: cd docs; docker run --name meshery-docs --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:4.0.0 bash -c "bundle install; jekyll serve --drafts --livereload" +#----------------------------------------------------------------------------- +# Meshery Helm Charts +#----------------------------------------------------------------------------- .PHONY: chart-readme chart-readme: helm-lint - .PHONY: chart-readme chart-readme: chart-readme-operator chart-readme: chart-readme-meshery @@ -209,7 +224,9 @@ helm-lint-operator: helm-lint-meshery: helm lint install/kubernetes/helm/meshery --with-subcharts - +#----------------------------------------------------------------------------- +# Meshery APIs +#----------------------------------------------------------------------------- swagger-spec: swagger generate spec -o ./helpers/swagger.yaml --scan-models @@ -226,6 +243,3 @@ graphql-docs: gqlgen-generate: cd internal/graphql; go run -mod=mod github.com/99designs/gqlgen generate -.PHONY: error -error: - go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers --skip-dirs mesheryctl diff --git a/install/Makefile.core.mk b/install/Makefile.core.mk new file mode 100644 index 00000000000..f0271930514 --- /dev/null +++ b/install/Makefile.core.mk @@ -0,0 +1,48 @@ +# Copyright Meshery Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------------- +# Global Variables +#----------------------------------------------------------------------------- +GIT_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`) +GIT_COMMITSHA=$(shell git rev-list -1 HEAD) + +GOPATH = $(shell go env GOPATH) +GOBIN = $(GOPATH)/bin + +SHELL :=/bin/bash -o pipefail + +#----------------------------------------------------------------------------- +# Components +#----------------------------------------------------------------------------- +ADAPTER_URLS := "localhost:10000 localhost:10001 localhost:10002 localhost:10004 localhost:10005 localhost:10006 localhost:10007 localhost:10008 localhost:10009 localhost:10010 localhost:10012" + +#----------------------------------------------------------------------------- +# Providers +#----------------------------------------------------------------------------- +REMOTE_PROVIDER_LOCAL="http://localhost:9876" +MESHERY_CLOUD_DEV="http://localhost:9876" +MESHERY_CLOUD_PROD="https://meshery.layer5.io" +MESHERY_CLOUD_STAGING="https://staging-meshery.layer5.io" + +#----------------------------------------------------------------------------- +# Server +#----------------------------------------------------------------------------- +MESHERY_K8S_SKIP_COMP_GEN ?= TRUE +APPLICATIONCONFIGPATH="../install/apps.json" + +#----------------------------------------------------------------------------- +# Build +#----------------------------------------------------------------------------- +RELEASE_CHANNEL="edge" \ No newline at end of file From 22fa12295913d6eb23f1a6de22e131c734338c90 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Sun, 27 Mar 2022 21:38:57 -0500 Subject: [PATCH 03/50] self-documenting make rules Signed-off-by: leecalcote --- Makefile | 123 ++++++++++++++++++---------------- cmd/wrk2 | 1 + install/Makefile.show-help.mk | 5 ++ 3 files changed, 70 insertions(+), 59 deletions(-) create mode 160000 cmd/wrk2 create mode 100644 install/Makefile.show-help.mk diff --git a/Makefile b/Makefile index 74ddf13529d..e2148ca5ca3 100644 --- a/Makefile +++ b/Makefile @@ -13,34 +13,22 @@ # limitations under the License. include install/Makefile.core.mk +include install/Makefile.show-help.mk -all: error run - -#----------------------------------------------------------------------------- -# Meshery Server, CLI and API Errors #----------------------------------------------------------------------------- -.PHONY: error -error: - go run github.com/layer5io/meshkit/cmd/errorutil -d . analyze -i ./helpers -o ./helpers --skip-dirs mesheryctl - +# Docker-based Builds #----------------------------------------------------------------------------- -# Meshery CLI Native Build -#----------------------------------------------------------------------------- -# Build the CLI for Meshery - `mesheryctl`. -mesheryctl: - cd mesheryctl; go build -o mesheryctl cmd/mesheryctl/main.go - -#----------------------------------------------------------------------------- -# Meshery Server and UI Containerized Builds -#----------------------------------------------------------------------------- -# `make docker` builds Meshery inside of a multi-stage Docker container. -# This method does NOT require that you have Go, NPM, etc. installed locally. +## Build Meshery Server and UI containers. docker: + # `make docker` builds Meshery inside of a multi-stage Docker container. + # This method does NOT require that you have Go, NPM, etc. installed locally. DOCKER_BUILDKIT=1 docker build -t layer5/meshery --build-arg TOKEN=$(GLOBAL_TOKEN) --build-arg GIT_COMMITSHA=$(GIT_COMMITSHA) --build-arg GIT_VERSION=$(GIT_VERSION) --build-arg RELEASE_CHANNEL=${RELEASE_CHANNEL} . -# Runs Meshery in a container locally and points to locally-running -# Meshery Cloud for user authentication. + +## Meshery Cloud for user authentication. +## Runs Meshery in a container locally and points to locally-running docker-run-local-cloud: + (docker rm -f meshery) || true docker run --name meshery -d \ --link meshery-cloud:meshery-cloud \ @@ -50,8 +38,8 @@ docker-run-local-cloud: -p 9081:8080 \ layer5/meshery ./meshery -# Runs Meshery in a container locally and points to remote -# Remote Provider for user authentication. +## Runs Meshery in a container locally and points to remote +## Remote Provider for user authentication. docker-run-cloud: (docker rm -f meshery) || true docker run --name meshery -d \ @@ -66,16 +54,17 @@ docker-run-cloud: #----------------------------------------------------------------------------- # Meshery Server Native Builds #----------------------------------------------------------------------------- -# setup wrk2 for local dev -# NOTE: setup-wrk does not work on Mac Catalina at the moment +## Setup wrk2 for local development. setup-wrk2: + echo "setup-wrk does not work on Mac Catalina at the moment" cd cmd; git clone https://github.com/layer5io/wrk2.git; cd wrk2; make; cd .. +## ## Setup nighthawk for local development. setup-nighthawk: cd cmd; git clone https://github.com/layer5io/nighthawk-go.git; cd nighthawk-go; make setup; cd .. -# Runs Meshery on your local machine and points to locally-running -# Meshery Cloud for user authentication. +## Run Meshery on your local machine and point to locally-running +## Meshery Cloud for user authentication. run-local-cloud: error cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ @@ -86,8 +75,8 @@ run-local-cloud: error ./meshery; \ cd .. -# Builds and runs Meshery to run on your local machine. -# and points to remote Meshery Cloud for user authentication. +## Build and run Meshery to run on your local machine +## and point to remote Meshery Cloud for user authentication. run-local: error cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ @@ -99,6 +88,7 @@ run-local: error ./meshery; \ cd .. +## Buiild and run Meshery Server on your local machine. run-fast: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ @@ -109,6 +99,7 @@ run-fast: APP_PATH=$(APPLICATIONCONFIGPATH) \ go run main.go; +## Build and run Meshery Server with no Kubernetes components on your local machine. run-fast-skip-compgen: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ @@ -120,6 +111,7 @@ run-fast-skip-compgen: SKIP_COMP_GEN=true \ go run main.go; +## Build and run Meshery Server with no seed content. run-fast-no-content: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ @@ -131,10 +123,12 @@ run-fast-no-content: SKIP_DOWNLOAD_CONTENT=true \ go run main.go; +## Lint check Meshery Server. golangci-run: error - GO111MODULE=off GOPROXY=direct GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.30.0; + GO111MODULE=off GOPROXY=direct GOSUMDB=off go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.2; $(GOPATH)/bin/golangci-lint run +## Build Meshery's protobufs. proto: # see https://grpc.io/docs/languages/go/quickstart/ # go get -u google.golang.org/grpc @@ -147,41 +141,41 @@ proto: #----------------------------------------------------------------------------- # Meshery UI Native Builds #----------------------------------------------------------------------------- -# Installs dependencies for building the user interface. +## Install dependencies for building Meshery UI. setup-ui-libs: cd ui; npm i; cd .. cd provider-ui; npm i; cd .. -# Runs the Meshery UI interface on your local machine. +## Run Meshery UI on your local machine. Listen for changes. run-ui-dev: cd ui; npm run dev; cd .. -# Runs the Provider UI interface on your local machine. +## Run Meshery Provider UI on your local machine. Listen for changes. run-provider-ui-dev: cd provider-ui; npm run dev; cd .. -# Runs the lint on Meshery UI interface on your local machine. -run-ui-lint: +## Lint check Meshery UI and Provider UI on your local machine. +lint-ui: cd ui; npm run lint; cd .. -# Runs the lint on Meshery UI interface on your local machine. -run-provider-ui-lint: +## Lint check Meshery Provider UI on your local machine. +lint-provider-ui: cd provider-ui; npm run lint; cd .. -# Runs the test on Provider UI interface on your local machine. -run-provider-ui-test: +## Test Meshery Provider UI on your local machine. +test-provider-ui: cd provider-ui; npm run test; cd .. -# Builds all user interfaces on your local machine. +## Buils all Meshery UIs on your local machine. build-ui: cd ui; npm run build && npm run export; cd .. cd provider-ui; npm run build && npm run export; cd .. -# Builds only the meshery user interface on your local machine +## Build only Meshery UI on your local machine. build-meshery-ui: cd ui; npm run build && npm run export; cd .. -# Builds only the provider user interface on your local machine +## Builds only the provider user interface on your local machine build-provider-ui: cd provider-ui; npm run build && npm run export; cd .. @@ -191,55 +185,66 @@ build-provider-ui: #Incorporating Make docs commands from the Docs Makefile jekyll=bundle exec jekyll +## Run Meshery Docs. Listen for changes. site: cd docs; bundle install; $(jekyll) serve --drafts --livereload --config _config_dev.yml +## Build Meshery Docs on your local machine. build-docs: cd docs; $(jekyll) build --drafts +## Run Meshery Docs in a Docker container. Listen for changes. docker-docs: cd docs; docker run --name meshery-docs --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:4.0.0 bash -c "bundle install; jekyll serve --drafts --livereload" #----------------------------------------------------------------------------- # Meshery Helm Charts #----------------------------------------------------------------------------- -.PHONY: chart-readme -chart-readme: helm-lint +.PHONY: docs-charts +## Generate all Meshery Helm Chart documentation in markdown format. +docs-charts: docs-chart-operator docs-chart-meshery -.PHONY: chart-readme -chart-readme: chart-readme-operator -chart-readme: chart-readme-meshery -chart-readme-operator: +## Generate Meshery Operator Helm Chart documentation in markdown format. +docs-chart-operator: GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs $(GOPATH)/bin/helm-docs -c install/kubernetes/helm/meshery-operator -chart-readme-meshery: + +## Generate Meshery Server and Adapters Helm Chart documentation in markdown format. +docs-chart-meshery: GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs $(GOPATH)/bin/helm-docs -c install/kubernetes/helm/meshery -.PHONY: helm-lint -helm-lint: helm-lint-operator -helm-lint: helm-lint-meshery -helm-lint-operator: +.PHONY: lint-helm +## Lint all of Meshery's Helm Charts +lint-helm: lint-helm-operator lint-helm-meshery +## Lint Meshery Operator Helm Chart +lint-helm-operator: helm lint install/kubernetes/helm/meshery-operator --with-subcharts -helm-lint-meshery: +## Lint Meshery Server and Adapter Helm Charts +lint-helm-meshery: helm lint install/kubernetes/helm/meshery --with-subcharts #----------------------------------------------------------------------------- # Meshery APIs #----------------------------------------------------------------------------- -swagger-spec: +## Generate Meshery REST API specifications +gen-swagger: swagger generate spec -o ./helpers/swagger.yaml --scan-models -swagger-run:swagger-spec +## Generate and servc Meshery REST API specifications +run-swagger:swagger-spec swagger serve ./helpers/swagger.yaml -swagger-docs: +## Build Meshery REST API documentation +docs-swagger: swagger generate spec -o ./docs/_data/swagger.yml --scan-models; \ swagger flatten ./docs/_data/swagger.yml -o ./docs/_data/swagger.yml --with-expand --format=yaml -graphql-docs: +## Build Meshery GraphQL API documentation +docs-graphql: cd docs; build-docs; bundle exec rake graphql:compile_docs -gqlgen-generate: +## Build Meshery GraphQl API specifications +gen-gqlgen: cd internal/graphql; go run -mod=mod github.com/99designs/gqlgen generate diff --git a/cmd/wrk2 b/cmd/wrk2 new file mode 160000 index 00000000000..f4884e417b3 --- /dev/null +++ b/cmd/wrk2 @@ -0,0 +1 @@ +Subproject commit f4884e417b36b1f93363fb555a47c4b3bbc9f063 diff --git a/install/Makefile.show-help.mk b/install/Makefile.show-help.mk new file mode 100644 index 00000000000..8ae84002a2c --- /dev/null +++ b/install/Makefile.show-help.mk @@ -0,0 +1,5 @@ +.DEFAULT_GOAL := show-help +# See for explanation. +.PHONY: show-help +show-help: + @echo "$$(tput bold)Available rules:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr') \ No newline at end of file From a19a201e1f68029f2f875c2349a41b3da88ca995 Mon Sep 17 00:00:00 2001 From: Shaowei Pu <18391791+m9rco@users.noreply.github.com> Date: Mon, 28 Mar 2022 11:06:38 +0800 Subject: [PATCH 04/50] Update incorrect URL authentication mode --- ui/utils/URLValidator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/utils/URLValidator.js b/ui/utils/URLValidator.js index 88f98eb0e57..983a8e35a10 100644 --- a/ui/utils/URLValidator.js +++ b/ui/utils/URLValidator.js @@ -1,7 +1,7 @@ export const URLValidator = (url) => { const compulsoryProtocolValidUrlPattern = new RegExp( "(^(http|https|nats|tcp):\\/\\/)" + // compulsory protocol - "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name + "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.{0,})+[a-z]{0,}|" + // domain name "localhost|" + "((\\d{1,3}.){3}\\d{1,3}))" + // OR ip (v4) address "(\\:\\d+)?(/[-a-z\\d%_.~+]*)*" + // port and path @@ -11,4 +11,4 @@ export const URLValidator = (url) => { ); // fragment locator return url?.match(compulsoryProtocolValidUrlPattern); -}; \ No newline at end of file +}; From 6bac43236b429c02b66471113e52c9b954688e0d Mon Sep 17 00:00:00 2001 From: suod-NithishKarthik Date: Mon, 28 Mar 2022 12:33:55 +0530 Subject: [PATCH 05/50] style: Set the vertical overflow to be hidden Signed-off-by: suod-NithishKarthik --- .../ui/src/components/ExtensionComponent.js | 60 +++++++++---------- .../ui/src/styles.css | 6 +- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index 2909ddb1eb9..6423a4ffe7a 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -1,4 +1,4 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; import PropTypes from "prop-types"; import { withStyles } from "@material-ui/core/styles"; import { NoSsr, Typography, Grid, Link } from "@material-ui/core"; @@ -22,7 +22,7 @@ const useStyles = makeStyles((theme) => ({ textAlign: "center", backgroundColor: "#222C32", padding: "5rem", - minHeight: "100vh" + maxHeight: "100vh" }, main: { margin: theme.spacing(5), @@ -115,40 +115,40 @@ const ExtensionsComponent = props => { return (
- - Design and operate your cloud native deployments with the extensible management plane, Meshery. + + Design and operate your cloud native deployments with the extensible management plane, Meshery.
- - - CONFIGURE YOUR MESHERY DEPLOYMENT - + + + CONFIGURE YOUR MESHERY DEPLOYMENT +
- Account -
+ Account +
-
- Deploy a Service Mesh -
-
- -
- -
-
-
-
-
- -
-
-
+
+ Deploy a Service Mesh +
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
-
-
-
-
+
+
diff --git a/install/docker-desktop-extension/ui/src/styles.css b/install/docker-desktop-extension/ui/src/styles.css index ccd6a5b5939..f8809cc898e 100644 --- a/install/docker-desktop-extension/ui/src/styles.css +++ b/install/docker-desktop-extension/ui/src/styles.css @@ -1,6 +1,10 @@ .sans-serif { font-family: -apple-system, 'avenir next', avenir, roboto, noto, 'helvetica neue', helvetica, ubuntu, 'franklin gothic medium', 'century gothic', sans-serif; } +body{ + overflow-y: hidden; +} + *{ margin:0; padding: 0; -} \ No newline at end of file +} From 5b06c8ed47bc8bb4a883a3f3972fddcc8eadf057 Mon Sep 17 00:00:00 2001 From: Aditya Chatterjee Date: Mon, 28 Mar 2022 20:16:50 +0530 Subject: [PATCH 06/50] lint_dde Signed-off-by: Aditya Chatterjee --- .../ui/src/components/ExtensionComponent.js | 67 +++++++++++-------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index 2909ddb1eb9..4eddadf4a6a 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -115,40 +115,53 @@ const ExtensionsComponent = props => { return (
- - Design and operate your cloud native deployments with the extensible management plane, Meshery. + + Design and operate your cloud native deployments with the extensible management plane, Meshery.
- - + CONFIGURE YOUR MESHERY DEPLOYMENT - +
- Account -
+ Account +
+ +
- Deploy a Service Mesh -
-
- -
- -
-
-
-
-
- -
-
-
-
-
-
-
-
+ Deploy a Service Mesh +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
From dc9c5818afc9119cdb1cfc38248f1adf94c7dfd8 Mon Sep 17 00:00:00 2001 From: Aditya Chatterjee Date: Mon, 28 Mar 2022 20:31:01 +0530 Subject: [PATCH 07/50] added target to dockerfile Signed-off-by: Aditya Chatterjee --- install/docker-desktop-extension/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 280eb405414..9cedb8c01e2 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -18,8 +18,8 @@ WORKDIR /ui COPY ui/package.json /ui/package.json COPY ui/package-lock.json /ui/package-lock.json ARG TARGETARCH -RUN --mount=type=cache,target=/usr/src/app/.npm \ - npm set cache /usr/src/app/.npm && \ +RUN --mount=type=cache,target=/usr/src/app/.npm-${TARGETARCH} \ + npm set cache /usr/src/app/.npm-${TARGETARCH} && \ npm ci # install COPY ui /ui From 6df417c6ab158b426837c4e43db10f00220415cb Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 10:09:49 -0500 Subject: [PATCH 08/50] build updates and icon Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 1 + install/docker-desktop-extension/README.md | 4 ++-- .../img}/Docker Desktop Extension for Meshery.png | Bin ...r-desktop-extension-for-meshery-architecture.png | Bin .../docs/img/meshery-logo-light.svg | 1 + 5 files changed, 4 insertions(+), 2 deletions(-) rename install/docker-desktop-extension/{ => docs/img}/Docker Desktop Extension for Meshery.png (100%) rename install/docker-desktop-extension/{ => docs/img}/docker-desktop-extension-for-meshery-architecture.png (100%) create mode 100755 install/docker-desktop-extension/docs/img/meshery-logo-light.svg diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 2ff99e18a58..c0c3bf190bd 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -61,6 +61,7 @@ jobs: with: platforms: linux/amd64 context: "{{defaultContext}}:install/docker-desktop-extension" + file: /install/docker-desktop-extension/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/install/docker-desktop-extension/README.md b/install/docker-desktop-extension/README.md index ad7facdcf15..1394867cba0 100644 --- a/install/docker-desktop-extension/README.md +++ b/install/docker-desktop-extension/README.md @@ -47,11 +47,11 @@ The Docker Desktop Extension for Meshery extends Docker Desktop’s position as 1. Install any service mesh with the check of a box. 1. Import your Docker Compose apps for visual design and deployment to Kubernetes and service meshes. -

+

## Docker Desktop Extension for Meshery Architecture The Docker Desktop Extension for Meshery deploys Meshery to your local Docker host as a Docker Compose application. -

+

Learn more about Meshery's architecture. diff --git a/install/docker-desktop-extension/Docker Desktop Extension for Meshery.png b/install/docker-desktop-extension/docs/img/Docker Desktop Extension for Meshery.png similarity index 100% rename from install/docker-desktop-extension/Docker Desktop Extension for Meshery.png rename to install/docker-desktop-extension/docs/img/Docker Desktop Extension for Meshery.png diff --git a/install/docker-desktop-extension/docker-desktop-extension-for-meshery-architecture.png b/install/docker-desktop-extension/docs/img/docker-desktop-extension-for-meshery-architecture.png similarity index 100% rename from install/docker-desktop-extension/docker-desktop-extension-for-meshery-architecture.png rename to install/docker-desktop-extension/docs/img/docker-desktop-extension-for-meshery-architecture.png diff --git a/install/docker-desktop-extension/docs/img/meshery-logo-light.svg b/install/docker-desktop-extension/docs/img/meshery-logo-light.svg new file mode 100755 index 00000000000..4d4a5cb50d5 --- /dev/null +++ b/install/docker-desktop-extension/docs/img/meshery-logo-light.svg @@ -0,0 +1 @@ +meshery-logo-light \ No newline at end of file From c8b1fe6ce8693a3fa7693f55956945620ad66fae Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 10:12:48 -0500 Subject: [PATCH 09/50] merge w/master Signed-off-by: leecalcote --- install/docker-desktop-extension/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 9cedb8c01e2..334d5a0fbf2 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -31,7 +31,8 @@ ARG GIT_STRIPPED_VERSION LABEL org.opencontainers.image.title="meshery" \ org.opencontainers.image.description="Meshery" \ org.opencontainers.image.vendor="Layer5, Inc." \ - com.docker.desktop.extension.api.version=">= 0.2.0" + com.docker.desktop.extension.api.version=">= 0.2.0" \ + com.docker.desktop.extension.icon="install/docker-desktop-extension/docs/img/meshery-logo-light.svg" COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . From 4d9b490758d650b91e0b0e40e54b35094d94f3b8 Mon Sep 17 00:00:00 2001 From: Lee Calcote Date: Mon, 28 Mar 2022 10:22:28 -0500 Subject: [PATCH 10/50] Update Dockerfile --- install/docker-desktop-extension/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 334d5a0fbf2..a35d8d1baaa 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -32,7 +32,7 @@ LABEL org.opencontainers.image.title="meshery" \ org.opencontainers.image.description="Meshery" \ org.opencontainers.image.vendor="Layer5, Inc." \ com.docker.desktop.extension.api.version=">= 0.2.0" \ - com.docker.desktop.extension.icon="install/docker-desktop-extension/docs/img/meshery-logo-light.svg" + com.docker.desktop.extension.icon="https://raw.githubusercontent.com/meshery/meshery/master/install/docker-desktop-extension/docs/img/meshery-logo-light.svg" COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . From c5962efefa6f2debc6768189735779de0cb32907 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 10:29:24 -0500 Subject: [PATCH 11/50] renamed logo to white Signed-off-by: leecalcote --- install/docker-desktop-extension/Dockerfile | 2 +- .../{meshery-logo-light.svg => meshery-logo-white.svg} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename install/docker-desktop-extension/{meshery-logo-light.svg => meshery-logo-white.svg} (97%) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 334d5a0fbf2..70300c6bb45 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -44,6 +44,6 @@ ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ RUN unzip /mesheryctl/windows/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip -d /mesheryctl/windows/ RUN unzip /mesheryctl/linux/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip -d /mesheryctl/linux/ -COPY meshery-logo-light.svg . +COPY meshery-logo-white.svg . COPY --from=client-builder /ui/build ui CMD /service -socket /run/guest-services/extension-meshery.sock diff --git a/install/docker-desktop-extension/meshery-logo-light.svg b/install/docker-desktop-extension/meshery-logo-white.svg similarity index 97% rename from install/docker-desktop-extension/meshery-logo-light.svg rename to install/docker-desktop-extension/meshery-logo-white.svg index 3d4ca0704e8..1a48c02e65a 100644 --- a/install/docker-desktop-extension/meshery-logo-light.svg +++ b/install/docker-desktop-extension/meshery-logo-white.svg @@ -10,7 +10,7 @@ xmlSpace="preserve" > - {"meshery-logo-light"} + Meshery Date: Mon, 28 Mar 2022 10:29:56 -0500 Subject: [PATCH 12/50] different relative path to dockerfile Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 4 ++-- install/docker-desktop-extension/metadata.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index c0c3bf190bd..2da6ebc7027 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -60,8 +60,8 @@ jobs: uses: docker/build-push-action@v2 with: platforms: linux/amd64 - context: "{{defaultContext}}:install/docker-desktop-extension" - file: /install/docker-desktop-extension/Dockerfile + context: ./install/docker-desktop-extension + file: ./install/docker-desktop-extension/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/install/docker-desktop-extension/metadata.json b/install/docker-desktop-extension/metadata.json index 460bdf0167b..cfeeafdac73 100644 --- a/install/docker-desktop-extension/metadata.json +++ b/install/docker-desktop-extension/metadata.json @@ -1,7 +1,7 @@ { "name": "Meshery", "provider": "Layer5, Inc.", - "icon": "meshery-logo-light.svg", + "icon": "meshery-logo-white.svg", "vm": { "composefile": "docker-compose.yaml", "exposes": { From a617ff7462b16dee5c9a2f50014d43e8c5246bf9 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 10:37:56 -0500 Subject: [PATCH 13/50] remove platform Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 2da6ebc7027..612e3c0bc6f 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -59,9 +59,7 @@ jobs: name: Build and Push uses: docker/build-push-action@v2 with: - platforms: linux/amd64 - context: ./install/docker-desktop-extension - file: ./install/docker-desktop-extension/Dockerfile + context: "{{defaultContext}}:install/docker-desktop-extension" push: true tags: ${{ steps.meta.outputs.tags }} From b8ba9a6d84d618370ebd726d6db40a54df502b62 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 15:41:07 +0000 Subject: [PATCH 14/50] [Docs] Release Notes for Meshery Signed-off-by: l5io --- docs/_releases/v0.6.0-rc-5g.md | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/_releases/v0.6.0-rc-5g.md diff --git a/docs/_releases/v0.6.0-rc-5g.md b/docs/_releases/v0.6.0-rc-5g.md new file mode 100644 index 00000000000..54893a715c9 --- /dev/null +++ b/docs/_releases/v0.6.0-rc-5g.md @@ -0,0 +1,67 @@ +--- +layout: release +date: 2022-03-28 +tag: v0.6.0-rc-5g +--- + +## What's New +## 🔤 General +- added targetarch to dockerfile @warunicorn19 (#5289) +- changed ui @warunicorn19 (#5288) +- [Docs] DDE: readme @leecalcote (#5284) +- Fix: failing deployement of argo-rollout due to invalid name @Abhishek-kumar09 (#5272) +- Fix empty dependson @Revolyssup (#5271) +- Fix falsy error message in bash script @Revolyssup (#5246) +- [DDE] Failing build for UI @sudo-NithishKarthik (#5268) +- initial ui for DDE @warunicorn19 (#5265) +- [Fix] Use relative path for build files generated by react @sudo-NithishKarthik (#5261) +- ui-dde to ui @warunicorn19 (#5259) +- Correcting UI build @hershd23 (#5256) +- Bump minimist from 1.2.5 to 1.2.6 in /install/docker-desktop-extension/ui-dde @dependabot (#5253) +- [DDE] Reinitialize Extension @leecalcote (#5252) +- Reduces Dockerfile for DDE to only build dde-ui @hershd23 (#5251) + +## ⌨️ Meshery CLI + +- [Meshery] Handling unit tests failure @piyushsingariya (#5245) +- [CI] Fix golangci-lint to avoid legacy lint errors @alphaX86 (#5270) + +## 🖥 Meshery UI + +- fix popper z-index problems with second tooltip @Abhishek-kumar09 (#5286) +- [UI]Added EventListner in SliderButton @Harshit-Dandriyal (#5277) +- Fixed routing to Lifecycle menu @MUzairS15 (#5276) +- [UI]Resolved ui bug of lagging side list Navs on hovering @Harshit-Dandriyal (#5275) +- [UI/RJSF] remove custom memoized i/p fields and use widgets instead @Abhishek-kumar09 (#5263) +- [UI] fixed meshery-ui not showing up after following make build-ui(Meshery docs) @Harshit-Dandriyal (#5237) +- [Chore] Security: vulnerability patches in dependencies @leecalcote (#5258) +- Bump minimist from 1.2.5 to 1.2.6 in /provider-ui @dependabot (#5254) + +## 🔋 Patterns, Filters, Applications + +- Sanitize the pattern before validation for failing K8s components @Revolyssup (#5273) +- Fix: retrieve the cytoscape element Id from extenstion interface @Abhishek-kumar09 (#5248) + +## 🧰 Maintenance + +- [CI] DDE Build Updates @leecalcote (#5290) +- [CI] Fix golangci-lint to avoid legacy lint errors @alphaX86 (#5270) +- [Chore] Reducing noise level of info log @leecalcote (#5257) +- [CI] Docker Desktop Extension: refactor for DDE build only @leecalcote (#5264) +- Bump minimist from 1.2.5 to 1.2.6 in /provider-ui @dependabot (#5254) +- [CI] Chore: remove make command for go1.16 @leecalcote (#5247) + +## 📖 Documentation + +- [Docs]Added top margin so that in-page anchor tags align with menu bar @Harshit-Dandriyal (#5266) +- [Docs] Promote oam REST endpoint from experimental @alceil (#5233) +- [Chore] Security: vulnerability patches in dependencies @leecalcote (#5258) + +## 🔒 Security + +- [Chore] Security: vulnerability patches in dependencies @leecalcote (#5258) + +## 👨🏽‍💻 Contributors + +Thank you to our contributors for making this release possible: +@Abhishek-kumar09, @Harshit-Dandriyal, @MUzairS15, @Revolyssup, @alceil, @alphaX86, @dependabot, @dependabot[bot], @hershd23, @l5io, @leecalcote, @piyushsingariya, @sudo-NithishKarthik and @warunicorn19 From 91d986078e3007f8cdb2b8bdc2e4e724806a73cc Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:01:01 -0500 Subject: [PATCH 15/50] comment out docker hub update Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 612e3c0bc6f..5f4ef255d72 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -63,10 +63,10 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: meshery/meshery-docker-desktop-extension + # - + # name: Docker Hub Description + # uses: peter-evans/dockerhub-description@v3 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + # repository: meshery/meshery-docker-desktop-extension From 0eacca0da7abcf8c8a67130a2269c08f41015186 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:07:34 -0500 Subject: [PATCH 16/50] semver for dde; v3 for stable release Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 1 - .github/workflows/build-and-release.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 5f4ef255d72..1e26af66238 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -46,7 +46,6 @@ jobs: type=raw,value={{sha}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest - type=semver,pattern={{version}} - name: Login to DockerHub diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f63a162ea38..dfc925ae33b 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -32,7 +32,7 @@ jobs: docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::8} - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v2.4.3 + uses: peter-evans/dockerhub-description@v3 env: DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} From ae7c67647cce428906ec184677643226eeb7248f Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:08:59 -0500 Subject: [PATCH 17/50] revert to last known good build Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 1e26af66238..a2e236b04db 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -46,7 +46,6 @@ jobs: type=raw,value={{sha}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest - - name: Login to DockerHub uses: docker/login-action@v1 @@ -60,12 +59,4 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - tags: ${{ steps.meta.outputs.tags }} - - # - - # name: Docker Hub Description - # uses: peter-evans/dockerhub-description@v3 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - # repository: meshery/meshery-docker-desktop-extension + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file From 15cc28dcc47c844d4cd2c856a16182827a4ea803 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:17:51 -0500 Subject: [PATCH 18/50] init cache bust Signed-off-by: leecalcote --- .github/workflows/dde-cache-bust.yml | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/dde-cache-bust.yml diff --git a/.github/workflows/dde-cache-bust.yml b/.github/workflows/dde-cache-bust.yml new file mode 100644 index 00000000000..6166901c3fb --- /dev/null +++ b/.github/workflows/dde-cache-bust.yml @@ -0,0 +1,72 @@ +name: Docker Desktop Extension for Meshery + # TODO + ## 1) Incorporate mesheryctl binaries into each DDE image + +on: + push: + tags: + - 'v*' + branches: + - 'master' + paths-ignore: + - 'docs/**' + + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Determine Release Channel + id: release-channel + run: | + if [[ ${{ github.ref }} = refs/tags* ]] + then + echo "RELEASE_CHANNEL=stable" >> $GITHUB_ENV + else + echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV + fi + echo "Release channel determined to be $RELEASE_CHANNEL" + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Docker Meta + id: meta + uses: docker/metadata-action@v3 + with: + images: meshery/meshery-docker-desktop-extension + flavor: | + latest=false + prefix=${{env.RELEASE_CHANNEL}}- + tags: | + type=raw,value={{sha}} + type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=raw,value=latest + type=semver,pattern={{version}} + + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - + name: Build and Push + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}:install/docker-desktop-extension" + push: true + tags: ${{ steps.meta.outputs.tags }} + + - + name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: meshery/meshery-docker-desktop-extension \ No newline at end of file From 71d0fa10ef83be6cde359ce4488b81d5ff61972f Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:22:17 -0500 Subject: [PATCH 19/50] clear cache Signed-off-by: leecalcote --- .github/workflows/dde-cache-bust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/dde-cache-bust.yml b/.github/workflows/dde-cache-bust.yml index 6166901c3fb..3d2f97125bb 100644 --- a/.github/workflows/dde-cache-bust.yml +++ b/.github/workflows/dde-cache-bust.yml @@ -55,6 +55,11 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Move cache + run: + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: Build and Push uses: docker/build-push-action@v2 From edce5dc9d26fb6a52be6fabe2907d7ffc6d5f621 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:27:15 -0500 Subject: [PATCH 20/50] remove hub update Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 12 +++++++++++- .github/workflows/dde-cache-bust.yml | 10 +--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index a2e236b04db..58bef85471f 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -46,6 +46,8 @@ jobs: type=raw,value={{sha}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest + type=semver,pattern={{version}} + - name: Login to DockerHub uses: docker/login-action@v1 @@ -59,4 +61,12 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + + - + name: Docker Hub Description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: meshery/meshery-docker-desktop-extension \ No newline at end of file diff --git a/.github/workflows/dde-cache-bust.yml b/.github/workflows/dde-cache-bust.yml index 3d2f97125bb..072106d099b 100644 --- a/.github/workflows/dde-cache-bust.yml +++ b/.github/workflows/dde-cache-bust.yml @@ -66,12 +66,4 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - tags: ${{ steps.meta.outputs.tags }} - - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: meshery/meshery-docker-desktop-extension \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file From adea2b0acbb8fd7b64eca3853a2dd08585cefebb Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 11:48:27 -0500 Subject: [PATCH 21/50] remove errant submodule Signed-off-by: leecalcote --- cmd/wrk2 | 1 - 1 file changed, 1 deletion(-) delete mode 160000 cmd/wrk2 diff --git a/cmd/wrk2 b/cmd/wrk2 deleted file mode 160000 index f4884e417b3..00000000000 --- a/cmd/wrk2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4884e417b36b1f93363fb555a47c4b3bbc9f063 From c150fb916a6e17083b8396d308ab2d6c2c52e9e7 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:01:26 -0500 Subject: [PATCH 22/50] build-args Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 1 + install/docker-desktop-extension/Dockerfile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 58bef85471f..2e560863c01 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -61,6 +61,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true + build-args: GIT_VERSION=${GITHUB_REF/refs\/tags\//} tags: ${{ steps.meta.outputs.tags }} - diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 06041232205..118a61e73ad 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -38,7 +38,6 @@ COPY docker-compose.yaml . COPY metadata.json . RUN mkdir -p /mesheryctl/darwin && mkdir -p /mesheryctl/windows && mkdir -p /mesheryctl/linux ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip /mesheryctl/darwin/ -# ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_arm64.zip /mesheryctl/darwin/ ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip /mesheryctl/windows/ ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip /mesheryctl/linux/ RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ From 3dd3c6afccaa44558b4e0ea0fdb83f01e424671e Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:05:13 -0500 Subject: [PATCH 23/50] git_version build arg Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 6 +- .github/workflows/dde-cache-bust.yml | 69 --------------------- 2 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/dde-cache-bust.yml diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 2e560863c01..84b7bba7619 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -10,7 +10,7 @@ on: - 'master' paths-ignore: - 'docs/**' - - '.github/**' + # - '.github/**' workflow_dispatch: jobs: @@ -27,6 +27,8 @@ jobs: echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV fi echo "Release channel determined to be $RELEASE_CHANNEL" + echo git describe --tags `git rev-list --tags --max-count=1` >> GIT_VERSION + echo git describe --tags `git rev-list --tags --max-count=1` | cut -c 2- >> $GIT_STRIPPED_VERSION - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -61,7 +63,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_VERSION=${GITHUB_REF/refs\/tags\//} + build-args: GIT_VERSION=${{env.GIT_VERSION}}, GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}} tags: ${{ steps.meta.outputs.tags }} - diff --git a/.github/workflows/dde-cache-bust.yml b/.github/workflows/dde-cache-bust.yml deleted file mode 100644 index 072106d099b..00000000000 --- a/.github/workflows/dde-cache-bust.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Docker Desktop Extension for Meshery - # TODO - ## 1) Incorporate mesheryctl binaries into each DDE image - -on: - push: - tags: - - 'v*' - branches: - - 'master' - paths-ignore: - - 'docs/**' - - workflow_dispatch: - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Determine Release Channel - id: release-channel - run: | - if [[ ${{ github.ref }} = refs/tags* ]] - then - echo "RELEASE_CHANNEL=stable" >> $GITHUB_ENV - else - echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV - fi - echo "Release channel determined to be $RELEASE_CHANNEL" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Docker Meta - id: meta - uses: docker/metadata-action@v3 - with: - images: meshery/meshery-docker-desktop-extension - flavor: | - latest=false - prefix=${{env.RELEASE_CHANNEL}}- - tags: | - type=raw,value={{sha}} - type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - type=raw,value=latest - type=semver,pattern={{version}} - - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - - name: Move cache - run: - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - - - name: Build and Push - uses: docker/build-push-action@v2 - with: - context: "{{defaultContext}}:install/docker-desktop-extension" - push: true - tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file From 13157bbd7292ac24929b13911d309fd05fce9fa4 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:16:32 -0500 Subject: [PATCH 24/50] version Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 84b7bba7619..d08a796c770 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -27,8 +27,8 @@ jobs: echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV fi echo "Release channel determined to be $RELEASE_CHANNEL" - echo git describe --tags `git rev-list --tags --max-count=1` >> GIT_VERSION - echo git describe --tags `git rev-list --tags --max-count=1` | cut -c 2- >> $GIT_STRIPPED_VERSION + export "GIT_VERSION=git describe --tags `git rev-list --tags --max-count=1`" >> $GITHUB_ENV + echo "GIT_STRIPPED_VERSION=git describe --tags `git rev-list --tags --max-count=1` | cut -c 2-" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -63,7 +63,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_VERSION=${{env.GIT_VERSION}}, GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}} + build-args: GIT_VERSION={{version}} tags: ${{ steps.meta.outputs.tags }} - From 675f7f23d6b1b11e1442f27557e6d57376656028 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:21:18 -0500 Subject: [PATCH 25/50] GIT_VERSION Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index d08a796c770..868300d42e2 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -63,7 +63,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_VERSION={{version}} + build-args: GIT_VERSION=${{env.GIT_VERSION}} tags: ${{ steps.meta.outputs.tags }} - From ece7e7ee01f91f108493a504f93d72dd0ba29892 Mon Sep 17 00:00:00 2001 From: suod-NithishKarthik Date: Mon, 28 Mar 2022 22:58:09 +0530 Subject: [PATCH 26/50] feat: Add localhost:9081 redirection Signed-off-by: suod-NithishKarthik --- .../ui/package-lock.json | 28 +++++++++++++++++ .../docker-desktop-extension/ui/package.json | 2 ++ .../ui/src/components/ExtensionComponent.js | 6 +++- .../ui/src/hooks/usePingServer.js | 30 +++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 install/docker-desktop-extension/ui/src/hooks/usePingServer.js diff --git a/install/docker-desktop-extension/ui/package-lock.json b/install/docker-desktop-extension/ui/package-lock.json index 790ceafc2d6..2464ef79fc5 100644 --- a/install/docker-desktop-extension/ui/package-lock.json +++ b/install/docker-desktop-extension/ui/package-lock.json @@ -15,10 +15,12 @@ "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.4", "@testing-library/user-event": "^13.5.0", + "axios": "^0.26.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "5.0.0", "sans-serif": "^1.0.0", + "web-pingjs": "^1.0.1", "web-vitals": "^2.1.4" } }, @@ -4682,6 +4684,14 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, "node_modules/axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -15629,6 +15639,11 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-pingjs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/web-pingjs/-/web-pingjs-1.0.1.tgz", + "integrity": "sha512-rlAeWwOWLYpFUAzi1edajOm6iWsP4EVnjl7qXsyXglVt8Wuwxo1d8GQgeyZ6Ze3gRf0xtvQCmb2eQ1OOAGbN1A==" + }, "node_modules/web-vitals": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.4.tgz", @@ -19776,6 +19791,14 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.1.tgz", "integrity": "sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw==" }, + "axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "requires": { + "follow-redirects": "^1.14.8" + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -27651,6 +27674,11 @@ "minimalistic-assert": "^1.0.0" } }, + "web-pingjs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/web-pingjs/-/web-pingjs-1.0.1.tgz", + "integrity": "sha512-rlAeWwOWLYpFUAzi1edajOm6iWsP4EVnjl7qXsyXglVt8Wuwxo1d8GQgeyZ6Ze3gRf0xtvQCmb2eQ1OOAGbN1A==" + }, "web-vitals": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-2.1.4.tgz", diff --git a/install/docker-desktop-extension/ui/package.json b/install/docker-desktop-extension/ui/package.json index 0ea758805c4..58dfccf65f9 100644 --- a/install/docker-desktop-extension/ui/package.json +++ b/install/docker-desktop-extension/ui/package.json @@ -13,10 +13,12 @@ "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^12.1.4", "@testing-library/user-event": "^13.5.0", + "axios": "^0.26.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "5.0.0", "sans-serif": "^1.0.0", + "web-pingjs": "^1.0.1", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index 6423a4ffe7a..e317d45373e 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -5,6 +5,7 @@ import { NoSsr, Typography, Grid, Link } from "@material-ui/core"; import FavoriteIcon from '@material-ui/icons/Favorite'; import MesheryLogo from "../img/meshery-logo/meshery-logo.svg"; import { makeStyles } from "@material-ui/core/styles"; +import { usePingServer } from "../hooks/usePingServer" import { Container, Button, Paper, Switch @@ -93,6 +94,7 @@ const ExtensionsComponent = props => { const [linkerdChecked, isLinkerdChecked] = useState(false); const [nginxChecked, isNginxChecked] = useState(false); const [kumaChecked, isKumaChecked] = useState(false); + const buttonEnabled = usePingServer("/api/providers", { host: "localhost", port: "9081" }) const classes = useStyles(); // Wrote separate functions since we need these functions to provision the adapters as well @@ -125,7 +127,9 @@ const ExtensionsComponent = props => {
Account -
+
diff --git a/install/docker-desktop-extension/ui/src/hooks/usePingServer.js b/install/docker-desktop-extension/ui/src/hooks/usePingServer.js new file mode 100644 index 00000000000..a36cd161f72 --- /dev/null +++ b/install/docker-desktop-extension/ui/src/hooks/usePingServer.js @@ -0,0 +1,30 @@ +import { useEffect } from "react" +import { useState } from "react" +import axios from "axios" +import ping from "web-pingjs" + +export const usePingServer = (path, { host, port }) => { + const [isServerAvailable, setIsServerAvailable] = useState(false) + useEffect(() => { + setInterval(() => { + ping("http://127.0.0.1:9081/api/system/version").then((res) => { + setIsServerAvailable(true) + console.log(res) + }).catch(() => { + setIsServerAvailable(false) + }) + // axios.get("http://localhost:9081/api/system/versionsa" + // ) + // .then((obj) => { + // console.log(obj) + // if (obj.status >= 200 && obj.status < 300) setIsServerAvailable(true) + // else setIsServerAvailable(false) + // }) + // .catch((obj) => { + // setIsServerAvailable(false) + // console.log(obj) + // }) + }, 2000) + }, []) + return isServerAvailable +} From b09d5f1bcd94486dd982efa60ecf27848633b8f0 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:38:19 -0500 Subject: [PATCH 27/50] git_version Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 868300d42e2..4064eb218a9 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -27,8 +27,7 @@ jobs: echo "RELEASE_CHANNEL=edge" >> $GITHUB_ENV fi echo "Release channel determined to be $RELEASE_CHANNEL" - export "GIT_VERSION=git describe --tags `git rev-list --tags --max-count=1`" >> $GITHUB_ENV - echo "GIT_STRIPPED_VERSION=git describe --tags `git rev-list --tags --max-count=1` | cut -c 2-" >> $GITHUB_ENV + echo "GIT_STRIPPED_VERSION=`echo ${{github.ref}} | cut -c 2-`" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -63,7 +62,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_VERSION=${{env.GIT_VERSION}} + build-args: GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}}, GIT_VERSION={{github.ref}} tags: ${{ steps.meta.outputs.tags }} - From b3616ac55629f7c4ef5f8210e33109b61c91e5da Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:46:14 -0500 Subject: [PATCH 28/50] manual dispatch Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 4064eb218a9..0c44ebe1ad5 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -6,13 +6,21 @@ on: push: tags: - 'v*' - branches: - - 'master' + # branches: + # - 'master' paths-ignore: - 'docs/**' # - '.github/**' workflow_dispatch: - + inputs: + release-ver: + description: 'Stable Release Version' + required: true + default: 'v' + stripped-release-ver: + description: 'Stripped Stable Release Version' + required: true + default: '' jobs: docker: runs-on: ubuntu-latest @@ -62,7 +70,7 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_STRIPPED_VERSION=${{env.GIT_STRIPPED_VERSION}}, GIT_VERSION={{github.ref}} + build-args: GIT_STRIPPED_VERSION=${{github.event.inputs.stripped-release-ver}}, GIT_VERSION=${{github.event.inputs.release-ver}} tags: ${{ steps.meta.outputs.tags }} - From cb0d584b5ece785157e2aa9e917268c497daae2e Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:50:20 -0500 Subject: [PATCH 29/50] multiple build args Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 0c44ebe1ad5..a0461f78ce0 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -70,7 +70,9 @@ jobs: with: context: "{{defaultContext}}:install/docker-desktop-extension" push: true - build-args: GIT_STRIPPED_VERSION=${{github.event.inputs.stripped-release-ver}}, GIT_VERSION=${{github.event.inputs.release-ver}} + build-args: | + GIT_STRIPPED_VERSION=${{github.event.inputs.stripped-release-ver}} + GIT_VERSION=${{github.event.inputs.release-ver}} tags: ${{ steps.meta.outputs.tags }} - From 33695367aaf05d5dd0f237f8e8fd6f8c82f3e959 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:53:11 -0500 Subject: [PATCH 30/50] braces for git_version Signed-off-by: leecalcote --- install/docker-desktop-extension/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 118a61e73ad..2680ee37672 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -37,10 +37,10 @@ COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . RUN mkdir -p /mesheryctl/darwin && mkdir -p /mesheryctl/windows && mkdir -p /mesheryctl/linux -ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip /mesheryctl/darwin/ -ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip /mesheryctl/windows/ -ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip /mesheryctl/linux/ -RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ +ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip /mesheryctl/darwin/ +ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip /mesheryctl/windows/ +ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip /mesheryctl/linux/ +RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ && RUN unzip /mesheryctl/windows/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip -d /mesheryctl/windows/ RUN unzip /mesheryctl/linux/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip -d /mesheryctl/linux/ COPY meshery-logo-white.svg . From a57442e58092849c4f9ecc6ea352b28ba30715c6 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 12:58:22 -0500 Subject: [PATCH 31/50] remove && Signed-off-by: leecalcote --- install/docker-desktop-extension/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 2680ee37672..9128ac1d003 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -40,7 +40,7 @@ RUN mkdir -p /mesheryctl/darwin && mkdir -p /mesheryctl/windows && mkdir -p /mes ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip /mesheryctl/darwin/ ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip /mesheryctl/windows/ ADD https://github.com/meshery/meshery/releases/download/${GIT_VERSION}/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip /mesheryctl/linux/ -RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ && +RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ RUN unzip /mesheryctl/windows/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip -d /mesheryctl/windows/ RUN unzip /mesheryctl/linux/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip -d /mesheryctl/linux/ COPY meshery-logo-white.svg . From 327c1d622bb9407c1d457b0bf4372029bc6df3c1 Mon Sep 17 00:00:00 2001 From: suod-NithishKarthik Date: Mon, 28 Mar 2022 23:31:40 +0530 Subject: [PATCH 32/50] refactor: Remove usePingserver usage Signed-off-by: suod-NithishKarthik --- .../ui/src/components/ExtensionComponent.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index e317d45373e..31c4eef603f 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -94,7 +94,6 @@ const ExtensionsComponent = props => { const [linkerdChecked, isLinkerdChecked] = useState(false); const [nginxChecked, isNginxChecked] = useState(false); const [kumaChecked, isKumaChecked] = useState(false); - const buttonEnabled = usePingServer("/api/providers", { host: "localhost", port: "9081" }) const classes = useStyles(); // Wrote separate functions since we need these functions to provision the adapters as well @@ -127,7 +126,7 @@ const ExtensionsComponent = props => {
From 7d9bdc8c0564a3c83305597f7a19af1f89a06b1b Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:03:09 -0500 Subject: [PATCH 33/50] path to readme Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index a0461f78ce0..453562338a6 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -81,4 +81,5 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - repository: meshery/meshery-docker-desktop-extension \ No newline at end of file + repository: meshery/meshery-docker-desktop-extension + readme-filepath: install/docker-desktop-extension/README.md \ No newline at end of file From c3a43119b8622e1960949f7c16330f4c3c0441e2 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:05:54 -0500 Subject: [PATCH 34/50] manual semver Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 453562338a6..59f74d6b068 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -55,7 +55,9 @@ jobs: type=raw,value={{sha}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest - type=semver,pattern={{version}} + type=semver,pattern=${{github.event.inputs.release-ver}} + + # type=semver,pattern={{version}} - name: Login to DockerHub From 793042348c92cfec7c76b89956a0bedbe71622bc Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:10:58 -0500 Subject: [PATCH 35/50] comment semver Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 59f74d6b068..602e0de62d1 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -56,8 +56,8 @@ jobs: type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest type=semver,pattern=${{github.event.inputs.release-ver}} - - # type=semver,pattern={{version}} + +# type=semver,pattern={{version}} - name: Login to DockerHub From bb40d442f340d2994607fe2bd26a97c2eb033f54 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:13:54 -0500 Subject: [PATCH 36/50] location to dde readme Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 602e0de62d1..062eb548373 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -84,4 +84,4 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: meshery/meshery-docker-desktop-extension - readme-filepath: install/docker-desktop-extension/README.md \ No newline at end of file + readme-filepath: /install/docker-desktop-extension/README.md \ No newline at end of file From ed53d353d48fe0c2042f13f06f920600deae8605 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:19:04 -0500 Subject: [PATCH 37/50] no readme update. Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 062eb548373..6a93a2ef52e 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -77,11 +77,11 @@ jobs: GIT_VERSION=${{github.event.inputs.release-ver}} tags: ${{ steps.meta.outputs.tags }} - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: meshery/meshery-docker-desktop-extension - readme-filepath: /install/docker-desktop-extension/README.md \ No newline at end of file + # - + # name: Docker Hub Description + # uses: peter-evans/dockerhub-description@v3 + # with: + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + # repository: meshery/meshery-docker-desktop-extension + # readme-filepath: /install/docker-desktop-extension/README.md \ No newline at end of file From f3088d15578dfce7131958bd8518265991928a77 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:20:25 -0500 Subject: [PATCH 38/50] semver rearrangement Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 6a93a2ef52e..d2f37cea85f 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -54,11 +54,9 @@ jobs: tags: | type=raw,value={{sha}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} - type=raw,value=latest type=semver,pattern=${{github.event.inputs.release-ver}} - -# type=semver,pattern={{version}} - + type=raw,value=latest + - name: Login to DockerHub uses: docker/login-action@v1 From aab9f9044f143a2a5c107a27ab545993daa5e785 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 13:22:40 -0500 Subject: [PATCH 39/50] semver manual tag ordering Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index d2f37cea85f..144f8ff68c1 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -53,8 +53,8 @@ jobs: prefix=${{env.RELEASE_CHANNEL}}- tags: | type=raw,value={{sha}} - type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=semver,pattern=${{github.event.inputs.release-ver}} + type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest - From 8eb726fd2f1cf47ca6157fcd871eb48e6dc29e97 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 14:36:06 -0500 Subject: [PATCH 40/50] meshery-perf: enabled: false Signed-off-by: leecalcote --- install/kubernetes/helm/meshery/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/kubernetes/helm/meshery/values.yaml b/install/kubernetes/helm/meshery/values.yaml index 617204157cf..73a3fe53f84 100644 --- a/install/kubernetes/helm/meshery/values.yaml +++ b/install/kubernetes/helm/meshery/values.yaml @@ -153,7 +153,7 @@ meshery-cilium: fullnameOverride: meshery-cilium meshery-perf: - enabled: true + enabled: false fullnameOverride: meshery-perf serviceAccountNameOverride: meshery-server From 78e26deab0156a11f92cecaacb951f4d8b712956 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 20:04:35 +0000 Subject: [PATCH 41/50] [Docs] Release Notes for Meshery Signed-off-by: l5io --- docs/_releases/v0.6.0-rc-5h.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/_releases/v0.6.0-rc-5h.md diff --git a/docs/_releases/v0.6.0-rc-5h.md b/docs/_releases/v0.6.0-rc-5h.md new file mode 100644 index 00000000000..3f06f04be7b --- /dev/null +++ b/docs/_releases/v0.6.0-rc-5h.md @@ -0,0 +1,22 @@ +--- +layout: release +date: 2022-03-28 +tag: v0.6.0-rc-5h +--- + +## What's New +## 🔤 General +- [DDE] UI styling changes and configure to work with meshery server @sudo-NithishKarthik (#5292) + +## 🖥 Meshery UI + +- Update URL viladate, compatible with RFC that is not URL standard @m9rco (#5287) + +## 🧰 Maintenance + +- [CI] Restructure makefile @leecalcote (#5283) + +## 👨🏽‍💻 Contributors + +Thank you to our contributors for making this release possible: +@leecalcote, @m9rco, @sudo-NithishKarthik and @warunicorn19 From 515f6645c8da534d61639983bdd149e9f276026d Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 15:08:36 -0500 Subject: [PATCH 42/50] remove wrk2 submodule folder Signed-off-by: leecalcote --- cmd/wrk2 | 1 - 1 file changed, 1 deletion(-) delete mode 160000 cmd/wrk2 diff --git a/cmd/wrk2 b/cmd/wrk2 deleted file mode 160000 index f4884e417b3..00000000000 --- a/cmd/wrk2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4884e417b36b1f93363fb555a47c4b3bbc9f063 From e4f0ff2bcb467b46fbecbad3b60f891ffa61625b Mon Sep 17 00:00:00 2001 From: Aditya Chatterjee Date: Tue, 29 Mar 2022 01:51:15 +0530 Subject: [PATCH 43/50] removed underline: Signed-off-by: Aditya Chatterjee --- .../ui/src/components/ExtensionComponent.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index cf4ad6cafa7..9f048f4af9f 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -82,6 +82,9 @@ const useStyles = makeStyles((theme) => ({ backgroundColor: "#7794AB", color: "#FFFFFF", }, + link: { + textDecoration: "none" + }, Icon: { width: theme.spacing(2.5), paddingRight: theme.spacing(0.5), @@ -125,7 +128,7 @@ const ExtensionsComponent = props => {
From dc873023d20b33b026748947fa6a470a6dde9c61 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 15:38:33 -0500 Subject: [PATCH 44/50] semver Signed-off-by: leecalcote --- .github/workflows/build-and-release-dde.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index 144f8ff68c1..cc4b8aae597 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -53,7 +53,8 @@ jobs: prefix=${{env.RELEASE_CHANNEL}}- tags: | type=raw,value={{sha}} - type=semver,pattern=${{github.event.inputs.release-ver}} + type=semver,pattern={{version}},value=${{github.event.inputs.release-ver}} + type=raw,value=${{github.event.inputs.release-ver}} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=raw,value=latest From 95f778dd3e6c63d7cdc0281ab0eea76431ba5fc1 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Mon, 28 Mar 2022 16:40:38 -0500 Subject: [PATCH 45/50] remove nginx sm from dde Signed-off-by: leecalcote --- install/docker-desktop-extension/docker-compose.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/docker-desktop-extension/docker-compose.yaml b/install/docker-desktop-extension/docker-compose.yaml index 74ac3cda85a..9d4f645f847 100644 --- a/install/docker-desktop-extension/docker-compose.yaml +++ b/install/docker-desktop-extension/docker-compose.yaml @@ -45,10 +45,10 @@ services: image: layer5/meshery-osm:stable-latest ports: - "10009:10009" - meshery-nginx-sm: - image: layer5/meshery-nginx-sm:stable-latest - ports: - - "10010:10010" +# meshery-nginx-sm: +# image: layer5/meshery-nginx-sm:stable-latest +# ports: +# - "10010:10010" meshery-cilium: image: layer5/meshery-cilium:stable-latest ports: From 01d671433c0f036be60abd968f0b6e70cff157b7 Mon Sep 17 00:00:00 2001 From: suod-NithishKarthik Date: Tue, 29 Mar 2022 13:45:28 +0530 Subject: [PATCH 46/50] feat: Configure go based proxy for the UI to talk to localhost:9081 Signed-off-by: suod-NithishKarthik --- install/docker-desktop-extension/Dockerfile | 18 ++--- install/docker-desktop-extension/go.mod | 1 + install/docker-desktop-extension/go.sum | 2 + .../ui/src/components/ExtensionComponent.js | 4 ++ install/docker-desktop-extension/vm/main.go | 55 ++++++++------- .../vm/pkg/socket/socket.go | 61 ++++++++++++++++ .../vm/pkg/socket/socket_darwin.go | 3 + .../vm/pkg/socket/socket_linux.go | 3 + .../vm/pkg/socket/socket_unix.go | 69 +++++++++++++++++++ .../vm/pkg/socket/socket_windows.go | 23 +++++++ 10 files changed, 206 insertions(+), 33 deletions(-) create mode 100644 install/docker-desktop-extension/vm/pkg/socket/socket.go create mode 100644 install/docker-desktop-extension/vm/pkg/socket/socket_darwin.go create mode 100644 install/docker-desktop-extension/vm/pkg/socket/socket_linux.go create mode 100644 install/docker-desktop-extension/vm/pkg/socket/socket_unix.go create mode 100644 install/docker-desktop-extension/vm/pkg/socket/socket_windows.go diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 280eb405414..2064fa98d57 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -5,12 +5,12 @@ WORKDIR /backend COPY go.* . ARG TARGETARCH RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - go mod download + --mount=type=cache,target=/root/.cache/go-build \ + go mod download COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - make bin + --mount=type=cache,target=/root/.cache/go-build \ + make bin FROM node:14.17-alpine3.13 AS client-builder WORKDIR /ui @@ -19,8 +19,8 @@ COPY ui/package.json /ui/package.json COPY ui/package-lock.json /ui/package-lock.json ARG TARGETARCH RUN --mount=type=cache,target=/usr/src/app/.npm \ - npm set cache /usr/src/app/.npm && \ - npm ci + npm set cache /usr/src/app/.npm && \ + npm ci # install COPY ui /ui RUN npm run build @@ -29,9 +29,9 @@ FROM alpine ARG GIT_VERSION ARG GIT_STRIPPED_VERSION LABEL org.opencontainers.image.title="meshery" \ - org.opencontainers.image.description="Meshery" \ - org.opencontainers.image.vendor="Layer5, Inc." \ - com.docker.desktop.extension.api.version=">= 0.2.0" + org.opencontainers.image.description="Meshery" \ + org.opencontainers.image.vendor="Layer5, Inc." \ + com.docker.desktop.extension.api.version=">= 0.2.0" COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . diff --git a/install/docker-desktop-extension/go.mod b/install/docker-desktop-extension/go.mod index c7cd5cfc4be..fa22a6f1663 100644 --- a/install/docker-desktop-extension/go.mod +++ b/install/docker-desktop-extension/go.mod @@ -4,6 +4,7 @@ go 1.17 require ( github.com/labstack/echo v3.3.10+incompatible + github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.8.1 ) diff --git a/install/docker-desktop-extension/go.sum b/install/docker-desktop-extension/go.sum index d2b8761b5cd..a9a0c0238f4 100644 --- a/install/docker-desktop-extension/go.sum +++ b/install/docker-desktop-extension/go.sum @@ -9,6 +9,8 @@ github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHR github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index 31c4eef603f..5b2145d3868 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -96,6 +96,10 @@ const ExtensionsComponent = props => { const [kumaChecked, isKumaChecked] = useState(false); const classes = useStyles(); + useEffect(() => { + window.ddClient.extension.vm.service.get("/ping").then(console.log); + }, []) + // Wrote separate functions since we need these functions to provision the adapters as well const handleConsul = () => { isConsulChecked(prev => !prev); diff --git a/install/docker-desktop-extension/vm/main.go b/install/docker-desktop-extension/vm/main.go index c8a4fc46f3b..8d4548e70f1 100644 --- a/install/docker-desktop-extension/vm/main.go +++ b/install/docker-desktop-extension/vm/main.go @@ -2,47 +2,54 @@ package main import ( "flag" + "fmt" + "io" "log" - "net" "net/http" - "os" + "github.com/docker/meshery-extension/vm/pkg/socket" "github.com/labstack/echo" "github.com/sirupsen/logrus" ) func main() { - var socketPath string - flag.StringVar(&socketPath, "socket", "/run/guest/volumes-service.sock", "Unix domain socket to listen on") + + var socketPath = flag.String("socket", "/run/guest/volumes-service.sock", "Unix domain socket to listen on") + // var socketPath = flag.String("socket", "./test.sock", "Unix domain socket to listen on") + var testPort = flag.Int("testPort", 0, "Test port to expose instead of socket") flag.Parse() + unixSocket := "unix:" + *socketPath + logrus.New().Infof("Starting listening on %s\n", unixSocket) - os.RemoveAll(socketPath) - - logrus.New().Infof("Starting listening on %s\n", socketPath) router := echo.New() router.HideBanner = true startURL := "" - ln, err := listen(socketPath) - if err != nil { - log.Fatal(err) + if *testPort != 0 { + startURL = fmt.Sprintf(":%d", *testPort) + } else { + ln, err := socket.ListenOn(unixSocket) + if err != nil { + log.Fatal(err) + } + router.Listener = ln } - router.Listener = ln - router.GET("/hello", hello) + router.GET("/ping", func(c echo.Context) error { + resp, err := http.Get("http://localhost:9081/api/system/version") + if err != nil { + fmt.Println(err.Error()) + return err + } + + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println(err.Error()) + } + return c.String(http.StatusOK, string(body)) + }) log.Fatal(router.Start(startURL)) } - -func listen(path string) (net.Listener, error) { - return net.Listen("unix", path) -} - -func hello(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, HTTPMessageBody{Message: "hello"}) -} - -type HTTPMessageBody struct { - Message string -} diff --git a/install/docker-desktop-extension/vm/pkg/socket/socket.go b/install/docker-desktop-extension/vm/pkg/socket/socket.go new file mode 100644 index 00000000000..285269eeef5 --- /dev/null +++ b/install/docker-desktop-extension/vm/pkg/socket/socket.go @@ -0,0 +1,61 @@ +package socket + +import ( + "context" + "fmt" + "net" + "net/http" + "os" + "strconv" + "strings" + + "github.com/pkg/errors" +) + +// ListenFD listens to a file descriptor. +func ListenFD(filedes string) (net.Listener, error) { + fd, err := strconv.Atoi(filedes) + if err != nil { + return nil, errors.Wrapf(err, "cannot parse file descriptor: %s", filedes) + } + file := os.NewFile(uintptr(fd), fmt.Sprintf("fd:%v", filedes)) + res, err := net.FileListener(file) + if err != nil { + return nil, errors.Wrapf(err, "cannot convert fd %v to net.Listener", fd) + } + return res, nil +} + +// Listen wraps net.Listen, preferring ListenUnix when applicable, and +// offers support for the "fd" network type, in which case address is +// a file descriptor. +func Listen(network, address string) (net.Listener, error) { + switch network { + case "fd": + return ListenFD(address) + case "unix": + return ListenUnix(address) + default: + return net.Listen(network, address) + } +} + +// ListenOn splits a "network:address" string to invoke Listen. +func ListenOn(addr string) (net.Listener, error) { + ss := strings.SplitN(addr, ":", 2) + if len(ss) < 2 { + return nil, errors.Errorf("invalid listener address: %v", addr) + } + return Listen(ss[0], ss[1]) +} + +// Client Creates a client connected to the specified socket +func Client(addr string) *http.Client { + return &http.Client{ + Transport: &http.Transport{ + DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { + return DialSocket(addr) + }, + }, + } +} diff --git a/install/docker-desktop-extension/vm/pkg/socket/socket_darwin.go b/install/docker-desktop-extension/vm/pkg/socket/socket_darwin.go new file mode 100644 index 00000000000..ff5075e5ce4 --- /dev/null +++ b/install/docker-desktop-extension/vm/pkg/socket/socket_darwin.go @@ -0,0 +1,3 @@ +package socket + +const maxUnixSocketPathLen = 104 - 1 // NULL diff --git a/install/docker-desktop-extension/vm/pkg/socket/socket_linux.go b/install/docker-desktop-extension/vm/pkg/socket/socket_linux.go new file mode 100644 index 00000000000..68b94bd0dfd --- /dev/null +++ b/install/docker-desktop-extension/vm/pkg/socket/socket_linux.go @@ -0,0 +1,3 @@ +package socket + +const maxUnixSocketPathLen = 108 - 1 // NULL diff --git a/install/docker-desktop-extension/vm/pkg/socket/socket_unix.go b/install/docker-desktop-extension/vm/pkg/socket/socket_unix.go new file mode 100644 index 00000000000..e3fb1477805 --- /dev/null +++ b/install/docker-desktop-extension/vm/pkg/socket/socket_unix.go @@ -0,0 +1,69 @@ +// +build !windows + +package socket + +import ( + "fmt" + "net" + "os" + "path/filepath" +) + +// ListenUnix wraps `net.ListenUnix`. +func ListenUnix(path string) (*net.UnixListener, error) { + if err := os.Remove(path); err != nil && !os.IsNotExist(err) { + return nil, err + } + // Make sure the parent directory exists. + dir := filepath.Dir(path) + if err := os.MkdirAll(dir, 0755); err != nil { + return nil, err + } + short, err := shortenUnixSocketPath(path) + if err != nil { + return nil, err + } + return net.ListenUnix("unix", &net.UnixAddr{Name: short, Net: "unix"}) +} + +func DialSocket(socket string) (net.Conn, error) { + return net.Dial("unix", socket) +} + +func shortenUnixSocketPath(path string) (string, error) { + if len(path) <= maxUnixSocketPathLen { + return path, nil + } + // absolute path is too long, attempt to use a relative path + p, err := relative(path) + if err != nil { + return "", err + } + + if len(p) > maxUnixSocketPathLen { + return "", fmt.Errorf("absolute and relative socket path %s longer than %d characters", p, maxUnixSocketPathLen) + } + return p, nil +} + +func relative(p string) (string, error) { + // Assume the parent directory exists already but the child (the socket) + // hasn't been created. + path2, err := filepath.EvalSymlinks(filepath.Dir(p)) + if err != nil { + return "", err + } + dir, err := os.Getwd() + if err != nil { + return "", err + } + dir2, err := filepath.EvalSymlinks(dir) + if err != nil { + return "", err + } + rel, err := filepath.Rel(dir2, path2) + if err != nil { + return "", err + } + return filepath.Join(rel, filepath.Base(p)), nil +} diff --git a/install/docker-desktop-extension/vm/pkg/socket/socket_windows.go b/install/docker-desktop-extension/vm/pkg/socket/socket_windows.go new file mode 100644 index 00000000000..44e8d37bb55 --- /dev/null +++ b/install/docker-desktop-extension/vm/pkg/socket/socket_windows.go @@ -0,0 +1,23 @@ +package socket + +import ( + "net" + "time" + + "github.com/Microsoft/go-winio" +) + +// ListenUnix wraps `winio.ListenUnix`. +// It provides API compatibility for named pipes with the Unix domain socket API. +func ListenUnix(path string) (net.Listener, error) { + return winio.ListenPipe(path, &winio.PipeConfig{ + MessageMode: true, // Use message mode so that CloseWrite() is supported + InputBufferSize: 65536, // Use 64KB buffers to improve performance + OutputBufferSize: 65536, + }) +} + +func DialSocket(socket string) (net.Conn, error) { + timeout := 1 * time.Second + return winio.DialPipe(socket, &timeout) +} From 5574418e5b9aee7608ac8d04826f284d586c72a9 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Tue, 29 Mar 2022 16:54:16 +0000 Subject: [PATCH 47/50] [Docs] Test status of adapter Signed-off-by: l5io --- .../meshery-linkerd/03-29-2022-16-54-03_.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/_compatibility/meshery-linkerd/03-29-2022-16-54-03_.md diff --git a/docs/_compatibility/meshery-linkerd/03-29-2022-16-54-03_.md b/docs/_compatibility/meshery-linkerd/03-29-2022-16-54-03_.md new file mode 100644 index 00000000000..5e9c364c537 --- /dev/null +++ b/docs/_compatibility/meshery-linkerd/03-29-2022-16-54-03_.md @@ -0,0 +1,15 @@ +--- +timestamp: "2022-03-29 16:53:51 UTC Tue" +meshery-component: meshery-linkerd +meshery-component-version: edge +meshery-server-version: "v0.6.0-rc-5h" +k8s-distro: minikube +k8s-version: "v1.20.1" +service-mesh: Linkerd +service-mesh-version: "stable-2.11.1" +tests: + linkerd-destination: "Running" + linkerd-identity: "Running" + linkerd-proxy-injector: "Running" +overall-status: "passing" +--- From fa237557ed2ec4b687111b1a8aad50a92de739d6 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Tue, 29 Mar 2022 17:01:21 +0000 Subject: [PATCH 48/50] [Docs] Test status of adapter Signed-off-by: l5io --- .../meshery-kuma/03-29-2022-17-01-03_775a03d4.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/_compatibility/meshery-kuma/03-29-2022-17-01-03_775a03d4.md diff --git a/docs/_compatibility/meshery-kuma/03-29-2022-17-01-03_775a03d4.md b/docs/_compatibility/meshery-kuma/03-29-2022-17-01-03_775a03d4.md new file mode 100644 index 00000000000..02ec7c511bc --- /dev/null +++ b/docs/_compatibility/meshery-kuma/03-29-2022-17-01-03_775a03d4.md @@ -0,0 +1,13 @@ +--- +timestamp: "2022-03-29 17:00:54 UTC Tue" +meshery-component: meshery-kuma +meshery-component-version: edge +meshery-server-version: "v0.6.0-rc-5h" +k8s-distro: minikube +k8s-version: "v1.20.1" +service-mesh: Kuma +service-mesh-version: "1.5.0" +tests: + kuma-control-plane: "Running" +overall-status: "passing" +--- From a47bd204d58e67f3d36f6e7708a5078b7950d6f0 Mon Sep 17 00:00:00 2001 From: leecalcote Date: Tue, 29 Mar 2022 19:18:17 +0000 Subject: [PATCH 49/50] [Error Codes]: Update Meshery server and mehseryctl error codes and reference Signed-off-by: l5io --- docs/_data/errorref/meshery-server_errors_export.json | 9 --------- helpers/component_info.json | 2 +- internal/graphql/resolver/error.go | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/_data/errorref/meshery-server_errors_export.json b/docs/_data/errorref/meshery-server_errors_export.json index b0745f1b1c8..24b041f759d 100644 --- a/docs/_data/errorref/meshery-server_errors_export.json +++ b/docs/_data/errorref/meshery-server_errors_export.json @@ -1470,15 +1470,6 @@ "probable_cause": "Invalid data passed\nUnable to connect with provider", "suggested_remediation": "Pass valid values for preferences\nMake sure provider supports saving user preferences\nMake sure you're connected with provider\nMake sure extension provides these preferences" }, - "2173": { - "name": "ErrMesheryInstanceIDCode", - "code": "2173", - "severity": "", - "long_description": "", - "short_description": "", - "probable_cause": "", - "suggested_remediation": "" - }, "2174": { "name": "ErrInvalidKubeConfigCode", "code": "2174", diff --git a/helpers/component_info.json b/helpers/component_info.json index f7e5c05cb35..c03ec4b93e7 100644 --- a/helpers/component_info.json +++ b/helpers/component_info.json @@ -1,5 +1,5 @@ { "name": "meshery-server", "type": "component", - "next_error_code": 2173 + "next_error_code": 2174 } \ No newline at end of file diff --git a/internal/graphql/resolver/error.go b/internal/graphql/resolver/error.go index d5586a513a4..9df2699ea04 100644 --- a/internal/graphql/resolver/error.go +++ b/internal/graphql/resolver/error.go @@ -22,7 +22,7 @@ const ( ErrBrokerNotConnectedCode = "2151" ErrGettingNamespaceCode = "1014" ErrFetchingPatternsCode = "1015" - ErrInvalidOAMTypeCode = "not set" + ErrInvalidOAMTypeCode = "2173" ) var ( From ec73c5827866a66322ad5d0a2938c61e833a5a8f Mon Sep 17 00:00:00 2001 From: leecalcote Date: Tue, 29 Mar 2022 15:08:06 -0500 Subject: [PATCH 50/50] rearrange commands Signed-off-by: leecalcote --- Makefile | 87 ++++++++++++++++++++--------------- install/Makefile.show-help.mk | 2 +- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index e2148ca5ca3..ba04557d500 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ include install/Makefile.show-help.mk # Docker-based Builds #----------------------------------------------------------------------------- ## Build Meshery Server and UI containers. -docker: +docker-build: # `make docker` builds Meshery inside of a multi-stage Docker container. # This method does NOT require that you have Go, NPM, etc. installed locally. DOCKER_BUILDKIT=1 docker build -t layer5/meshery --build-arg TOKEN=$(GLOBAL_TOKEN) --build-arg GIT_COMMITSHA=$(GIT_COMMITSHA) --build-arg GIT_VERSION=$(GIT_VERSION) --build-arg RELEASE_CHANNEL=${RELEASE_CHANNEL} . @@ -27,7 +27,7 @@ docker: ## Meshery Cloud for user authentication. ## Runs Meshery in a container locally and points to locally-running -docker-run-local-cloud: +docker-local-cloud-run: (docker rm -f meshery) || true docker run --name meshery -d \ @@ -40,7 +40,7 @@ docker-run-local-cloud: ## Runs Meshery in a container locally and points to remote ## Remote Provider for user authentication. -docker-run-cloud: +docker-cloud-run: (docker rm -f meshery) || true docker run --name meshery -d \ -e PROVIDER_BASE_URLS=$(MESHERY_CLOUD_PROD) \ @@ -55,17 +55,18 @@ docker-run-cloud: # Meshery Server Native Builds #----------------------------------------------------------------------------- ## Setup wrk2 for local development. -setup-wrk2: +wrk2-setup: echo "setup-wrk does not work on Mac Catalina at the moment" cd cmd; git clone https://github.com/layer5io/wrk2.git; cd wrk2; make; cd .. ## ## Setup nighthawk for local development. -setup-nighthawk: +nighthawk-setup: cd cmd; git clone https://github.com/layer5io/nighthawk-go.git; cd nighthawk-go; make setup; cd .. +run-local-cloud: server-local-cloud-run error ## Run Meshery on your local machine and point to locally-running ## Meshery Cloud for user authentication. -run-local-cloud: error +server-local-cloud-run: cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ PROVIDER_BASE_URLS=$(MESHERY_CLOUD_DEV) \ @@ -75,9 +76,10 @@ run-local-cloud: error ./meshery; \ cd .. +run-local: server-local-run error ## Build and run Meshery to run on your local machine ## and point to remote Meshery Cloud for user authentication. -run-local: error +server-local-run: cd cmd; go clean; rm meshery; go mod tidy; \ go build -ldflags="-w -s -X main.version=${GIT_VERSION} -X main.commitsha=${GIT_COMMITSHA} -X main.releasechannel=${RELEASE_CHANNEL}" -tags draft -a -o meshery; \ PROVIDER_BASE_URLS=$(REMOTE_PROVIDER_LOCAL) \ @@ -88,8 +90,9 @@ run-local: error ./meshery; \ cd .. +run-fast: server-run ## Buiild and run Meshery Server on your local machine. -run-fast: +server-fast-run: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ PROVIDER_BASE_URLS=$(MESHERY_CLOUD_PROD) \ @@ -99,8 +102,9 @@ run-fast: APP_PATH=$(APPLICATIONCONFIGPATH) \ go run main.go; +run-fast-skip-compgen: server-fast-skip-compgen-run ## Build and run Meshery Server with no Kubernetes components on your local machine. -run-fast-skip-compgen: +server-fast-skip-compgen-run: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ PROVIDER_BASE_URLS=$(MESHERY_CLOUD_PROD) \ @@ -112,7 +116,7 @@ run-fast-skip-compgen: go run main.go; ## Build and run Meshery Server with no seed content. -run-fast-no-content: +server-fast-no-content-run: cd cmd; go mod tidy; \ BUILD="$(GIT_VERSION)" \ PROVIDER_BASE_URLS=$(MESHERY_CLOUD_PROD) \ @@ -129,7 +133,7 @@ golangci-run: error $(GOPATH)/bin/golangci-lint run ## Build Meshery's protobufs. -proto: +proto-build: # see https://grpc.io/docs/languages/go/quickstart/ # go get -u google.golang.org/grpc # go get -u google.golang.org/protobuf/cmd/protoc-gen-go \ @@ -141,42 +145,50 @@ proto: #----------------------------------------------------------------------------- # Meshery UI Native Builds #----------------------------------------------------------------------------- +setup-ui-libs: ui-setup ## Install dependencies for building Meshery UI. -setup-ui-libs: +ui-setup: cd ui; npm i; cd .. cd provider-ui; npm i; cd .. +run-ui-dev: ui-run ## Run Meshery UI on your local machine. Listen for changes. -run-ui-dev: +ui-run: cd ui; npm run dev; cd .. +run-provider-ui-dev: ui-provider-run ## Run Meshery Provider UI on your local machine. Listen for changes. -run-provider-ui-dev: +ui-provider-run: cd provider-ui; npm run dev; cd .. +lint-ui: ui-lint ## Lint check Meshery UI and Provider UI on your local machine. -lint-ui: +ui-lint: cd ui; npm run lint; cd .. +lint-provider-ui: ui-provider-lint ## Lint check Meshery Provider UI on your local machine. -lint-provider-ui: +ui-provider-lint: cd provider-ui; npm run lint; cd .. ## Test Meshery Provider UI on your local machine. test-provider-ui: cd provider-ui; npm run test; cd .. +build-ui: ui-build ## Buils all Meshery UIs on your local machine. -build-ui: +ui-build: cd ui; npm run build && npm run export; cd .. cd provider-ui; npm run build && npm run export; cd .. +build-meshery-ui: ui-meshery-build ## Build only Meshery UI on your local machine. -build-meshery-ui: +ui-meshery-build: cd ui; npm run build && npm run export; cd .. +build-provider-ui: ui-provider-build ## Builds only the provider user interface on your local machine -build-provider-ui: +ui-provider-build: cd provider-ui; npm run build && npm run export; cd .. #----------------------------------------------------------------------------- @@ -185,66 +197,69 @@ build-provider-ui: #Incorporating Make docs commands from the Docs Makefile jekyll=bundle exec jekyll +site: docs-run + ## Run Meshery Docs. Listen for changes. -site: +docs-run: cd docs; bundle install; $(jekyll) serve --drafts --livereload --config _config_dev.yml ## Build Meshery Docs on your local machine. -build-docs: +docs-build: cd docs; $(jekyll) build --drafts ## Run Meshery Docs in a Docker container. Listen for changes. -docker-docs: +docs-docker: cd docs; docker run --name meshery-docs --rm -p 4000:4000 -v `pwd`:"/srv/jekyll" jekyll/jekyll:4.0.0 bash -c "bundle install; jekyll serve --drafts --livereload" #----------------------------------------------------------------------------- # Meshery Helm Charts #----------------------------------------------------------------------------- -.PHONY: docs-charts +.PHONY: helm-docs ## Generate all Meshery Helm Chart documentation in markdown format. -docs-charts: docs-chart-operator docs-chart-meshery +helm-docs: helm-operator-docs helm-meshery-docs ## Generate Meshery Operator Helm Chart documentation in markdown format. -docs-chart-operator: +helm-operator-docs: GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs $(GOPATH)/bin/helm-docs -c install/kubernetes/helm/meshery-operator ## Generate Meshery Server and Adapters Helm Chart documentation in markdown format. -docs-chart-meshery: +helm-meshery-docs: GO111MODULE=on go install github.com/norwoodj/helm-docs/cmd/helm-docs $(GOPATH)/bin/helm-docs -c install/kubernetes/helm/meshery .PHONY: lint-helm ## Lint all of Meshery's Helm Charts -lint-helm: lint-helm-operator lint-helm-meshery +helm-lint: helm-operator-lint helm-meshery-lint + ## Lint Meshery Operator Helm Chart -lint-helm-operator: +helm-operator-lint: helm lint install/kubernetes/helm/meshery-operator --with-subcharts ## Lint Meshery Server and Adapter Helm Charts -lint-helm-meshery: +helm-meshery-lint: helm lint install/kubernetes/helm/meshery --with-subcharts #----------------------------------------------------------------------------- # Meshery APIs #----------------------------------------------------------------------------- -## Generate Meshery REST API specifications -gen-swagger: +## Build Meshery REST API specifications +swagger-build: swagger generate spec -o ./helpers/swagger.yaml --scan-models -## Generate and servc Meshery REST API specifications -run-swagger:swagger-spec +## Generate and serve Meshery REST API specifications +swagger-run: swagger-build swagger serve ./helpers/swagger.yaml ## Build Meshery REST API documentation -docs-swagger: +swagger-docs-build: swagger generate spec -o ./docs/_data/swagger.yml --scan-models; \ swagger flatten ./docs/_data/swagger.yml -o ./docs/_data/swagger.yml --with-expand --format=yaml ## Build Meshery GraphQL API documentation -docs-graphql: +graphql-docs: cd docs; build-docs; bundle exec rake graphql:compile_docs ## Build Meshery GraphQl API specifications -gen-gqlgen: +graphql-build: cd internal/graphql; go run -mod=mod github.com/99designs/gqlgen generate diff --git a/install/Makefile.show-help.mk b/install/Makefile.show-help.mk index 8ae84002a2c..3d096d8ea22 100644 --- a/install/Makefile.show-help.mk +++ b/install/Makefile.show-help.mk @@ -2,4 +2,4 @@ # See for explanation. .PHONY: show-help show-help: - @echo "$$(tput bold)Available rules:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr') \ No newline at end of file + @echo "$$(tput bold)Please specify a build target. The choices are:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr') \ No newline at end of file