From 5a26d4c7ac9d2403d781844f2865797650a8ecd5 Mon Sep 17 00:00:00 2001 From: Utku Ozdemir Date: Sat, 19 Oct 2024 00:16:30 +0200 Subject: [PATCH] feat: add resources and controllers for bare metal infra provider Introduce the concept of "static" infra providers, e.g., bare-metal infra provider, which manage a static set of machines contrary to the "regular" infra providers. Add the following resources: - `infra.Machine`: similar to `MachineRequest`, lives in the `infra-provider` namespace, serving as the input of the owning static provider. It is created in the `MachineController` if there is a SideroLink connection with the static provider ID. Regular flow of `Machine` creation is blocked, until this `infra.Machine` is accepted. - `infra.MachineStatus`: similar to `MachineRequestStatus`, lives in the `infra-provider` namespace, serving as the output of the owning static provider. Its lifecycle must be bound to the corresponding `infra.Machine`. - `infra.MachineState`: a resource that is supposed to be shared by Omni and bare-metal provider bi-directionally - they both can read from and write to it. It is currently used to mark the machine as installed when we observe an installation (through `SequenceEvent`s in the event sink), and to mark it as non-installed after we wipe it in the provider. - `omni.InfraMachineConfig`: a user-managed resource to mark the `infra.Machine`s as accepted or set their desired power state. The acceptance information is then propagated to the `infra.Machine` resource. A machine which was already accepted cannot be unaccepted (checked by a validation), and this resource can only be removed when the `siderolink.Link` for the matching infra machine is removed. Signed-off-by: Utku Ozdemir --- .github/workflows/ci.yaml | 4 +- .github/workflows/slack-notify.yaml | 4 +- Dockerfile | 6 +- Makefile | 8 +- client/api/common/omni.pb.go | 2 +- client/api/omni/management/management.pb.go | 2 +- .../api/omni/management/management.pb.gw.go | 584 ++--- client/api/omni/oidc/oidc.pb.go | 2 +- client/api/omni/oidc/oidc.pb.gw.go | 58 +- client/api/omni/resources/resources.pb.go | 2 +- client/api/omni/resources/resources.pb.gw.go | 316 +-- client/api/omni/specs/auth.pb.go | 2 +- client/api/omni/specs/ephemeral.pb.go | 2 +- client/api/omni/specs/infra.pb.go | 391 ++- client/api/omni/specs/infra.proto | 32 + client/api/omni/specs/infra_vtproto.pb.go | 756 +++++- client/api/omni/specs/oidc.pb.go | 2 +- client/api/omni/specs/omni.pb.go | 610 +++-- client/api/omni/specs/omni.proto | 12 + client/api/omni/specs/omni_vtproto.pb.go | 194 ++ client/api/omni/specs/siderolink.pb.go | 2 +- client/api/omni/specs/system.pb.go | 2 +- client/api/omni/specs/virtual.pb.go | 2 +- client/api/talos/machine/machine.pb.gw.go | 2092 ++++++----------- client/go.mod | 2 +- client/go.sum | 4 +- client/pkg/omni/resources/common/common.go | 1 + client/pkg/omni/resources/infra/infra.go | 3 + client/pkg/omni/resources/infra/machine.go | 70 + .../pkg/omni/resources/infra/machine_state.go | 56 + .../omni/resources/infra/machine_status.go | 58 + .../resources/omni/infra_machine_config.go | 58 + client/pkg/omni/resources/omni/labels.go | 7 + client/pkg/omni/resources/omni/omni.go | 1 + cmd/integration-test/pkg/tests/auth.go | 8 + frontend/src/api/omni/specs/infra.pb.ts | 28 + frontend/src/api/omni/specs/omni.pb.ts | 11 + frontend/src/api/resources.ts | 4 + go.mod | 2 +- go.sum | 4 +- .../omni/cluster_machine_config_status.go | 28 + .../omni/controllers/omni/infra_machine.go | 210 ++ .../controllers/omni/infra_machine_test.go | 141 ++ .../runtime/omni/controllers/omni/machine.go | 159 +- .../omni/controllers/omni/machine_status.go | 2 +- internal/backend/runtime/omni/export_test.go | 4 + .../runtime/omni/infraprovider/state.go | 12 +- .../runtime/omni/infraprovider/state_test.go | 121 +- internal/backend/runtime/omni/omni.go | 2 + internal/backend/runtime/omni/state_access.go | 4 + .../backend/runtime/omni/state_validation.go | 28 + .../runtime/omni/state_validation_test.go | 49 + internal/backend/server.go | 6 +- internal/pkg/machineevent/handler.go | 180 ++ internal/pkg/machineevent/handler_test.go | 113 + .../machineevent.go} | 4 +- internal/pkg/machinestatus/handler.go | 89 - internal/pkg/siderolink/manager.go | 29 +- internal/pkg/siderolink/siderolink_test.go | 6 +- 59 files changed, 4078 insertions(+), 2513 deletions(-) create mode 100644 client/pkg/omni/resources/infra/machine.go create mode 100644 client/pkg/omni/resources/infra/machine_state.go create mode 100644 client/pkg/omni/resources/infra/machine_status.go create mode 100644 client/pkg/omni/resources/omni/infra_machine_config.go create mode 100644 internal/backend/runtime/omni/controllers/omni/infra_machine.go create mode 100644 internal/backend/runtime/omni/controllers/omni/infra_machine_test.go create mode 100644 internal/pkg/machineevent/handler.go create mode 100644 internal/pkg/machineevent/handler_test.go rename internal/pkg/{machinestatus/machinestatus.go => machineevent/machineevent.go} (60%) delete mode 100644 internal/pkg/machinestatus/handler.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1bd8d729..d0535ed5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-10-30T17:18:04Z by kres 6d3cad4. +# Generated on 2024-11-25T13:10:36Z by kres b9ed228. name: default concurrency: @@ -100,7 +100,7 @@ jobs: run: | make unit-tests-race - name: coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: files: _out/coverage-unit-tests-client.txt,_out/coverage-unit-tests.txt token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/slack-notify.yaml b/.github/workflows/slack-notify.yaml index dfe57a18..445acb60 100644 --- a/.github/workflows/slack-notify.yaml +++ b/.github/workflows/slack-notify.yaml @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-10-30T17:18:04Z by kres 6d3cad4. +# Generated on 2024-11-25T13:10:36Z by kres b9ed228. name: slack-notify "on": @@ -32,7 +32,7 @@ jobs: run: | echo pull_request_number=$(gh pr view -R ${{ github.repository }} ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} --json number --jq .number) >> $GITHUB_OUTPUT - name: Slack Notify - uses: slackapi/slack-github-action@v1 + uses: slackapi/slack-github-action@v2 with: channel-id: proj-talos-maintainers payload: | diff --git a/Dockerfile b/Dockerfile index 4f74aaec..c8c3d8b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-11-21T22:07:50Z by kres a8af16d. +# Generated on 2024-11-25T13:10:36Z by kres b9ed228. ARG JS_TOOLCHAIN ARG TOOLCHAIN @@ -20,9 +20,9 @@ ENV GOPATH=/go ENV PATH=${PATH}:/usr/local/go/bin # runs markdownlint -FROM docker.io/oven/bun:1.1.34-alpine AS lint-markdown +FROM docker.io/oven/bun:1.1.36-alpine AS lint-markdown WORKDIR /src -RUN bun i markdownlint-cli@0.42.0 sentences-per-line@0.2.1 +RUN bun i markdownlint-cli@0.43.0 sentences-per-line@0.2.1 COPY .markdownlint.json . COPY ./docs ./docs COPY ./CHANGELOG.md ./CHANGELOG.md diff --git a/Makefile b/Makefile index fc26398d..34bf3db6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-11-21T22:34:08Z by kres b3b0da76. +# Generated on 2024-11-25T13:10:36Z by kres b9ed228. # common variables @@ -20,9 +20,9 @@ REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) PROTOBUF_GRPC_GATEWAY_TS_VERSION ?= 1.2.1 TESTPKGS ?= ./... JS_BUILD_ARGS ?= -PROTOBUF_GO_VERSION ?= 1.35.1 +PROTOBUF_GO_VERSION ?= 1.35.2 GRPC_GO_VERSION ?= 1.5.1 -GRPC_GATEWAY_VERSION ?= 2.23.0 +GRPC_GATEWAY_VERSION ?= 2.24.0 VTPROTOBUF_VERSION ?= 0.6.0 GOIMPORTS_VERSION ?= 0.27.0 DEEPCOPY_VERSION ?= v0.5.6 @@ -74,7 +74,7 @@ COMMON_ARGS += --build-arg=DEEPCOPY_VERSION="$(DEEPCOPY_VERSION)" COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)" COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)" COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)" -JS_TOOLCHAIN ?= docker.io/oven/bun:1.1.34-alpine +JS_TOOLCHAIN ?= docker.io/oven/bun:1.1.36-alpine TOOLCHAIN ?= docker.io/golang:1.23-alpine # extra variables diff --git a/client/api/common/omni.pb.go b/client/api/common/omni.pb.go index d8d30f2e..0e9a34b9 100644 --- a/client/api/common/omni.pb.go +++ b/client/api/common/omni.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: common/omni.proto diff --git a/client/api/omni/management/management.pb.go b/client/api/omni/management/management.pb.go index a199365b..199c4463 100644 --- a/client/api/omni/management/management.pb.go +++ b/client/api/omni/management/management.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/management/management.proto diff --git a/client/api/omni/management/management.pb.gw.go b/client/api/omni/management/management.pb.gw.go index 7bb0a2ad..36d60b37 100644 --- a/client/api/omni/management/management.pb.gw.go +++ b/client/api/omni/management/management.pb.gw.go @@ -10,6 +10,7 @@ package management import ( "context" + "errors" "io" "net/http" @@ -25,99 +26,96 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_ManagementService_Kubeconfig_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq KubeconfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq KubeconfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Kubeconfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_Kubeconfig_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq KubeconfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq KubeconfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Kubeconfig(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_Talosconfig_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TalosconfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq TalosconfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Talosconfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_Talosconfig_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq TalosconfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq TalosconfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Talosconfig(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_Omniconfig_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Omniconfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_Omniconfig_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Omniconfig(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_MachineLogs_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (ManagementService_MachineLogsClient, runtime.ServerMetadata, error) { - var protoReq MachineLogsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq MachineLogsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.MachineLogs(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -128,173 +126,160 @@ func request_ManagementService_MachineLogs_0(ctx context.Context, marshaler runt } metadata.HeaderMD = header return stream, metadata, nil - } func request_ManagementService_ValidateConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateConfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ValidateConfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ValidateConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_ValidateConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ValidateConfigRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ValidateConfigRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ValidateConfig(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_CreateServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateServiceAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_CreateServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateServiceAccount(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_RenewServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RenewServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RenewServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.RenewServiceAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_RenewServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq RenewServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq RenewServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.RenewServiceAccount(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_ListServiceAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ListServiceAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_ListServiceAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq emptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq emptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ListServiceAccounts(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_DestroyServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DestroyServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DestroyServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.DestroyServiceAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_DestroyServiceAccount_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DestroyServiceAccountRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DestroyServiceAccountRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.DestroyServiceAccount(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_KubernetesUpgradePreChecks_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq KubernetesUpgradePreChecksRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq KubernetesUpgradePreChecksRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.KubernetesUpgradePreChecks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_KubernetesUpgradePreChecks_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq KubernetesUpgradePreChecksRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq KubernetesUpgradePreChecksRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.KubernetesUpgradePreChecks(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_KubernetesSyncManifests_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (ManagementService_KubernetesSyncManifestsClient, runtime.ServerMetadata, error) { - var protoReq KubernetesSyncManifestRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq KubernetesSyncManifestRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.KubernetesSyncManifests(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -305,43 +290,40 @@ func request_ManagementService_KubernetesSyncManifests_0(ctx context.Context, ma } metadata.HeaderMD = header return stream, metadata, nil - } func request_ManagementService_CreateSchematic_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateSchematicRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateSchematicRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CreateSchematic(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ManagementService_CreateSchematic_0(ctx context.Context, marshaler runtime.Marshaler, server ManagementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateSchematicRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateSchematicRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CreateSchematic(ctx, &protoReq) return msg, metadata, err - } func request_ManagementService_GetSupportBundle_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (ManagementService_GetSupportBundleClient, runtime.ServerMetadata, error) { - var protoReq GetSupportBundleRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetSupportBundleRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.GetSupportBundle(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -352,17 +334,16 @@ func request_ManagementService_GetSupportBundle_0(ctx context.Context, marshaler } metadata.HeaderMD = header return stream, metadata, nil - } func request_ManagementService_ReadAuditLog_0(ctx context.Context, marshaler runtime.Marshaler, client ManagementServiceClient, req *http.Request, pathParams map[string]string) (ManagementService_ReadAuditLogClient, runtime.ServerMetadata, error) { - var protoReq ReadAuditLogRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ReadAuditLogRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.ReadAuditLog(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -373,7 +354,6 @@ func request_ManagementService_ReadAuditLog_0(ctx context.Context, marshaler run } metadata.HeaderMD = header return stream, metadata, nil - } // RegisterManagementServiceHandlerServer registers the http handlers for service ManagementService to "mux". @@ -382,16 +362,13 @@ func request_ManagementService_ReadAuditLog_0(ctx context.Context, marshaler run // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterManagementServiceHandlerFromEndpoint instead. // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ManagementServiceServer) error { - - mux.Handle("POST", pattern_ManagementService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Kubeconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Kubeconfig")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Kubeconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Kubeconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -403,20 +380,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Kubeconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_Talosconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Talosconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Talosconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Talosconfig")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Talosconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Talosconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -428,20 +400,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Talosconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_Omniconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Omniconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Omniconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Omniconfig")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/Omniconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Omniconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -453,27 +420,22 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Omniconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_ManagementService_MachineLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_MachineLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_ManagementService_ValidateConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ValidateConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/ValidateConfig", runtime.WithHTTPPathPattern("/management.ManagementService/ValidateConfig")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/ValidateConfig", runtime.WithHTTPPathPattern("/management.ManagementService/ValidateConfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -485,20 +447,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_ValidateConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_CreateServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_CreateServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/CreateServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/CreateServiceAccount")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/CreateServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/CreateServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -510,20 +467,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_CreateServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_RenewServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_RenewServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/RenewServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/RenewServiceAccount")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/RenewServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/RenewServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -535,20 +487,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_RenewServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_ListServiceAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ListServiceAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/ListServiceAccounts", runtime.WithHTTPPathPattern("/management.ManagementService/ListServiceAccounts")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/ListServiceAccounts", runtime.WithHTTPPathPattern("/management.ManagementService/ListServiceAccounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -560,20 +507,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_ListServiceAccounts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_DestroyServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_DestroyServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/DestroyServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/DestroyServiceAccount")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/DestroyServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/DestroyServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -585,20 +527,15 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_DestroyServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_KubernetesUpgradePreChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_KubernetesUpgradePreChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/KubernetesUpgradePreChecks", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesUpgradePreChecks")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/KubernetesUpgradePreChecks", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesUpgradePreChecks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -610,27 +547,22 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_KubernetesUpgradePreChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_ManagementService_KubernetesSyncManifests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_KubernetesSyncManifests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_ManagementService_CreateSchematic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_CreateSchematic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/CreateSchematic", runtime.WithHTTPPathPattern("/management.ManagementService/CreateSchematic")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/management.ManagementService/CreateSchematic", runtime.WithHTTPPathPattern("/management.ManagementService/CreateSchematic")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -642,19 +574,17 @@ func RegisterManagementServiceHandlerServer(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_CreateSchematic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_ManagementService_GetSupportBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_GetSupportBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - mux.Handle("POST", pattern_ManagementService_ReadAuditLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ReadAuditLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -685,7 +615,6 @@ func RegisterManagementServiceHandlerFromEndpoint(ctx context.Context, mux *runt } }() }() - return RegisterManagementServiceHandler(ctx, mux, conn) } @@ -701,14 +630,11 @@ func RegisterManagementServiceHandler(ctx context.Context, mux *runtime.ServeMux // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "ManagementServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ManagementServiceClient) error { - - mux.Handle("POST", pattern_ManagementService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Kubeconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Kubeconfig")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Kubeconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Kubeconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -719,18 +645,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Kubeconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_Talosconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Talosconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Talosconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Talosconfig")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Talosconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Talosconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -741,18 +662,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Talosconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_Omniconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_Omniconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Omniconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Omniconfig")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/Omniconfig", runtime.WithHTTPPathPattern("/management.ManagementService/Omniconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -763,18 +679,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_Omniconfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_MachineLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_MachineLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/MachineLogs", runtime.WithHTTPPathPattern("/management.ManagementService/MachineLogs")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/MachineLogs", runtime.WithHTTPPathPattern("/management.ManagementService/MachineLogs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -785,18 +696,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_MachineLogs_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_ValidateConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ValidateConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ValidateConfig", runtime.WithHTTPPathPattern("/management.ManagementService/ValidateConfig")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ValidateConfig", runtime.WithHTTPPathPattern("/management.ManagementService/ValidateConfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -807,18 +713,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_ValidateConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_CreateServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_CreateServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/CreateServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/CreateServiceAccount")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/CreateServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/CreateServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -829,18 +730,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_CreateServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_RenewServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_RenewServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/RenewServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/RenewServiceAccount")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/RenewServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/RenewServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -851,18 +747,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_RenewServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_ListServiceAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ListServiceAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ListServiceAccounts", runtime.WithHTTPPathPattern("/management.ManagementService/ListServiceAccounts")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ListServiceAccounts", runtime.WithHTTPPathPattern("/management.ManagementService/ListServiceAccounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -873,18 +764,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_ListServiceAccounts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_DestroyServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_DestroyServiceAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/DestroyServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/DestroyServiceAccount")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/DestroyServiceAccount", runtime.WithHTTPPathPattern("/management.ManagementService/DestroyServiceAccount")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -895,18 +781,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_DestroyServiceAccount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_KubernetesUpgradePreChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_KubernetesUpgradePreChecks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/KubernetesUpgradePreChecks", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesUpgradePreChecks")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/KubernetesUpgradePreChecks", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesUpgradePreChecks")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -917,18 +798,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_KubernetesUpgradePreChecks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_KubernetesSyncManifests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_KubernetesSyncManifests_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/KubernetesSyncManifests", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesSyncManifests")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/KubernetesSyncManifests", runtime.WithHTTPPathPattern("/management.ManagementService/KubernetesSyncManifests")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -939,18 +815,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_KubernetesSyncManifests_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_CreateSchematic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_CreateSchematic_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/CreateSchematic", runtime.WithHTTPPathPattern("/management.ManagementService/CreateSchematic")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/CreateSchematic", runtime.WithHTTPPathPattern("/management.ManagementService/CreateSchematic")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -961,18 +832,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_CreateSchematic_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_GetSupportBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_GetSupportBundle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/GetSupportBundle", runtime.WithHTTPPathPattern("/management.ManagementService/GetSupportBundle")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/GetSupportBundle", runtime.WithHTTPPathPattern("/management.ManagementService/GetSupportBundle")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -983,18 +849,13 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_GetSupportBundle_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ManagementService_ReadAuditLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ManagementService_ReadAuditLog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ReadAuditLog", runtime.WithHTTPPathPattern("/management.ManagementService/ReadAuditLog")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/management.ManagementService/ReadAuditLog", runtime.WithHTTPPathPattern("/management.ManagementService/ReadAuditLog")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1005,70 +866,41 @@ func RegisterManagementServiceHandlerClient(ctx context.Context, mux *runtime.Se runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ManagementService_ReadAuditLog_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_ManagementService_Kubeconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Kubeconfig"}, "")) - - pattern_ManagementService_Talosconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Talosconfig"}, "")) - - pattern_ManagementService_Omniconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Omniconfig"}, "")) - - pattern_ManagementService_MachineLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "MachineLogs"}, "")) - - pattern_ManagementService_ValidateConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ValidateConfig"}, "")) - - pattern_ManagementService_CreateServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "CreateServiceAccount"}, "")) - - pattern_ManagementService_RenewServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "RenewServiceAccount"}, "")) - - pattern_ManagementService_ListServiceAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ListServiceAccounts"}, "")) - - pattern_ManagementService_DestroyServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "DestroyServiceAccount"}, "")) - + pattern_ManagementService_Kubeconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Kubeconfig"}, "")) + pattern_ManagementService_Talosconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Talosconfig"}, "")) + pattern_ManagementService_Omniconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "Omniconfig"}, "")) + pattern_ManagementService_MachineLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "MachineLogs"}, "")) + pattern_ManagementService_ValidateConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ValidateConfig"}, "")) + pattern_ManagementService_CreateServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "CreateServiceAccount"}, "")) + pattern_ManagementService_RenewServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "RenewServiceAccount"}, "")) + pattern_ManagementService_ListServiceAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ListServiceAccounts"}, "")) + pattern_ManagementService_DestroyServiceAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "DestroyServiceAccount"}, "")) pattern_ManagementService_KubernetesUpgradePreChecks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "KubernetesUpgradePreChecks"}, "")) - - pattern_ManagementService_KubernetesSyncManifests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "KubernetesSyncManifests"}, "")) - - pattern_ManagementService_CreateSchematic_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "CreateSchematic"}, "")) - - pattern_ManagementService_GetSupportBundle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "GetSupportBundle"}, "")) - - pattern_ManagementService_ReadAuditLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ReadAuditLog"}, "")) + pattern_ManagementService_KubernetesSyncManifests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "KubernetesSyncManifests"}, "")) + pattern_ManagementService_CreateSchematic_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "CreateSchematic"}, "")) + pattern_ManagementService_GetSupportBundle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "GetSupportBundle"}, "")) + pattern_ManagementService_ReadAuditLog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"management.ManagementService", "ReadAuditLog"}, "")) ) var ( - forward_ManagementService_Kubeconfig_0 = runtime.ForwardResponseMessage - - forward_ManagementService_Talosconfig_0 = runtime.ForwardResponseMessage - - forward_ManagementService_Omniconfig_0 = runtime.ForwardResponseMessage - - forward_ManagementService_MachineLogs_0 = runtime.ForwardResponseStream - - forward_ManagementService_ValidateConfig_0 = runtime.ForwardResponseMessage - - forward_ManagementService_CreateServiceAccount_0 = runtime.ForwardResponseMessage - - forward_ManagementService_RenewServiceAccount_0 = runtime.ForwardResponseMessage - - forward_ManagementService_ListServiceAccounts_0 = runtime.ForwardResponseMessage - - forward_ManagementService_DestroyServiceAccount_0 = runtime.ForwardResponseMessage - + forward_ManagementService_Kubeconfig_0 = runtime.ForwardResponseMessage + forward_ManagementService_Talosconfig_0 = runtime.ForwardResponseMessage + forward_ManagementService_Omniconfig_0 = runtime.ForwardResponseMessage + forward_ManagementService_MachineLogs_0 = runtime.ForwardResponseStream + forward_ManagementService_ValidateConfig_0 = runtime.ForwardResponseMessage + forward_ManagementService_CreateServiceAccount_0 = runtime.ForwardResponseMessage + forward_ManagementService_RenewServiceAccount_0 = runtime.ForwardResponseMessage + forward_ManagementService_ListServiceAccounts_0 = runtime.ForwardResponseMessage + forward_ManagementService_DestroyServiceAccount_0 = runtime.ForwardResponseMessage forward_ManagementService_KubernetesUpgradePreChecks_0 = runtime.ForwardResponseMessage - - forward_ManagementService_KubernetesSyncManifests_0 = runtime.ForwardResponseStream - - forward_ManagementService_CreateSchematic_0 = runtime.ForwardResponseMessage - - forward_ManagementService_GetSupportBundle_0 = runtime.ForwardResponseStream - - forward_ManagementService_ReadAuditLog_0 = runtime.ForwardResponseStream + forward_ManagementService_KubernetesSyncManifests_0 = runtime.ForwardResponseStream + forward_ManagementService_CreateSchematic_0 = runtime.ForwardResponseMessage + forward_ManagementService_GetSupportBundle_0 = runtime.ForwardResponseStream + forward_ManagementService_ReadAuditLog_0 = runtime.ForwardResponseStream ) diff --git a/client/api/omni/oidc/oidc.pb.go b/client/api/omni/oidc/oidc.pb.go index 6deb91ce..a4008399 100644 --- a/client/api/omni/oidc/oidc.pb.go +++ b/client/api/omni/oidc/oidc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/oidc/oidc.proto diff --git a/client/api/omni/oidc/oidc.pb.gw.go b/client/api/omni/oidc/oidc.pb.gw.go index 1a4b2323..5f8b4bd6 100644 --- a/client/api/omni/oidc/oidc.pb.gw.go +++ b/client/api/omni/oidc/oidc.pb.gw.go @@ -10,6 +10,7 @@ package oidc import ( "context" + "errors" "io" "net/http" @@ -24,37 +25,38 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_OIDCService_Authenticate_0(ctx context.Context, marshaler runtime.Marshaler, client OIDCServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AuthenticateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq AuthenticateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Authenticate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_OIDCService_Authenticate_0(ctx context.Context, marshaler runtime.Marshaler, server OIDCServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AuthenticateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq AuthenticateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Authenticate(ctx, &protoReq) return msg, metadata, err - } // RegisterOIDCServiceHandlerServer registers the http handlers for service OIDCService to "mux". @@ -63,16 +65,13 @@ func local_request_OIDCService_Authenticate_0(ctx context.Context, marshaler run // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOIDCServiceHandlerFromEndpoint instead. // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterOIDCServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OIDCServiceServer) error { - - mux.Handle("POST", pattern_OIDCService_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_OIDCService_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/oidc.OIDCService/Authenticate", runtime.WithHTTPPathPattern("/oidc.OIDCService/Authenticate")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/oidc.OIDCService/Authenticate", runtime.WithHTTPPathPattern("/oidc.OIDCService/Authenticate")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -84,9 +83,7 @@ func RegisterOIDCServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OIDCService_Authenticate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -113,7 +110,6 @@ func RegisterOIDCServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.Se } }() }() - return RegisterOIDCServiceHandler(ctx, mux, conn) } @@ -129,14 +125,11 @@ func RegisterOIDCServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "OIDCServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterOIDCServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OIDCServiceClient) error { - - mux.Handle("POST", pattern_OIDCService_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_OIDCService_Authenticate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/oidc.OIDCService/Authenticate", runtime.WithHTTPPathPattern("/oidc.OIDCService/Authenticate")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/oidc.OIDCService/Authenticate", runtime.WithHTTPPathPattern("/oidc.OIDCService/Authenticate")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -147,11 +140,8 @@ func RegisterOIDCServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_OIDCService_Authenticate_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } diff --git a/client/api/omni/resources/resources.pb.go b/client/api/omni/resources/resources.pb.go index 92b9da38..cbdd61b8 100644 --- a/client/api/omni/resources/resources.pb.go +++ b/client/api/omni/resources/resources.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/resources/resources.proto diff --git a/client/api/omni/resources/resources.pb.gw.go b/client/api/omni/resources/resources.pb.gw.go index f40289e2..3cdf32ca 100644 --- a/client/api/omni/resources/resources.pb.gw.go +++ b/client/api/omni/resources/resources.pb.gw.go @@ -10,6 +10,7 @@ package resources import ( "context" + "errors" "io" "net/http" @@ -24,177 +25,168 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_ResourceService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq GetRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Get(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_List_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.List(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_List_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq ListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.List(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_Create_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq CreateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq CreateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Create(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq UpdateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq UpdateRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Update(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Delete(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_Teardown_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Teardown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_ResourceService_Teardown_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq DeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Teardown(ctx, &protoReq) return msg, metadata, err - } func request_ResourceService_Watch_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (ResourceService_WatchClient, runtime.ServerMetadata, error) { - var protoReq WatchRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq WatchRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Watch(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -205,7 +197,6 @@ func request_ResourceService_Watch_0(ctx context.Context, marshaler runtime.Mars } metadata.HeaderMD = header return stream, metadata, nil - } // RegisterResourceServiceHandlerServer registers the http handlers for service ResourceService to "mux". @@ -214,16 +205,13 @@ func request_ResourceService_Watch_0(ctx context.Context, marshaler runtime.Mars // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterResourceServiceHandlerFromEndpoint instead. // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ResourceServiceServer) error { - - mux.Handle("POST", pattern_ResourceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Get", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Get")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Get", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Get")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -235,20 +223,15 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/List", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/List")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/List", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/List")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -260,20 +243,15 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Create", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Create")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Create", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Create")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -285,20 +263,15 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Update", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Update")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Update", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -310,20 +283,15 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Update_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Delete", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Delete")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Delete", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -335,20 +303,15 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Teardown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Teardown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Teardown", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Teardown")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/omni.resources.ResourceService/Teardown", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Teardown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -360,12 +323,10 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Teardown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_ResourceService_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -396,7 +357,6 @@ func RegisterResourceServiceHandlerFromEndpoint(ctx context.Context, mux *runtim } }() }() - return RegisterResourceServiceHandler(ctx, mux, conn) } @@ -412,14 +372,11 @@ func RegisterResourceServiceHandler(ctx context.Context, mux *runtime.ServeMux, // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "ResourceServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ResourceServiceClient) error { - - mux.Handle("POST", pattern_ResourceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Get", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Get")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Get", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Get")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -430,18 +387,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/List", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/List")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/List", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/List")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -452,18 +404,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_List_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Create", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Create")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Create", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Create")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -474,18 +421,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Update", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Update")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Update", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -496,18 +438,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Update_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Delete", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Delete")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Delete", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -518,18 +455,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Teardown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Teardown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Teardown", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Teardown")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Teardown", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Teardown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -540,18 +472,13 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Teardown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_ResourceService_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_ResourceService_Watch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Watch", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Watch")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/omni.resources.ResourceService/Watch", runtime.WithHTTPPathPattern("/omni.resources.ResourceService/Watch")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -562,42 +489,27 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_Watch_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_ResourceService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Get"}, "")) - - pattern_ResourceService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "List"}, "")) - - pattern_ResourceService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Create"}, "")) - - pattern_ResourceService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Update"}, "")) - - pattern_ResourceService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Delete"}, "")) - + pattern_ResourceService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Get"}, "")) + pattern_ResourceService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "List"}, "")) + pattern_ResourceService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Create"}, "")) + pattern_ResourceService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Update"}, "")) + pattern_ResourceService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Delete"}, "")) pattern_ResourceService_Teardown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Teardown"}, "")) - - pattern_ResourceService_Watch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Watch"}, "")) + pattern_ResourceService_Watch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"omni.resources.ResourceService", "Watch"}, "")) ) var ( - forward_ResourceService_Get_0 = runtime.ForwardResponseMessage - - forward_ResourceService_List_0 = runtime.ForwardResponseMessage - - forward_ResourceService_Create_0 = runtime.ForwardResponseMessage - - forward_ResourceService_Update_0 = runtime.ForwardResponseMessage - - forward_ResourceService_Delete_0 = runtime.ForwardResponseMessage - + forward_ResourceService_Get_0 = runtime.ForwardResponseMessage + forward_ResourceService_List_0 = runtime.ForwardResponseMessage + forward_ResourceService_Create_0 = runtime.ForwardResponseMessage + forward_ResourceService_Update_0 = runtime.ForwardResponseMessage + forward_ResourceService_Delete_0 = runtime.ForwardResponseMessage forward_ResourceService_Teardown_0 = runtime.ForwardResponseMessage - - forward_ResourceService_Watch_0 = runtime.ForwardResponseStream + forward_ResourceService_Watch_0 = runtime.ForwardResponseStream ) diff --git a/client/api/omni/specs/auth.pb.go b/client/api/omni/specs/auth.pb.go index c0b488f1..f019b997 100644 --- a/client/api/omni/specs/auth.pb.go +++ b/client/api/omni/specs/auth.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/auth.proto diff --git a/client/api/omni/specs/ephemeral.pb.go b/client/api/omni/specs/ephemeral.pb.go index 3ca3b231..c1d6a210 100644 --- a/client/api/omni/specs/ephemeral.pb.go +++ b/client/api/omni/specs/ephemeral.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/ephemeral.proto diff --git a/client/api/omni/specs/infra.pb.go b/client/api/omni/specs/infra.pb.go index 14d1a49d..05a93990 100644 --- a/client/api/omni/specs/infra.pb.go +++ b/client/api/omni/specs/infra.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/infra.proto @@ -73,6 +73,101 @@ func (MachineRequestStatusSpec_Stage) EnumDescriptor() ([]byte, []int) { return file_omni_specs_infra_proto_rawDescGZIP(), []int{1, 0} } +type InfraMachineSpec_MachinePowerState int32 + +const ( + InfraMachineSpec_POWER_STATE_OFF InfraMachineSpec_MachinePowerState = 0 + InfraMachineSpec_POWER_STATE_ON InfraMachineSpec_MachinePowerState = 1 +) + +// Enum value maps for InfraMachineSpec_MachinePowerState. +var ( + InfraMachineSpec_MachinePowerState_name = map[int32]string{ + 0: "POWER_STATE_OFF", + 1: "POWER_STATE_ON", + } + InfraMachineSpec_MachinePowerState_value = map[string]int32{ + "POWER_STATE_OFF": 0, + "POWER_STATE_ON": 1, + } +) + +func (x InfraMachineSpec_MachinePowerState) Enum() *InfraMachineSpec_MachinePowerState { + p := new(InfraMachineSpec_MachinePowerState) + *p = x + return p +} + +func (x InfraMachineSpec_MachinePowerState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InfraMachineSpec_MachinePowerState) Descriptor() protoreflect.EnumDescriptor { + return file_omni_specs_infra_proto_enumTypes[1].Descriptor() +} + +func (InfraMachineSpec_MachinePowerState) Type() protoreflect.EnumType { + return &file_omni_specs_infra_proto_enumTypes[1] +} + +func (x InfraMachineSpec_MachinePowerState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InfraMachineSpec_MachinePowerState.Descriptor instead. +func (InfraMachineSpec_MachinePowerState) EnumDescriptor() ([]byte, []int) { + return file_omni_specs_infra_proto_rawDescGZIP(), []int{2, 0} +} + +type InfraMachineStatusSpec_MachinePowerState int32 + +const ( + InfraMachineStatusSpec_POWER_STATE_UNKNOWN InfraMachineStatusSpec_MachinePowerState = 0 + InfraMachineStatusSpec_POWER_STATE_OFF InfraMachineStatusSpec_MachinePowerState = 1 + InfraMachineStatusSpec_POWER_STATE_ON InfraMachineStatusSpec_MachinePowerState = 2 +) + +// Enum value maps for InfraMachineStatusSpec_MachinePowerState. +var ( + InfraMachineStatusSpec_MachinePowerState_name = map[int32]string{ + 0: "POWER_STATE_UNKNOWN", + 1: "POWER_STATE_OFF", + 2: "POWER_STATE_ON", + } + InfraMachineStatusSpec_MachinePowerState_value = map[string]int32{ + "POWER_STATE_UNKNOWN": 0, + "POWER_STATE_OFF": 1, + "POWER_STATE_ON": 2, + } +) + +func (x InfraMachineStatusSpec_MachinePowerState) Enum() *InfraMachineStatusSpec_MachinePowerState { + p := new(InfraMachineStatusSpec_MachinePowerState) + *p = x + return p +} + +func (x InfraMachineStatusSpec_MachinePowerState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InfraMachineStatusSpec_MachinePowerState) Descriptor() protoreflect.EnumDescriptor { + return file_omni_specs_infra_proto_enumTypes[2].Descriptor() +} + +func (InfraMachineStatusSpec_MachinePowerState) Type() protoreflect.EnumType { + return &file_omni_specs_infra_proto_enumTypes[2] +} + +func (x InfraMachineStatusSpec_MachinePowerState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InfraMachineStatusSpec_MachinePowerState.Descriptor instead. +func (InfraMachineStatusSpec_MachinePowerState) EnumDescriptor() ([]byte, []int) { + return file_omni_specs_infra_proto_rawDescGZIP(), []int{4, 0} +} + type MachineRequestSpec struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -235,6 +330,184 @@ func (x *MachineRequestStatusSpec) GetStatus() string { return "" } +type InfraMachineSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PreferredPowerState InfraMachineSpec_MachinePowerState `protobuf:"varint,1,opt,name=preferred_power_state,json=preferredPowerState,proto3,enum=specs.InfraMachineSpec_MachinePowerState" json:"preferred_power_state,omitempty"` + Accepted bool `protobuf:"varint,2,opt,name=accepted,proto3" json:"accepted,omitempty"` + ClusterTalosVersion string `protobuf:"bytes,3,opt,name=cluster_talos_version,json=clusterTalosVersion,proto3" json:"cluster_talos_version,omitempty"` + Extensions []string `protobuf:"bytes,4,rep,name=extensions,proto3" json:"extensions,omitempty"` + // WipeId is set to a new id each time the machine gets unallocated. + // + // It is used by the provider to ensure that the machine is wiped between allocations. + WipeId string `protobuf:"bytes,5,opt,name=wipe_id,json=wipeId,proto3" json:"wipe_id,omitempty"` +} + +func (x *InfraMachineSpec) Reset() { + *x = InfraMachineSpec{} + mi := &file_omni_specs_infra_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfraMachineSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfraMachineSpec) ProtoMessage() {} + +func (x *InfraMachineSpec) ProtoReflect() protoreflect.Message { + mi := &file_omni_specs_infra_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfraMachineSpec.ProtoReflect.Descriptor instead. +func (*InfraMachineSpec) Descriptor() ([]byte, []int) { + return file_omni_specs_infra_proto_rawDescGZIP(), []int{2} +} + +func (x *InfraMachineSpec) GetPreferredPowerState() InfraMachineSpec_MachinePowerState { + if x != nil { + return x.PreferredPowerState + } + return InfraMachineSpec_POWER_STATE_OFF +} + +func (x *InfraMachineSpec) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + +func (x *InfraMachineSpec) GetClusterTalosVersion() string { + if x != nil { + return x.ClusterTalosVersion + } + return "" +} + +func (x *InfraMachineSpec) GetExtensions() []string { + if x != nil { + return x.Extensions + } + return nil +} + +func (x *InfraMachineSpec) GetWipeId() string { + if x != nil { + return x.WipeId + } + return "" +} + +type InfraMachineStateSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Installed bool `protobuf:"varint,1,opt,name=installed,proto3" json:"installed,omitempty"` +} + +func (x *InfraMachineStateSpec) Reset() { + *x = InfraMachineStateSpec{} + mi := &file_omni_specs_infra_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfraMachineStateSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfraMachineStateSpec) ProtoMessage() {} + +func (x *InfraMachineStateSpec) ProtoReflect() protoreflect.Message { + mi := &file_omni_specs_infra_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfraMachineStateSpec.ProtoReflect.Descriptor instead. +func (*InfraMachineStateSpec) Descriptor() ([]byte, []int) { + return file_omni_specs_infra_proto_rawDescGZIP(), []int{3} +} + +func (x *InfraMachineStateSpec) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +type InfraMachineStatusSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PowerState InfraMachineStatusSpec_MachinePowerState `protobuf:"varint,1,opt,name=power_state,json=powerState,proto3,enum=specs.InfraMachineStatusSpec_MachinePowerState" json:"power_state,omitempty"` + ReadyToUse bool `protobuf:"varint,2,opt,name=ready_to_use,json=readyToUse,proto3" json:"ready_to_use,omitempty"` +} + +func (x *InfraMachineStatusSpec) Reset() { + *x = InfraMachineStatusSpec{} + mi := &file_omni_specs_infra_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfraMachineStatusSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfraMachineStatusSpec) ProtoMessage() {} + +func (x *InfraMachineStatusSpec) ProtoReflect() protoreflect.Message { + mi := &file_omni_specs_infra_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfraMachineStatusSpec.ProtoReflect.Descriptor instead. +func (*InfraMachineStatusSpec) Descriptor() ([]byte, []int) { + return file_omni_specs_infra_proto_rawDescGZIP(), []int{4} +} + +func (x *InfraMachineStatusSpec) GetPowerState() InfraMachineStatusSpec_MachinePowerState { + if x != nil { + return x.PowerState + } + return InfraMachineStatusSpec_POWER_STATE_UNKNOWN +} + +func (x *InfraMachineStatusSpec) GetReadyToUse() bool { + if x != nil { + return x.ReadyToUse + } + return false +} + type InfraProviderStatusSpec struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -248,7 +521,7 @@ type InfraProviderStatusSpec struct { func (x *InfraProviderStatusSpec) Reset() { *x = InfraProviderStatusSpec{} - mi := &file_omni_specs_infra_proto_msgTypes[2] + mi := &file_omni_specs_infra_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -260,7 +533,7 @@ func (x *InfraProviderStatusSpec) String() string { func (*InfraProviderStatusSpec) ProtoMessage() {} func (x *InfraProviderStatusSpec) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_infra_proto_msgTypes[2] + mi := &file_omni_specs_infra_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -273,7 +546,7 @@ func (x *InfraProviderStatusSpec) ProtoReflect() protoreflect.Message { // Deprecated: Use InfraProviderStatusSpec.ProtoReflect.Descriptor instead. func (*InfraProviderStatusSpec) Descriptor() ([]byte, []int) { - return file_omni_specs_infra_proto_rawDescGZIP(), []int{2} + return file_omni_specs_infra_proto_rawDescGZIP(), []int{5} } func (x *InfraProviderStatusSpec) GetSchema() string { @@ -343,19 +616,56 @@ var file_omni_specs_infra_proto_rawDesc = []byte{ 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, - 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0x7b, 0x0a, 0x17, 0x49, 0x6e, - 0x66, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x42, 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x6c, 0x61, 0x62, 0x73, - 0x2f, 0x6f, 0x6d, 0x6e, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x6f, 0x6d, 0x6e, 0x69, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0xb8, 0x02, 0x0a, 0x10, 0x49, + 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, + 0x5d, 0x0a, 0x15, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x5f, 0x70, 0x6f, 0x77, + 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, + 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, + 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x13, 0x70, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x72, 0x65, 0x64, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, + 0x0a, 0x07, 0x77, 0x69, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x77, 0x69, 0x70, 0x65, 0x49, 0x64, 0x22, 0x3c, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, + 0x6e, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f, + 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x46, 0x46, 0x10, + 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x4f, 0x4e, 0x10, 0x01, 0x22, 0x35, 0x0a, 0x15, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1c, + 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0xe3, 0x01, 0x0a, + 0x16, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x50, 0x0a, 0x0b, 0x70, 0x6f, 0x77, 0x65, 0x72, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x73, + 0x70, 0x65, 0x63, 0x73, 0x2e, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4d, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0a, 0x70, + 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0c, 0x72, 0x65, 0x61, + 0x64, 0x79, 0x5f, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x6f, 0x55, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x11, 0x4d, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x17, 0x0a, 0x13, 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x4f, 0x57, + 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x46, 0x46, 0x10, 0x01, 0x12, 0x12, + 0x0a, 0x0e, 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4e, + 0x10, 0x02, 0x22, 0x7b, 0x0a, 0x17, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, + 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x42, + 0x32, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x69, + 0x64, 0x65, 0x72, 0x6f, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6f, 0x6d, 0x6e, 0x69, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6f, 0x6d, 0x6e, 0x69, 0x2f, 0x73, 0x70, + 0x65, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -370,27 +680,34 @@ func file_omni_specs_infra_proto_rawDescGZIP() []byte { return file_omni_specs_infra_proto_rawDescData } -var file_omni_specs_infra_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_omni_specs_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_omni_specs_infra_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_omni_specs_infra_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_omni_specs_infra_proto_goTypes = []any{ - (MachineRequestStatusSpec_Stage)(0), // 0: specs.MachineRequestStatusSpec.Stage - (*MachineRequestSpec)(nil), // 1: specs.MachineRequestSpec - (*MachineRequestStatusSpec)(nil), // 2: specs.MachineRequestStatusSpec - (*InfraProviderStatusSpec)(nil), // 3: specs.InfraProviderStatusSpec - (*Overlay)(nil), // 4: specs.Overlay - (*MetaValue)(nil), // 5: specs.MetaValue - (GrpcTunnelMode)(0), // 6: specs.GrpcTunnelMode + (MachineRequestStatusSpec_Stage)(0), // 0: specs.MachineRequestStatusSpec.Stage + (InfraMachineSpec_MachinePowerState)(0), // 1: specs.InfraMachineSpec.MachinePowerState + (InfraMachineStatusSpec_MachinePowerState)(0), // 2: specs.InfraMachineStatusSpec.MachinePowerState + (*MachineRequestSpec)(nil), // 3: specs.MachineRequestSpec + (*MachineRequestStatusSpec)(nil), // 4: specs.MachineRequestStatusSpec + (*InfraMachineSpec)(nil), // 5: specs.InfraMachineSpec + (*InfraMachineStateSpec)(nil), // 6: specs.InfraMachineStateSpec + (*InfraMachineStatusSpec)(nil), // 7: specs.InfraMachineStatusSpec + (*InfraProviderStatusSpec)(nil), // 8: specs.InfraProviderStatusSpec + (*Overlay)(nil), // 9: specs.Overlay + (*MetaValue)(nil), // 10: specs.MetaValue + (GrpcTunnelMode)(0), // 11: specs.GrpcTunnelMode } var file_omni_specs_infra_proto_depIdxs = []int32{ - 4, // 0: specs.MachineRequestSpec.overlay:type_name -> specs.Overlay - 5, // 1: specs.MachineRequestSpec.meta_values:type_name -> specs.MetaValue - 6, // 2: specs.MachineRequestSpec.grpc_tunnel:type_name -> specs.GrpcTunnelMode - 0, // 3: specs.MachineRequestStatusSpec.stage:type_name -> specs.MachineRequestStatusSpec.Stage - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 9, // 0: specs.MachineRequestSpec.overlay:type_name -> specs.Overlay + 10, // 1: specs.MachineRequestSpec.meta_values:type_name -> specs.MetaValue + 11, // 2: specs.MachineRequestSpec.grpc_tunnel:type_name -> specs.GrpcTunnelMode + 0, // 3: specs.MachineRequestStatusSpec.stage:type_name -> specs.MachineRequestStatusSpec.Stage + 1, // 4: specs.InfraMachineSpec.preferred_power_state:type_name -> specs.InfraMachineSpec.MachinePowerState + 2, // 5: specs.InfraMachineStatusSpec.power_state:type_name -> specs.InfraMachineStatusSpec.MachinePowerState + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_omni_specs_infra_proto_init() } @@ -404,8 +721,8 @@ func file_omni_specs_infra_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_omni_specs_infra_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, + NumEnums: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/client/api/omni/specs/infra.proto b/client/api/omni/specs/infra.proto index e4d35796..1ef6069b 100644 --- a/client/api/omni/specs/infra.proto +++ b/client/api/omni/specs/infra.proto @@ -29,6 +29,38 @@ message MachineRequestStatusSpec { string status = 4; } +message InfraMachineSpec { + enum MachinePowerState { + POWER_STATE_OFF = 0; + POWER_STATE_ON = 1; + } + + MachinePowerState preferred_power_state = 1; + bool accepted = 2; + string cluster_talos_version = 3; + repeated string extensions = 4; + + // WipeId is set to a new id each time the machine gets unallocated. + // + // It is used by the provider to ensure that the machine is wiped between allocations. + string wipe_id = 5; +} + +message InfraMachineStateSpec { + bool installed = 1; +} + +message InfraMachineStatusSpec { + enum MachinePowerState { + POWER_STATE_UNKNOWN = 0; + POWER_STATE_OFF = 1; + POWER_STATE_ON = 2; + } + + MachinePowerState power_state = 1; + bool ready_to_use = 2; +} + message InfraProviderStatusSpec { string schema = 1; string name = 2; diff --git a/client/api/omni/specs/infra_vtproto.pb.go b/client/api/omni/specs/infra_vtproto.pb.go index 0b9c0544..346c7873 100644 --- a/client/api/omni/specs/infra_vtproto.pb.go +++ b/client/api/omni/specs/infra_vtproto.pb.go @@ -77,6 +77,66 @@ func (m *MachineRequestStatusSpec) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *InfraMachineSpec) CloneVT() *InfraMachineSpec { + if m == nil { + return (*InfraMachineSpec)(nil) + } + r := new(InfraMachineSpec) + r.PreferredPowerState = m.PreferredPowerState + r.Accepted = m.Accepted + r.ClusterTalosVersion = m.ClusterTalosVersion + r.WipeId = m.WipeId + if rhs := m.Extensions; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Extensions = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfraMachineSpec) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InfraMachineStateSpec) CloneVT() *InfraMachineStateSpec { + if m == nil { + return (*InfraMachineStateSpec)(nil) + } + r := new(InfraMachineStateSpec) + r.Installed = m.Installed + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfraMachineStateSpec) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *InfraMachineStatusSpec) CloneVT() *InfraMachineStatusSpec { + if m == nil { + return (*InfraMachineStatusSpec)(nil) + } + r := new(InfraMachineStatusSpec) + r.PowerState = m.PowerState + r.ReadyToUse = m.ReadyToUse + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfraMachineStatusSpec) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (m *InfraProviderStatusSpec) CloneVT() *InfraProviderStatusSpec { if m == nil { return (*InfraProviderStatusSpec)(nil) @@ -188,6 +248,84 @@ func (this *MachineRequestStatusSpec) EqualMessageVT(thatMsg proto.Message) bool } return this.EqualVT(that) } +func (this *InfraMachineSpec) EqualVT(that *InfraMachineSpec) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PreferredPowerState != that.PreferredPowerState { + return false + } + if this.Accepted != that.Accepted { + return false + } + if this.ClusterTalosVersion != that.ClusterTalosVersion { + return false + } + if len(this.Extensions) != len(that.Extensions) { + return false + } + for i, vx := range this.Extensions { + vy := that.Extensions[i] + if vx != vy { + return false + } + } + if this.WipeId != that.WipeId { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfraMachineSpec) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfraMachineSpec) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InfraMachineStateSpec) EqualVT(that *InfraMachineStateSpec) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Installed != that.Installed { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfraMachineStateSpec) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfraMachineStateSpec) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *InfraMachineStatusSpec) EqualVT(that *InfraMachineStatusSpec) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PowerState != that.PowerState { + return false + } + if this.ReadyToUse != that.ReadyToUse { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfraMachineStatusSpec) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfraMachineStatusSpec) + if !ok { + return false + } + return this.EqualVT(that) +} func (this *InfraProviderStatusSpec) EqualVT(that *InfraProviderStatusSpec) bool { if this == that { return true @@ -367,6 +505,168 @@ func (m *MachineRequestStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *InfraMachineSpec) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfraMachineSpec) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfraMachineSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.WipeId) > 0 { + i -= len(m.WipeId) + copy(dAtA[i:], m.WipeId) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.WipeId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Extensions) > 0 { + for iNdEx := len(m.Extensions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Extensions[iNdEx]) + copy(dAtA[i:], m.Extensions[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Extensions[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ClusterTalosVersion) > 0 { + i -= len(m.ClusterTalosVersion) + copy(dAtA[i:], m.ClusterTalosVersion) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ClusterTalosVersion))) + i-- + dAtA[i] = 0x1a + } + if m.Accepted { + i-- + if m.Accepted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.PreferredPowerState != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PreferredPowerState)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *InfraMachineStateSpec) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfraMachineStateSpec) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfraMachineStateSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Installed { + i-- + if m.Installed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *InfraMachineStatusSpec) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfraMachineStatusSpec) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfraMachineStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ReadyToUse { + i-- + if m.ReadyToUse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.PowerState != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PowerState)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *InfraProviderStatusSpec) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -496,25 +796,29 @@ func (m *MachineRequestStatusSpec) SizeVT() (n int) { return n } -func (m *InfraProviderStatusSpec) SizeVT() (n int) { +func (m *InfraMachineSpec) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Schema) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.PreferredPowerState != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PreferredPowerState)) } - l = len(m.Name) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.Accepted { + n += 2 } - l = len(m.Description) + l = len(m.ClusterTalosVersion) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - l = len(m.Icon) + if len(m.Extensions) > 0 { + for _, s := range m.Extensions { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + l = len(m.WipeId) if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } @@ -522,22 +826,77 @@ func (m *InfraProviderStatusSpec) SizeVT() (n int) { return n } -func (m *MachineRequestSpec) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift +func (m *InfraMachineStateSpec) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Installed { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *InfraMachineStatusSpec) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PowerState != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PowerState)) + } + if m.ReadyToUse { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *InfraProviderStatusSpec) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Schema) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Icon) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *MachineRequestSpec) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -956,6 +1315,353 @@ func (m *MachineRequestStatusSpec) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *InfraMachineSpec) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfraMachineSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfraMachineSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreferredPowerState", wireType) + } + m.PreferredPowerState = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreferredPowerState |= InfraMachineSpec_MachinePowerState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Accepted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Accepted = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterTalosVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClusterTalosVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Extensions = append(m.Extensions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WipeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WipeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfraMachineStateSpec) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfraMachineStateSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfraMachineStateSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Installed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Installed = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InfraMachineStatusSpec) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfraMachineStatusSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfraMachineStatusSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PowerState", wireType) + } + m.PowerState = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PowerState |= InfraMachineStatusSpec_MachinePowerState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadyToUse", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadyToUse = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *InfraProviderStatusSpec) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/client/api/omni/specs/oidc.pb.go b/client/api/omni/specs/oidc.pb.go index 3ad26b99..0bfc4b9f 100644 --- a/client/api/omni/specs/oidc.pb.go +++ b/client/api/omni/specs/oidc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/oidc.proto diff --git a/client/api/omni/specs/omni.pb.go b/client/api/omni/specs/omni.pb.go index c9e2989a..bec9038a 100644 --- a/client/api/omni/specs/omni.pb.go +++ b/client/api/omni/specs/omni.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/omni.proto @@ -1020,6 +1020,55 @@ func (ClusterMachineRequestStatusSpec_Stage) EnumDescriptor() ([]byte, []int) { return file_omni_specs_omni_proto_rawDescGZIP(), []int{79, 0} } +type InfraMachineConfigSpec_MachinePowerState int32 + +const ( + InfraMachineConfigSpec_POWER_STATE_DEFAULT InfraMachineConfigSpec_MachinePowerState = 0 + InfraMachineConfigSpec_POWER_STATE_OFF InfraMachineConfigSpec_MachinePowerState = 1 + InfraMachineConfigSpec_POWER_STATE_ON InfraMachineConfigSpec_MachinePowerState = 2 +) + +// Enum value maps for InfraMachineConfigSpec_MachinePowerState. +var ( + InfraMachineConfigSpec_MachinePowerState_name = map[int32]string{ + 0: "POWER_STATE_DEFAULT", + 1: "POWER_STATE_OFF", + 2: "POWER_STATE_ON", + } + InfraMachineConfigSpec_MachinePowerState_value = map[string]int32{ + "POWER_STATE_DEFAULT": 0, + "POWER_STATE_OFF": 1, + "POWER_STATE_ON": 2, + } +) + +func (x InfraMachineConfigSpec_MachinePowerState) Enum() *InfraMachineConfigSpec_MachinePowerState { + p := new(InfraMachineConfigSpec_MachinePowerState) + *p = x + return p +} + +func (x InfraMachineConfigSpec_MachinePowerState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InfraMachineConfigSpec_MachinePowerState) Descriptor() protoreflect.EnumDescriptor { + return file_omni_specs_omni_proto_enumTypes[19].Descriptor() +} + +func (InfraMachineConfigSpec_MachinePowerState) Type() protoreflect.EnumType { + return &file_omni_specs_omni_proto_enumTypes[19] +} + +func (x InfraMachineConfigSpec_MachinePowerState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InfraMachineConfigSpec_MachinePowerState.Descriptor instead. +func (InfraMachineConfigSpec_MachinePowerState) EnumDescriptor() ([]byte, []int) { + return file_omni_specs_omni_proto_rawDescGZIP(), []int{80, 0} +} + // MachineSpec describes a Machine. type MachineSpec struct { state protoimpl.MessageState @@ -6093,6 +6142,60 @@ func (x *ClusterMachineRequestStatusSpec) GetStage() ClusterMachineRequestStatus return ClusterMachineRequestStatusSpec_UNKNOWN } +// InfraMachineConfigSpec is the spec of the user-owned InfraMachineConfig resource. +type InfraMachineConfigSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PowerState InfraMachineConfigSpec_MachinePowerState `protobuf:"varint,1,opt,name=power_state,json=powerState,proto3,enum=specs.InfraMachineConfigSpec_MachinePowerState" json:"power_state,omitempty"` + Accepted bool `protobuf:"varint,2,opt,name=accepted,proto3" json:"accepted,omitempty"` +} + +func (x *InfraMachineConfigSpec) Reset() { + *x = InfraMachineConfigSpec{} + mi := &file_omni_specs_omni_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InfraMachineConfigSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfraMachineConfigSpec) ProtoMessage() {} + +func (x *InfraMachineConfigSpec) ProtoReflect() protoreflect.Message { + mi := &file_omni_specs_omni_proto_msgTypes[80] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfraMachineConfigSpec.ProtoReflect.Descriptor instead. +func (*InfraMachineConfigSpec) Descriptor() ([]byte, []int) { + return file_omni_specs_omni_proto_rawDescGZIP(), []int{80} +} + +func (x *InfraMachineConfigSpec) GetPowerState() InfraMachineConfigSpec_MachinePowerState { + if x != nil { + return x.PowerState + } + return InfraMachineConfigSpec_POWER_STATE_DEFAULT +} + +func (x *InfraMachineConfigSpec) GetAccepted() bool { + if x != nil { + return x.Accepted + } + return false +} + // HardwareStatus describes machine hardware status. type MachineStatusSpec_HardwareStatus struct { state protoimpl.MessageState @@ -6111,7 +6214,7 @@ type MachineStatusSpec_HardwareStatus struct { func (x *MachineStatusSpec_HardwareStatus) Reset() { *x = MachineStatusSpec_HardwareStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[80] + mi := &file_omni_specs_omni_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6123,7 +6226,7 @@ func (x *MachineStatusSpec_HardwareStatus) String() string { func (*MachineStatusSpec_HardwareStatus) ProtoMessage() {} func (x *MachineStatusSpec_HardwareStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[80] + mi := &file_omni_specs_omni_proto_msgTypes[81] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6187,7 +6290,7 @@ type MachineStatusSpec_NetworkStatus struct { func (x *MachineStatusSpec_NetworkStatus) Reset() { *x = MachineStatusSpec_NetworkStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[81] + mi := &file_omni_specs_omni_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6199,7 +6302,7 @@ func (x *MachineStatusSpec_NetworkStatus) String() string { func (*MachineStatusSpec_NetworkStatus) ProtoMessage() {} func (x *MachineStatusSpec_NetworkStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[81] + mi := &file_omni_specs_omni_proto_msgTypes[82] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6276,7 +6379,7 @@ type MachineStatusSpec_PlatformMetadata struct { func (x *MachineStatusSpec_PlatformMetadata) Reset() { *x = MachineStatusSpec_PlatformMetadata{} - mi := &file_omni_specs_omni_proto_msgTypes[82] + mi := &file_omni_specs_omni_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6288,7 +6391,7 @@ func (x *MachineStatusSpec_PlatformMetadata) String() string { func (*MachineStatusSpec_PlatformMetadata) ProtoMessage() {} func (x *MachineStatusSpec_PlatformMetadata) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[82] + mi := &file_omni_specs_omni_proto_msgTypes[83] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6393,7 +6496,7 @@ type MachineStatusSpec_Schematic struct { func (x *MachineStatusSpec_Schematic) Reset() { *x = MachineStatusSpec_Schematic{} - mi := &file_omni_specs_omni_proto_msgTypes[83] + mi := &file_omni_specs_omni_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6405,7 +6508,7 @@ func (x *MachineStatusSpec_Schematic) String() string { func (*MachineStatusSpec_Schematic) ProtoMessage() {} func (x *MachineStatusSpec_Schematic) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[83] + mi := &file_omni_specs_omni_proto_msgTypes[84] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6489,7 +6592,7 @@ type MachineStatusSpec_Diagnostic struct { func (x *MachineStatusSpec_Diagnostic) Reset() { *x = MachineStatusSpec_Diagnostic{} - mi := &file_omni_specs_omni_proto_msgTypes[84] + mi := &file_omni_specs_omni_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6501,7 +6604,7 @@ func (x *MachineStatusSpec_Diagnostic) String() string { func (*MachineStatusSpec_Diagnostic) ProtoMessage() {} func (x *MachineStatusSpec_Diagnostic) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[84] + mi := &file_omni_specs_omni_proto_msgTypes[85] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6558,7 +6661,7 @@ type MachineStatusSpec_HardwareStatus_Processor struct { func (x *MachineStatusSpec_HardwareStatus_Processor) Reset() { *x = MachineStatusSpec_HardwareStatus_Processor{} - mi := &file_omni_specs_omni_proto_msgTypes[86] + mi := &file_omni_specs_omni_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6570,7 +6673,7 @@ func (x *MachineStatusSpec_HardwareStatus_Processor) String() string { func (*MachineStatusSpec_HardwareStatus_Processor) ProtoMessage() {} func (x *MachineStatusSpec_HardwareStatus_Processor) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[86] + mi := &file_omni_specs_omni_proto_msgTypes[87] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6635,7 +6738,7 @@ type MachineStatusSpec_HardwareStatus_MemoryModule struct { func (x *MachineStatusSpec_HardwareStatus_MemoryModule) Reset() { *x = MachineStatusSpec_HardwareStatus_MemoryModule{} - mi := &file_omni_specs_omni_proto_msgTypes[87] + mi := &file_omni_specs_omni_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6647,7 +6750,7 @@ func (x *MachineStatusSpec_HardwareStatus_MemoryModule) String() string { func (*MachineStatusSpec_HardwareStatus_MemoryModule) ProtoMessage() {} func (x *MachineStatusSpec_HardwareStatus_MemoryModule) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[87] + mi := &file_omni_specs_omni_proto_msgTypes[88] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6709,7 +6812,7 @@ type MachineStatusSpec_HardwareStatus_BlockDevice struct { func (x *MachineStatusSpec_HardwareStatus_BlockDevice) Reset() { *x = MachineStatusSpec_HardwareStatus_BlockDevice{} - mi := &file_omni_specs_omni_proto_msgTypes[88] + mi := &file_omni_specs_omni_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6721,7 +6824,7 @@ func (x *MachineStatusSpec_HardwareStatus_BlockDevice) String() string { func (*MachineStatusSpec_HardwareStatus_BlockDevice) ProtoMessage() {} func (x *MachineStatusSpec_HardwareStatus_BlockDevice) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[88] + mi := &file_omni_specs_omni_proto_msgTypes[89] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6834,7 +6937,7 @@ type MachineStatusSpec_NetworkStatus_NetworkLinkStatus struct { func (x *MachineStatusSpec_NetworkStatus_NetworkLinkStatus) Reset() { *x = MachineStatusSpec_NetworkStatus_NetworkLinkStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[89] + mi := &file_omni_specs_omni_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6846,7 +6949,7 @@ func (x *MachineStatusSpec_NetworkStatus_NetworkLinkStatus) String() string { func (*MachineStatusSpec_NetworkStatus_NetworkLinkStatus) ProtoMessage() {} func (x *MachineStatusSpec_NetworkStatus_NetworkLinkStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[89] + mi := &file_omni_specs_omni_proto_msgTypes[90] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6912,7 +7015,7 @@ type ClusterSpec_Features struct { func (x *ClusterSpec_Features) Reset() { *x = ClusterSpec_Features{} - mi := &file_omni_specs_omni_proto_msgTypes[90] + mi := &file_omni_specs_omni_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6924,7 +7027,7 @@ func (x *ClusterSpec_Features) String() string { func (*ClusterSpec_Features) ProtoMessage() {} func (x *ClusterSpec_Features) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[90] + mi := &file_omni_specs_omni_proto_msgTypes[91] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6972,7 +7075,7 @@ type ClusterMachineStatusSpec_ProvisionStatus struct { func (x *ClusterMachineStatusSpec_ProvisionStatus) Reset() { *x = ClusterMachineStatusSpec_ProvisionStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[91] + mi := &file_omni_specs_omni_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6984,7 +7087,7 @@ func (x *ClusterMachineStatusSpec_ProvisionStatus) String() string { func (*ClusterMachineStatusSpec_ProvisionStatus) ProtoMessage() {} func (x *ClusterMachineStatusSpec_ProvisionStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[91] + mi := &file_omni_specs_omni_proto_msgTypes[92] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7030,7 +7133,7 @@ type MachineSetSpec_MachineClass struct { func (x *MachineSetSpec_MachineClass) Reset() { *x = MachineSetSpec_MachineClass{} - mi := &file_omni_specs_omni_proto_msgTypes[92] + mi := &file_omni_specs_omni_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7042,7 +7145,7 @@ func (x *MachineSetSpec_MachineClass) String() string { func (*MachineSetSpec_MachineClass) ProtoMessage() {} func (x *MachineSetSpec_MachineClass) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[92] + mi := &file_omni_specs_omni_proto_msgTypes[93] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7098,7 +7201,7 @@ type MachineSetSpec_MachineAllocation struct { func (x *MachineSetSpec_MachineAllocation) Reset() { *x = MachineSetSpec_MachineAllocation{} - mi := &file_omni_specs_omni_proto_msgTypes[93] + mi := &file_omni_specs_omni_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7110,7 +7213,7 @@ func (x *MachineSetSpec_MachineAllocation) String() string { func (*MachineSetSpec_MachineAllocation) ProtoMessage() {} func (x *MachineSetSpec_MachineAllocation) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[93] + mi := &file_omni_specs_omni_proto_msgTypes[94] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7169,7 +7272,7 @@ type MachineSetSpec_BootstrapSpec struct { func (x *MachineSetSpec_BootstrapSpec) Reset() { *x = MachineSetSpec_BootstrapSpec{} - mi := &file_omni_specs_omni_proto_msgTypes[94] + mi := &file_omni_specs_omni_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7181,7 +7284,7 @@ func (x *MachineSetSpec_BootstrapSpec) String() string { func (*MachineSetSpec_BootstrapSpec) ProtoMessage() {} func (x *MachineSetSpec_BootstrapSpec) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[94] + mi := &file_omni_specs_omni_proto_msgTypes[95] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7224,7 +7327,7 @@ type MachineSetSpec_RollingUpdateStrategyConfig struct { func (x *MachineSetSpec_RollingUpdateStrategyConfig) Reset() { *x = MachineSetSpec_RollingUpdateStrategyConfig{} - mi := &file_omni_specs_omni_proto_msgTypes[95] + mi := &file_omni_specs_omni_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7236,7 +7339,7 @@ func (x *MachineSetSpec_RollingUpdateStrategyConfig) String() string { func (*MachineSetSpec_RollingUpdateStrategyConfig) ProtoMessage() {} func (x *MachineSetSpec_RollingUpdateStrategyConfig) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[95] + mi := &file_omni_specs_omni_proto_msgTypes[96] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7272,7 +7375,7 @@ type MachineSetSpec_UpdateStrategyConfig struct { func (x *MachineSetSpec_UpdateStrategyConfig) Reset() { *x = MachineSetSpec_UpdateStrategyConfig{} - mi := &file_omni_specs_omni_proto_msgTypes[96] + mi := &file_omni_specs_omni_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7284,7 +7387,7 @@ func (x *MachineSetSpec_UpdateStrategyConfig) String() string { func (*MachineSetSpec_UpdateStrategyConfig) ProtoMessage() {} func (x *MachineSetSpec_UpdateStrategyConfig) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[96] + mi := &file_omni_specs_omni_proto_msgTypes[97] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7320,7 +7423,7 @@ type ControlPlaneStatusSpec_Condition struct { func (x *ControlPlaneStatusSpec_Condition) Reset() { *x = ControlPlaneStatusSpec_Condition{} - mi := &file_omni_specs_omni_proto_msgTypes[97] + mi := &file_omni_specs_omni_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7332,7 +7435,7 @@ func (x *ControlPlaneStatusSpec_Condition) String() string { func (*ControlPlaneStatusSpec_Condition) ProtoMessage() {} func (x *ControlPlaneStatusSpec_Condition) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[97] + mi := &file_omni_specs_omni_proto_msgTypes[98] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7388,7 +7491,7 @@ type KubernetesStatusSpec_NodeStatus struct { func (x *KubernetesStatusSpec_NodeStatus) Reset() { *x = KubernetesStatusSpec_NodeStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[98] + mi := &file_omni_specs_omni_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7400,7 +7503,7 @@ func (x *KubernetesStatusSpec_NodeStatus) String() string { func (*KubernetesStatusSpec_NodeStatus) ProtoMessage() {} func (x *KubernetesStatusSpec_NodeStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[98] + mi := &file_omni_specs_omni_proto_msgTypes[99] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7449,7 +7552,7 @@ type KubernetesStatusSpec_StaticPodStatus struct { func (x *KubernetesStatusSpec_StaticPodStatus) Reset() { *x = KubernetesStatusSpec_StaticPodStatus{} - mi := &file_omni_specs_omni_proto_msgTypes[99] + mi := &file_omni_specs_omni_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7461,7 +7564,7 @@ func (x *KubernetesStatusSpec_StaticPodStatus) String() string { func (*KubernetesStatusSpec_StaticPodStatus) ProtoMessage() {} func (x *KubernetesStatusSpec_StaticPodStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[99] + mi := &file_omni_specs_omni_proto_msgTypes[100] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7509,7 +7612,7 @@ type KubernetesStatusSpec_NodeStaticPods struct { func (x *KubernetesStatusSpec_NodeStaticPods) Reset() { *x = KubernetesStatusSpec_NodeStaticPods{} - mi := &file_omni_specs_omni_proto_msgTypes[100] + mi := &file_omni_specs_omni_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7521,7 +7624,7 @@ func (x *KubernetesStatusSpec_NodeStaticPods) String() string { func (*KubernetesStatusSpec_NodeStaticPods) ProtoMessage() {} func (x *KubernetesStatusSpec_NodeStaticPods) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[100] + mi := &file_omni_specs_omni_proto_msgTypes[101] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7566,7 +7669,7 @@ type MachineClassSpec_Provision struct { func (x *MachineClassSpec_Provision) Reset() { *x = MachineClassSpec_Provision{} - mi := &file_omni_specs_omni_proto_msgTypes[101] + mi := &file_omni_specs_omni_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7578,7 +7681,7 @@ func (x *MachineClassSpec_Provision) String() string { func (*MachineClassSpec_Provision) ProtoMessage() {} func (x *MachineClassSpec_Provision) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[101] + mi := &file_omni_specs_omni_proto_msgTypes[102] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7648,7 +7751,7 @@ type MachineConfigGenOptionsSpec_InstallImage struct { func (x *MachineConfigGenOptionsSpec_InstallImage) Reset() { *x = MachineConfigGenOptionsSpec_InstallImage{} - mi := &file_omni_specs_omni_proto_msgTypes[102] + mi := &file_omni_specs_omni_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7660,7 +7763,7 @@ func (x *MachineConfigGenOptionsSpec_InstallImage) String() string { func (*MachineConfigGenOptionsSpec_InstallImage) ProtoMessage() {} func (x *MachineConfigGenOptionsSpec_InstallImage) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[102] + mi := &file_omni_specs_omni_proto_msgTypes[103] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7723,7 +7826,7 @@ type KubernetesUsageSpec_Quantity struct { func (x *KubernetesUsageSpec_Quantity) Reset() { *x = KubernetesUsageSpec_Quantity{} - mi := &file_omni_specs_omni_proto_msgTypes[103] + mi := &file_omni_specs_omni_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7735,7 +7838,7 @@ func (x *KubernetesUsageSpec_Quantity) String() string { func (*KubernetesUsageSpec_Quantity) ProtoMessage() {} func (x *KubernetesUsageSpec_Quantity) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[103] + mi := &file_omni_specs_omni_proto_msgTypes[104] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7783,7 +7886,7 @@ type KubernetesUsageSpec_Pod struct { func (x *KubernetesUsageSpec_Pod) Reset() { *x = KubernetesUsageSpec_Pod{} - mi := &file_omni_specs_omni_proto_msgTypes[104] + mi := &file_omni_specs_omni_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7795,7 +7898,7 @@ func (x *KubernetesUsageSpec_Pod) String() string { func (*KubernetesUsageSpec_Pod) ProtoMessage() {} func (x *KubernetesUsageSpec_Pod) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[104] + mi := &file_omni_specs_omni_proto_msgTypes[105] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7836,7 +7939,7 @@ type ImagePullRequestSpec_NodeImageList struct { func (x *ImagePullRequestSpec_NodeImageList) Reset() { *x = ImagePullRequestSpec_NodeImageList{} - mi := &file_omni_specs_omni_proto_msgTypes[105] + mi := &file_omni_specs_omni_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7848,7 +7951,7 @@ func (x *ImagePullRequestSpec_NodeImageList) String() string { func (*ImagePullRequestSpec_NodeImageList) ProtoMessage() {} func (x *ImagePullRequestSpec_NodeImageList) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[105] + mi := &file_omni_specs_omni_proto_msgTypes[106] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7894,7 +7997,7 @@ type TalosExtensionsSpec_Info struct { func (x *TalosExtensionsSpec_Info) Reset() { *x = TalosExtensionsSpec_Info{} - mi := &file_omni_specs_omni_proto_msgTypes[106] + mi := &file_omni_specs_omni_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7906,7 +8009,7 @@ func (x *TalosExtensionsSpec_Info) String() string { func (*TalosExtensionsSpec_Info) ProtoMessage() {} func (x *TalosExtensionsSpec_Info) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[106] + mi := &file_omni_specs_omni_proto_msgTypes[107] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7976,7 +8079,7 @@ type MachineExtensionsStatusSpec_Item struct { func (x *MachineExtensionsStatusSpec_Item) Reset() { *x = MachineExtensionsStatusSpec_Item{} - mi := &file_omni_specs_omni_proto_msgTypes[107] + mi := &file_omni_specs_omni_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7988,7 +8091,7 @@ func (x *MachineExtensionsStatusSpec_Item) String() string { func (*MachineExtensionsStatusSpec_Item) ProtoMessage() {} func (x *MachineExtensionsStatusSpec_Item) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[107] + mi := &file_omni_specs_omni_proto_msgTypes[108] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8036,7 +8139,7 @@ type ClusterDiagnosticsSpec_Node struct { func (x *ClusterDiagnosticsSpec_Node) Reset() { *x = ClusterDiagnosticsSpec_Node{} - mi := &file_omni_specs_omni_proto_msgTypes[109] + mi := &file_omni_specs_omni_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8048,7 +8151,7 @@ func (x *ClusterDiagnosticsSpec_Node) String() string { func (*ClusterDiagnosticsSpec_Node) ProtoMessage() {} func (x *ClusterDiagnosticsSpec_Node) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[109] + mi := &file_omni_specs_omni_proto_msgTypes[110] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9204,6 +9307,20 @@ var file_omni_specs_omni_proto_rawDesc = []byte{ 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x45, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, + 0x22, 0xdd, 0x01, 0x0a, 0x16, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x50, 0x0a, 0x0b, 0x70, + 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x2f, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x4d, 0x61, + 0x63, 0x68, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x2e, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x22, 0x55, 0x0a, 0x11, 0x4d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, + 0x0a, 0x13, 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, + 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x50, 0x4f, 0x57, 0x45, 0x52, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x46, 0x46, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, + 0x50, 0x4f, 0x57, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x46, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, @@ -9243,8 +9360,8 @@ func file_omni_specs_omni_proto_rawDescGZIP() []byte { return file_omni_specs_omni_proto_rawDescData } -var file_omni_specs_omni_proto_enumTypes = make([]protoimpl.EnumInfo, 19) -var file_omni_specs_omni_proto_msgTypes = make([]protoimpl.MessageInfo, 110) +var file_omni_specs_omni_proto_enumTypes = make([]protoimpl.EnumInfo, 20) +var file_omni_specs_omni_proto_msgTypes = make([]protoimpl.MessageInfo, 111) var file_omni_specs_omni_proto_goTypes = []any{ (ConfigApplyStatus)(0), // 0: specs.ConfigApplyStatus (MachineSetPhase)(0), // 1: specs.MachineSetPhase @@ -9265,205 +9382,208 @@ var file_omni_specs_omni_proto_goTypes = []any{ (ExtensionsConfigurationStatusSpec_Phase)(0), // 16: specs.ExtensionsConfigurationStatusSpec.Phase (MachineExtensionsStatusSpec_Item_Phase)(0), // 17: specs.MachineExtensionsStatusSpec.Item.Phase (ClusterMachineRequestStatusSpec_Stage)(0), // 18: specs.ClusterMachineRequestStatusSpec.Stage - (*MachineSpec)(nil), // 19: specs.MachineSpec - (*SecureBootStatus)(nil), // 20: specs.SecureBootStatus - (*Overlay)(nil), // 21: specs.Overlay - (*MetaValue)(nil), // 22: specs.MetaValue - (*MachineStatusSpec)(nil), // 23: specs.MachineStatusSpec - (*TalosConfigSpec)(nil), // 24: specs.TalosConfigSpec - (*ClusterSpec)(nil), // 25: specs.ClusterSpec - (*ClusterTaintSpec)(nil), // 26: specs.ClusterTaintSpec - (*EtcdBackupConf)(nil), // 27: specs.EtcdBackupConf - (*EtcdBackupEncryptionSpec)(nil), // 28: specs.EtcdBackupEncryptionSpec - (*EtcdBackupHeader)(nil), // 29: specs.EtcdBackupHeader - (*EtcdBackupSpec)(nil), // 30: specs.EtcdBackupSpec - (*BackupDataSpec)(nil), // 31: specs.BackupDataSpec - (*EtcdBackupS3ConfSpec)(nil), // 32: specs.EtcdBackupS3ConfSpec - (*EtcdBackupStatusSpec)(nil), // 33: specs.EtcdBackupStatusSpec - (*EtcdManualBackupSpec)(nil), // 34: specs.EtcdManualBackupSpec - (*EtcdBackupStoreStatusSpec)(nil), // 35: specs.EtcdBackupStoreStatusSpec - (*EtcdBackupOverallStatusSpec)(nil), // 36: specs.EtcdBackupOverallStatusSpec - (*ClusterMachineSpec)(nil), // 37: specs.ClusterMachineSpec - (*ClusterMachineConfigPatchesSpec)(nil), // 38: specs.ClusterMachineConfigPatchesSpec - (*ClusterMachineTalosVersionSpec)(nil), // 39: specs.ClusterMachineTalosVersionSpec - (*ClusterMachineConfigSpec)(nil), // 40: specs.ClusterMachineConfigSpec - (*RedactedClusterMachineConfigSpec)(nil), // 41: specs.RedactedClusterMachineConfigSpec - (*ClusterMachineIdentitySpec)(nil), // 42: specs.ClusterMachineIdentitySpec - (*ClusterMachineTemplateSpec)(nil), // 43: specs.ClusterMachineTemplateSpec - (*ClusterMachineStatusSpec)(nil), // 44: specs.ClusterMachineStatusSpec - (*Machines)(nil), // 45: specs.Machines - (*ClusterStatusSpec)(nil), // 46: specs.ClusterStatusSpec - (*ClusterUUID)(nil), // 47: specs.ClusterUUID - (*ClusterConfigVersionSpec)(nil), // 48: specs.ClusterConfigVersionSpec - (*ClusterMachineConfigStatusSpec)(nil), // 49: specs.ClusterMachineConfigStatusSpec - (*ClusterBootstrapStatusSpec)(nil), // 50: specs.ClusterBootstrapStatusSpec - (*ClusterSecretsSpec)(nil), // 51: specs.ClusterSecretsSpec - (*LoadBalancerConfigSpec)(nil), // 52: specs.LoadBalancerConfigSpec - (*LoadBalancerStatusSpec)(nil), // 53: specs.LoadBalancerStatusSpec - (*KubernetesVersionSpec)(nil), // 54: specs.KubernetesVersionSpec - (*TalosVersionSpec)(nil), // 55: specs.TalosVersionSpec - (*InstallationMediaSpec)(nil), // 56: specs.InstallationMediaSpec - (*ConfigPatchSpec)(nil), // 57: specs.ConfigPatchSpec - (*MachineSetSpec)(nil), // 58: specs.MachineSetSpec - (*TalosUpgradeStatusSpec)(nil), // 59: specs.TalosUpgradeStatusSpec - (*MachineSetStatusSpec)(nil), // 60: specs.MachineSetStatusSpec - (*MachineSetNodeSpec)(nil), // 61: specs.MachineSetNodeSpec - (*MachineLabelsSpec)(nil), // 62: specs.MachineLabelsSpec - (*MachineStatusSnapshotSpec)(nil), // 63: specs.MachineStatusSnapshotSpec - (*ControlPlaneStatusSpec)(nil), // 64: specs.ControlPlaneStatusSpec - (*ClusterEndpointSpec)(nil), // 65: specs.ClusterEndpointSpec - (*KubernetesStatusSpec)(nil), // 66: specs.KubernetesStatusSpec - (*KubernetesUpgradeStatusSpec)(nil), // 67: specs.KubernetesUpgradeStatusSpec - (*KubernetesUpgradeManifestStatusSpec)(nil), // 68: specs.KubernetesUpgradeManifestStatusSpec - (*DestroyStatusSpec)(nil), // 69: specs.DestroyStatusSpec - (*OngoingTaskSpec)(nil), // 70: specs.OngoingTaskSpec - (*ClusterMachineEncryptionKeySpec)(nil), // 71: specs.ClusterMachineEncryptionKeySpec - (*ExposedServiceSpec)(nil), // 72: specs.ExposedServiceSpec - (*ClusterWorkloadProxyStatusSpec)(nil), // 73: specs.ClusterWorkloadProxyStatusSpec - (*FeaturesConfigSpec)(nil), // 74: specs.FeaturesConfigSpec - (*EtcdBackupSettings)(nil), // 75: specs.EtcdBackupSettings - (*MachineClassSpec)(nil), // 76: specs.MachineClassSpec - (*MachineConfigGenOptionsSpec)(nil), // 77: specs.MachineConfigGenOptionsSpec - (*EtcdAuditResultSpec)(nil), // 78: specs.EtcdAuditResultSpec - (*KubeconfigSpec)(nil), // 79: specs.KubeconfigSpec - (*KubernetesUsageSpec)(nil), // 80: specs.KubernetesUsageSpec - (*ImagePullRequestSpec)(nil), // 81: specs.ImagePullRequestSpec - (*ImagePullStatusSpec)(nil), // 82: specs.ImagePullStatusSpec - (*SchematicSpec)(nil), // 83: specs.SchematicSpec - (*TalosExtensionsSpec)(nil), // 84: specs.TalosExtensionsSpec - (*SchematicConfigurationSpec)(nil), // 85: specs.SchematicConfigurationSpec - (*ExtensionsConfigurationSpec)(nil), // 86: specs.ExtensionsConfigurationSpec - (*ExtensionsConfigurationStatusSpec)(nil), // 87: specs.ExtensionsConfigurationStatusSpec - (*MachineExtensionsSpec)(nil), // 88: specs.MachineExtensionsSpec - (*MachineExtensionsStatusSpec)(nil), // 89: specs.MachineExtensionsStatusSpec - (*MachineStatusMetricsSpec)(nil), // 90: specs.MachineStatusMetricsSpec - (*ClusterStatusMetricsSpec)(nil), // 91: specs.ClusterStatusMetricsSpec - (*ClusterKubernetesNodesSpec)(nil), // 92: specs.ClusterKubernetesNodesSpec - (*KubernetesNodeAuditResultSpec)(nil), // 93: specs.KubernetesNodeAuditResultSpec - (*MachineRequestSetSpec)(nil), // 94: specs.MachineRequestSetSpec - (*MachineRequestSetStatusSpec)(nil), // 95: specs.MachineRequestSetStatusSpec - (*ClusterDiagnosticsSpec)(nil), // 96: specs.ClusterDiagnosticsSpec - (*MachineRequestSetPressureSpec)(nil), // 97: specs.MachineRequestSetPressureSpec - (*ClusterMachineRequestStatusSpec)(nil), // 98: specs.ClusterMachineRequestStatusSpec - (*MachineStatusSpec_HardwareStatus)(nil), // 99: specs.MachineStatusSpec.HardwareStatus - (*MachineStatusSpec_NetworkStatus)(nil), // 100: specs.MachineStatusSpec.NetworkStatus - (*MachineStatusSpec_PlatformMetadata)(nil), // 101: specs.MachineStatusSpec.PlatformMetadata - (*MachineStatusSpec_Schematic)(nil), // 102: specs.MachineStatusSpec.Schematic - (*MachineStatusSpec_Diagnostic)(nil), // 103: specs.MachineStatusSpec.Diagnostic - nil, // 104: specs.MachineStatusSpec.ImageLabelsEntry - (*MachineStatusSpec_HardwareStatus_Processor)(nil), // 105: specs.MachineStatusSpec.HardwareStatus.Processor - (*MachineStatusSpec_HardwareStatus_MemoryModule)(nil), // 106: specs.MachineStatusSpec.HardwareStatus.MemoryModule - (*MachineStatusSpec_HardwareStatus_BlockDevice)(nil), // 107: specs.MachineStatusSpec.HardwareStatus.BlockDevice - (*MachineStatusSpec_NetworkStatus_NetworkLinkStatus)(nil), // 108: specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus - (*ClusterSpec_Features)(nil), // 109: specs.ClusterSpec.Features - (*ClusterMachineStatusSpec_ProvisionStatus)(nil), // 110: specs.ClusterMachineStatusSpec.ProvisionStatus - (*MachineSetSpec_MachineClass)(nil), // 111: specs.MachineSetSpec.MachineClass - (*MachineSetSpec_MachineAllocation)(nil), // 112: specs.MachineSetSpec.MachineAllocation - (*MachineSetSpec_BootstrapSpec)(nil), // 113: specs.MachineSetSpec.BootstrapSpec - (*MachineSetSpec_RollingUpdateStrategyConfig)(nil), // 114: specs.MachineSetSpec.RollingUpdateStrategyConfig - (*MachineSetSpec_UpdateStrategyConfig)(nil), // 115: specs.MachineSetSpec.UpdateStrategyConfig - (*ControlPlaneStatusSpec_Condition)(nil), // 116: specs.ControlPlaneStatusSpec.Condition - (*KubernetesStatusSpec_NodeStatus)(nil), // 117: specs.KubernetesStatusSpec.NodeStatus - (*KubernetesStatusSpec_StaticPodStatus)(nil), // 118: specs.KubernetesStatusSpec.StaticPodStatus - (*KubernetesStatusSpec_NodeStaticPods)(nil), // 119: specs.KubernetesStatusSpec.NodeStaticPods - (*MachineClassSpec_Provision)(nil), // 120: specs.MachineClassSpec.Provision - (*MachineConfigGenOptionsSpec_InstallImage)(nil), // 121: specs.MachineConfigGenOptionsSpec.InstallImage - (*KubernetesUsageSpec_Quantity)(nil), // 122: specs.KubernetesUsageSpec.Quantity - (*KubernetesUsageSpec_Pod)(nil), // 123: specs.KubernetesUsageSpec.Pod - (*ImagePullRequestSpec_NodeImageList)(nil), // 124: specs.ImagePullRequestSpec.NodeImageList - (*TalosExtensionsSpec_Info)(nil), // 125: specs.TalosExtensionsSpec.Info - (*MachineExtensionsStatusSpec_Item)(nil), // 126: specs.MachineExtensionsStatusSpec.Item - nil, // 127: specs.ClusterStatusMetricsSpec.PhasesEntry - (*ClusterDiagnosticsSpec_Node)(nil), // 128: specs.ClusterDiagnosticsSpec.Node - (*durationpb.Duration)(nil), // 129: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 130: google.protobuf.Timestamp - (*machine.MachineStatusEvent)(nil), // 131: machine.MachineStatusEvent + (InfraMachineConfigSpec_MachinePowerState)(0), // 19: specs.InfraMachineConfigSpec.MachinePowerState + (*MachineSpec)(nil), // 20: specs.MachineSpec + (*SecureBootStatus)(nil), // 21: specs.SecureBootStatus + (*Overlay)(nil), // 22: specs.Overlay + (*MetaValue)(nil), // 23: specs.MetaValue + (*MachineStatusSpec)(nil), // 24: specs.MachineStatusSpec + (*TalosConfigSpec)(nil), // 25: specs.TalosConfigSpec + (*ClusterSpec)(nil), // 26: specs.ClusterSpec + (*ClusterTaintSpec)(nil), // 27: specs.ClusterTaintSpec + (*EtcdBackupConf)(nil), // 28: specs.EtcdBackupConf + (*EtcdBackupEncryptionSpec)(nil), // 29: specs.EtcdBackupEncryptionSpec + (*EtcdBackupHeader)(nil), // 30: specs.EtcdBackupHeader + (*EtcdBackupSpec)(nil), // 31: specs.EtcdBackupSpec + (*BackupDataSpec)(nil), // 32: specs.BackupDataSpec + (*EtcdBackupS3ConfSpec)(nil), // 33: specs.EtcdBackupS3ConfSpec + (*EtcdBackupStatusSpec)(nil), // 34: specs.EtcdBackupStatusSpec + (*EtcdManualBackupSpec)(nil), // 35: specs.EtcdManualBackupSpec + (*EtcdBackupStoreStatusSpec)(nil), // 36: specs.EtcdBackupStoreStatusSpec + (*EtcdBackupOverallStatusSpec)(nil), // 37: specs.EtcdBackupOverallStatusSpec + (*ClusterMachineSpec)(nil), // 38: specs.ClusterMachineSpec + (*ClusterMachineConfigPatchesSpec)(nil), // 39: specs.ClusterMachineConfigPatchesSpec + (*ClusterMachineTalosVersionSpec)(nil), // 40: specs.ClusterMachineTalosVersionSpec + (*ClusterMachineConfigSpec)(nil), // 41: specs.ClusterMachineConfigSpec + (*RedactedClusterMachineConfigSpec)(nil), // 42: specs.RedactedClusterMachineConfigSpec + (*ClusterMachineIdentitySpec)(nil), // 43: specs.ClusterMachineIdentitySpec + (*ClusterMachineTemplateSpec)(nil), // 44: specs.ClusterMachineTemplateSpec + (*ClusterMachineStatusSpec)(nil), // 45: specs.ClusterMachineStatusSpec + (*Machines)(nil), // 46: specs.Machines + (*ClusterStatusSpec)(nil), // 47: specs.ClusterStatusSpec + (*ClusterUUID)(nil), // 48: specs.ClusterUUID + (*ClusterConfigVersionSpec)(nil), // 49: specs.ClusterConfigVersionSpec + (*ClusterMachineConfigStatusSpec)(nil), // 50: specs.ClusterMachineConfigStatusSpec + (*ClusterBootstrapStatusSpec)(nil), // 51: specs.ClusterBootstrapStatusSpec + (*ClusterSecretsSpec)(nil), // 52: specs.ClusterSecretsSpec + (*LoadBalancerConfigSpec)(nil), // 53: specs.LoadBalancerConfigSpec + (*LoadBalancerStatusSpec)(nil), // 54: specs.LoadBalancerStatusSpec + (*KubernetesVersionSpec)(nil), // 55: specs.KubernetesVersionSpec + (*TalosVersionSpec)(nil), // 56: specs.TalosVersionSpec + (*InstallationMediaSpec)(nil), // 57: specs.InstallationMediaSpec + (*ConfigPatchSpec)(nil), // 58: specs.ConfigPatchSpec + (*MachineSetSpec)(nil), // 59: specs.MachineSetSpec + (*TalosUpgradeStatusSpec)(nil), // 60: specs.TalosUpgradeStatusSpec + (*MachineSetStatusSpec)(nil), // 61: specs.MachineSetStatusSpec + (*MachineSetNodeSpec)(nil), // 62: specs.MachineSetNodeSpec + (*MachineLabelsSpec)(nil), // 63: specs.MachineLabelsSpec + (*MachineStatusSnapshotSpec)(nil), // 64: specs.MachineStatusSnapshotSpec + (*ControlPlaneStatusSpec)(nil), // 65: specs.ControlPlaneStatusSpec + (*ClusterEndpointSpec)(nil), // 66: specs.ClusterEndpointSpec + (*KubernetesStatusSpec)(nil), // 67: specs.KubernetesStatusSpec + (*KubernetesUpgradeStatusSpec)(nil), // 68: specs.KubernetesUpgradeStatusSpec + (*KubernetesUpgradeManifestStatusSpec)(nil), // 69: specs.KubernetesUpgradeManifestStatusSpec + (*DestroyStatusSpec)(nil), // 70: specs.DestroyStatusSpec + (*OngoingTaskSpec)(nil), // 71: specs.OngoingTaskSpec + (*ClusterMachineEncryptionKeySpec)(nil), // 72: specs.ClusterMachineEncryptionKeySpec + (*ExposedServiceSpec)(nil), // 73: specs.ExposedServiceSpec + (*ClusterWorkloadProxyStatusSpec)(nil), // 74: specs.ClusterWorkloadProxyStatusSpec + (*FeaturesConfigSpec)(nil), // 75: specs.FeaturesConfigSpec + (*EtcdBackupSettings)(nil), // 76: specs.EtcdBackupSettings + (*MachineClassSpec)(nil), // 77: specs.MachineClassSpec + (*MachineConfigGenOptionsSpec)(nil), // 78: specs.MachineConfigGenOptionsSpec + (*EtcdAuditResultSpec)(nil), // 79: specs.EtcdAuditResultSpec + (*KubeconfigSpec)(nil), // 80: specs.KubeconfigSpec + (*KubernetesUsageSpec)(nil), // 81: specs.KubernetesUsageSpec + (*ImagePullRequestSpec)(nil), // 82: specs.ImagePullRequestSpec + (*ImagePullStatusSpec)(nil), // 83: specs.ImagePullStatusSpec + (*SchematicSpec)(nil), // 84: specs.SchematicSpec + (*TalosExtensionsSpec)(nil), // 85: specs.TalosExtensionsSpec + (*SchematicConfigurationSpec)(nil), // 86: specs.SchematicConfigurationSpec + (*ExtensionsConfigurationSpec)(nil), // 87: specs.ExtensionsConfigurationSpec + (*ExtensionsConfigurationStatusSpec)(nil), // 88: specs.ExtensionsConfigurationStatusSpec + (*MachineExtensionsSpec)(nil), // 89: specs.MachineExtensionsSpec + (*MachineExtensionsStatusSpec)(nil), // 90: specs.MachineExtensionsStatusSpec + (*MachineStatusMetricsSpec)(nil), // 91: specs.MachineStatusMetricsSpec + (*ClusterStatusMetricsSpec)(nil), // 92: specs.ClusterStatusMetricsSpec + (*ClusterKubernetesNodesSpec)(nil), // 93: specs.ClusterKubernetesNodesSpec + (*KubernetesNodeAuditResultSpec)(nil), // 94: specs.KubernetesNodeAuditResultSpec + (*MachineRequestSetSpec)(nil), // 95: specs.MachineRequestSetSpec + (*MachineRequestSetStatusSpec)(nil), // 96: specs.MachineRequestSetStatusSpec + (*ClusterDiagnosticsSpec)(nil), // 97: specs.ClusterDiagnosticsSpec + (*MachineRequestSetPressureSpec)(nil), // 98: specs.MachineRequestSetPressureSpec + (*ClusterMachineRequestStatusSpec)(nil), // 99: specs.ClusterMachineRequestStatusSpec + (*InfraMachineConfigSpec)(nil), // 100: specs.InfraMachineConfigSpec + (*MachineStatusSpec_HardwareStatus)(nil), // 101: specs.MachineStatusSpec.HardwareStatus + (*MachineStatusSpec_NetworkStatus)(nil), // 102: specs.MachineStatusSpec.NetworkStatus + (*MachineStatusSpec_PlatformMetadata)(nil), // 103: specs.MachineStatusSpec.PlatformMetadata + (*MachineStatusSpec_Schematic)(nil), // 104: specs.MachineStatusSpec.Schematic + (*MachineStatusSpec_Diagnostic)(nil), // 105: specs.MachineStatusSpec.Diagnostic + nil, // 106: specs.MachineStatusSpec.ImageLabelsEntry + (*MachineStatusSpec_HardwareStatus_Processor)(nil), // 107: specs.MachineStatusSpec.HardwareStatus.Processor + (*MachineStatusSpec_HardwareStatus_MemoryModule)(nil), // 108: specs.MachineStatusSpec.HardwareStatus.MemoryModule + (*MachineStatusSpec_HardwareStatus_BlockDevice)(nil), // 109: specs.MachineStatusSpec.HardwareStatus.BlockDevice + (*MachineStatusSpec_NetworkStatus_NetworkLinkStatus)(nil), // 110: specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus + (*ClusterSpec_Features)(nil), // 111: specs.ClusterSpec.Features + (*ClusterMachineStatusSpec_ProvisionStatus)(nil), // 112: specs.ClusterMachineStatusSpec.ProvisionStatus + (*MachineSetSpec_MachineClass)(nil), // 113: specs.MachineSetSpec.MachineClass + (*MachineSetSpec_MachineAllocation)(nil), // 114: specs.MachineSetSpec.MachineAllocation + (*MachineSetSpec_BootstrapSpec)(nil), // 115: specs.MachineSetSpec.BootstrapSpec + (*MachineSetSpec_RollingUpdateStrategyConfig)(nil), // 116: specs.MachineSetSpec.RollingUpdateStrategyConfig + (*MachineSetSpec_UpdateStrategyConfig)(nil), // 117: specs.MachineSetSpec.UpdateStrategyConfig + (*ControlPlaneStatusSpec_Condition)(nil), // 118: specs.ControlPlaneStatusSpec.Condition + (*KubernetesStatusSpec_NodeStatus)(nil), // 119: specs.KubernetesStatusSpec.NodeStatus + (*KubernetesStatusSpec_StaticPodStatus)(nil), // 120: specs.KubernetesStatusSpec.StaticPodStatus + (*KubernetesStatusSpec_NodeStaticPods)(nil), // 121: specs.KubernetesStatusSpec.NodeStaticPods + (*MachineClassSpec_Provision)(nil), // 122: specs.MachineClassSpec.Provision + (*MachineConfigGenOptionsSpec_InstallImage)(nil), // 123: specs.MachineConfigGenOptionsSpec.InstallImage + (*KubernetesUsageSpec_Quantity)(nil), // 124: specs.KubernetesUsageSpec.Quantity + (*KubernetesUsageSpec_Pod)(nil), // 125: specs.KubernetesUsageSpec.Pod + (*ImagePullRequestSpec_NodeImageList)(nil), // 126: specs.ImagePullRequestSpec.NodeImageList + (*TalosExtensionsSpec_Info)(nil), // 127: specs.TalosExtensionsSpec.Info + (*MachineExtensionsStatusSpec_Item)(nil), // 128: specs.MachineExtensionsStatusSpec.Item + nil, // 129: specs.ClusterStatusMetricsSpec.PhasesEntry + (*ClusterDiagnosticsSpec_Node)(nil), // 130: specs.ClusterDiagnosticsSpec.Node + (*durationpb.Duration)(nil), // 131: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 132: google.protobuf.Timestamp + (*machine.MachineStatusEvent)(nil), // 133: machine.MachineStatusEvent } var file_omni_specs_omni_proto_depIdxs = []int32{ - 99, // 0: specs.MachineStatusSpec.hardware:type_name -> specs.MachineStatusSpec.HardwareStatus - 100, // 1: specs.MachineStatusSpec.network:type_name -> specs.MachineStatusSpec.NetworkStatus + 101, // 0: specs.MachineStatusSpec.hardware:type_name -> specs.MachineStatusSpec.HardwareStatus + 102, // 1: specs.MachineStatusSpec.network:type_name -> specs.MachineStatusSpec.NetworkStatus 4, // 2: specs.MachineStatusSpec.role:type_name -> specs.MachineStatusSpec.Role - 101, // 3: specs.MachineStatusSpec.platform_metadata:type_name -> specs.MachineStatusSpec.PlatformMetadata - 104, // 4: specs.MachineStatusSpec.image_labels:type_name -> specs.MachineStatusSpec.ImageLabelsEntry - 102, // 5: specs.MachineStatusSpec.schematic:type_name -> specs.MachineStatusSpec.Schematic - 20, // 6: specs.MachineStatusSpec.secure_boot_status:type_name -> specs.SecureBootStatus - 103, // 7: specs.MachineStatusSpec.diagnostics:type_name -> specs.MachineStatusSpec.Diagnostic - 109, // 8: specs.ClusterSpec.features:type_name -> specs.ClusterSpec.Features - 27, // 9: specs.ClusterSpec.backup_configuration:type_name -> specs.EtcdBackupConf - 129, // 10: specs.EtcdBackupConf.interval:type_name -> google.protobuf.Duration - 130, // 11: specs.EtcdBackupSpec.created_at:type_name -> google.protobuf.Timestamp - 129, // 12: specs.BackupDataSpec.interval:type_name -> google.protobuf.Duration + 103, // 3: specs.MachineStatusSpec.platform_metadata:type_name -> specs.MachineStatusSpec.PlatformMetadata + 106, // 4: specs.MachineStatusSpec.image_labels:type_name -> specs.MachineStatusSpec.ImageLabelsEntry + 104, // 5: specs.MachineStatusSpec.schematic:type_name -> specs.MachineStatusSpec.Schematic + 21, // 6: specs.MachineStatusSpec.secure_boot_status:type_name -> specs.SecureBootStatus + 105, // 7: specs.MachineStatusSpec.diagnostics:type_name -> specs.MachineStatusSpec.Diagnostic + 111, // 8: specs.ClusterSpec.features:type_name -> specs.ClusterSpec.Features + 28, // 9: specs.ClusterSpec.backup_configuration:type_name -> specs.EtcdBackupConf + 131, // 10: specs.EtcdBackupConf.interval:type_name -> google.protobuf.Duration + 132, // 11: specs.EtcdBackupSpec.created_at:type_name -> google.protobuf.Timestamp + 131, // 12: specs.BackupDataSpec.interval:type_name -> google.protobuf.Duration 5, // 13: specs.EtcdBackupStatusSpec.status:type_name -> specs.EtcdBackupStatusSpec.Status - 130, // 14: specs.EtcdBackupStatusSpec.last_backup_time:type_name -> google.protobuf.Timestamp - 130, // 15: specs.EtcdBackupStatusSpec.last_backup_attempt:type_name -> google.protobuf.Timestamp - 130, // 16: specs.EtcdManualBackupSpec.backup_at:type_name -> google.protobuf.Timestamp - 33, // 17: specs.EtcdBackupOverallStatusSpec.last_backup_status:type_name -> specs.EtcdBackupStatusSpec + 132, // 14: specs.EtcdBackupStatusSpec.last_backup_time:type_name -> google.protobuf.Timestamp + 132, // 15: specs.EtcdBackupStatusSpec.last_backup_attempt:type_name -> google.protobuf.Timestamp + 132, // 16: specs.EtcdManualBackupSpec.backup_at:type_name -> google.protobuf.Timestamp + 34, // 17: specs.EtcdBackupOverallStatusSpec.last_backup_status:type_name -> specs.EtcdBackupStatusSpec 6, // 18: specs.ClusterMachineStatusSpec.stage:type_name -> specs.ClusterMachineStatusSpec.Stage 0, // 19: specs.ClusterMachineStatusSpec.config_apply_status:type_name -> specs.ConfigApplyStatus - 110, // 20: specs.ClusterMachineStatusSpec.provision_status:type_name -> specs.ClusterMachineStatusSpec.ProvisionStatus - 45, // 21: specs.ClusterStatusSpec.machines:type_name -> specs.Machines + 112, // 20: specs.ClusterMachineStatusSpec.provision_status:type_name -> specs.ClusterMachineStatusSpec.ProvisionStatus + 46, // 21: specs.ClusterStatusSpec.machines:type_name -> specs.Machines 7, // 22: specs.ClusterStatusSpec.phase:type_name -> specs.ClusterStatusSpec.Phase 8, // 23: specs.MachineSetSpec.update_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy - 112, // 24: specs.MachineSetSpec.machine_class:type_name -> specs.MachineSetSpec.MachineAllocation - 113, // 25: specs.MachineSetSpec.bootstrap_spec:type_name -> specs.MachineSetSpec.BootstrapSpec + 114, // 24: specs.MachineSetSpec.machine_class:type_name -> specs.MachineSetSpec.MachineAllocation + 115, // 25: specs.MachineSetSpec.bootstrap_spec:type_name -> specs.MachineSetSpec.BootstrapSpec 8, // 26: specs.MachineSetSpec.delete_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy - 115, // 27: specs.MachineSetSpec.update_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig - 115, // 28: specs.MachineSetSpec.delete_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig - 112, // 29: specs.MachineSetSpec.machine_allocation:type_name -> specs.MachineSetSpec.MachineAllocation + 117, // 27: specs.MachineSetSpec.update_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig + 117, // 28: specs.MachineSetSpec.delete_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig + 114, // 29: specs.MachineSetSpec.machine_allocation:type_name -> specs.MachineSetSpec.MachineAllocation 12, // 30: specs.TalosUpgradeStatusSpec.phase:type_name -> specs.TalosUpgradeStatusSpec.Phase 1, // 31: specs.MachineSetStatusSpec.phase:type_name -> specs.MachineSetPhase - 45, // 32: specs.MachineSetStatusSpec.machines:type_name -> specs.Machines - 112, // 33: specs.MachineSetStatusSpec.machine_allocation:type_name -> specs.MachineSetSpec.MachineAllocation - 131, // 34: specs.MachineStatusSnapshotSpec.machine_status:type_name -> machine.MachineStatusEvent - 116, // 35: specs.ControlPlaneStatusSpec.conditions:type_name -> specs.ControlPlaneStatusSpec.Condition - 117, // 36: specs.KubernetesStatusSpec.nodes:type_name -> specs.KubernetesStatusSpec.NodeStatus - 119, // 37: specs.KubernetesStatusSpec.static_pods:type_name -> specs.KubernetesStatusSpec.NodeStaticPods + 46, // 32: specs.MachineSetStatusSpec.machines:type_name -> specs.Machines + 114, // 33: specs.MachineSetStatusSpec.machine_allocation:type_name -> specs.MachineSetSpec.MachineAllocation + 133, // 34: specs.MachineStatusSnapshotSpec.machine_status:type_name -> machine.MachineStatusEvent + 118, // 35: specs.ControlPlaneStatusSpec.conditions:type_name -> specs.ControlPlaneStatusSpec.Condition + 119, // 36: specs.KubernetesStatusSpec.nodes:type_name -> specs.KubernetesStatusSpec.NodeStatus + 121, // 37: specs.KubernetesStatusSpec.static_pods:type_name -> specs.KubernetesStatusSpec.NodeStaticPods 15, // 38: specs.KubernetesUpgradeStatusSpec.phase:type_name -> specs.KubernetesUpgradeStatusSpec.Phase - 59, // 39: specs.OngoingTaskSpec.talos_upgrade:type_name -> specs.TalosUpgradeStatusSpec - 67, // 40: specs.OngoingTaskSpec.kubernetes_upgrade:type_name -> specs.KubernetesUpgradeStatusSpec - 69, // 41: specs.OngoingTaskSpec.destroy:type_name -> specs.DestroyStatusSpec - 75, // 42: specs.FeaturesConfigSpec.etcd_backup_settings:type_name -> specs.EtcdBackupSettings - 129, // 43: specs.EtcdBackupSettings.tick_interval:type_name -> google.protobuf.Duration - 129, // 44: specs.EtcdBackupSettings.min_interval:type_name -> google.protobuf.Duration - 129, // 45: specs.EtcdBackupSettings.max_interval:type_name -> google.protobuf.Duration - 120, // 46: specs.MachineClassSpec.auto_provision:type_name -> specs.MachineClassSpec.Provision - 121, // 47: specs.MachineConfigGenOptionsSpec.install_image:type_name -> specs.MachineConfigGenOptionsSpec.InstallImage - 122, // 48: specs.KubernetesUsageSpec.cpu:type_name -> specs.KubernetesUsageSpec.Quantity - 122, // 49: specs.KubernetesUsageSpec.mem:type_name -> specs.KubernetesUsageSpec.Quantity - 122, // 50: specs.KubernetesUsageSpec.storage:type_name -> specs.KubernetesUsageSpec.Quantity - 123, // 51: specs.KubernetesUsageSpec.pods:type_name -> specs.KubernetesUsageSpec.Pod - 124, // 52: specs.ImagePullRequestSpec.node_image_list:type_name -> specs.ImagePullRequestSpec.NodeImageList - 125, // 53: specs.TalosExtensionsSpec.items:type_name -> specs.TalosExtensionsSpec.Info + 60, // 39: specs.OngoingTaskSpec.talos_upgrade:type_name -> specs.TalosUpgradeStatusSpec + 68, // 40: specs.OngoingTaskSpec.kubernetes_upgrade:type_name -> specs.KubernetesUpgradeStatusSpec + 70, // 41: specs.OngoingTaskSpec.destroy:type_name -> specs.DestroyStatusSpec + 76, // 42: specs.FeaturesConfigSpec.etcd_backup_settings:type_name -> specs.EtcdBackupSettings + 131, // 43: specs.EtcdBackupSettings.tick_interval:type_name -> google.protobuf.Duration + 131, // 44: specs.EtcdBackupSettings.min_interval:type_name -> google.protobuf.Duration + 131, // 45: specs.EtcdBackupSettings.max_interval:type_name -> google.protobuf.Duration + 122, // 46: specs.MachineClassSpec.auto_provision:type_name -> specs.MachineClassSpec.Provision + 123, // 47: specs.MachineConfigGenOptionsSpec.install_image:type_name -> specs.MachineConfigGenOptionsSpec.InstallImage + 124, // 48: specs.KubernetesUsageSpec.cpu:type_name -> specs.KubernetesUsageSpec.Quantity + 124, // 49: specs.KubernetesUsageSpec.mem:type_name -> specs.KubernetesUsageSpec.Quantity + 124, // 50: specs.KubernetesUsageSpec.storage:type_name -> specs.KubernetesUsageSpec.Quantity + 125, // 51: specs.KubernetesUsageSpec.pods:type_name -> specs.KubernetesUsageSpec.Pod + 126, // 52: specs.ImagePullRequestSpec.node_image_list:type_name -> specs.ImagePullRequestSpec.NodeImageList + 127, // 53: specs.TalosExtensionsSpec.items:type_name -> specs.TalosExtensionsSpec.Info 16, // 54: specs.ExtensionsConfigurationStatusSpec.phase:type_name -> specs.ExtensionsConfigurationStatusSpec.Phase - 126, // 55: specs.MachineExtensionsStatusSpec.extensions:type_name -> specs.MachineExtensionsStatusSpec.Item - 127, // 56: specs.ClusterStatusMetricsSpec.phases:type_name -> specs.ClusterStatusMetricsSpec.PhasesEntry - 22, // 57: specs.MachineRequestSetSpec.meta_values:type_name -> specs.MetaValue + 128, // 55: specs.MachineExtensionsStatusSpec.extensions:type_name -> specs.MachineExtensionsStatusSpec.Item + 129, // 56: specs.ClusterStatusMetricsSpec.phases:type_name -> specs.ClusterStatusMetricsSpec.PhasesEntry + 23, // 57: specs.MachineRequestSetSpec.meta_values:type_name -> specs.MetaValue 3, // 58: specs.MachineRequestSetSpec.grpc_tunnel:type_name -> specs.GrpcTunnelMode - 128, // 59: specs.ClusterDiagnosticsSpec.nodes:type_name -> specs.ClusterDiagnosticsSpec.Node + 130, // 59: specs.ClusterDiagnosticsSpec.nodes:type_name -> specs.ClusterDiagnosticsSpec.Node 18, // 60: specs.ClusterMachineRequestStatusSpec.stage:type_name -> specs.ClusterMachineRequestStatusSpec.Stage - 105, // 61: specs.MachineStatusSpec.HardwareStatus.processors:type_name -> specs.MachineStatusSpec.HardwareStatus.Processor - 106, // 62: specs.MachineStatusSpec.HardwareStatus.memory_modules:type_name -> specs.MachineStatusSpec.HardwareStatus.MemoryModule - 107, // 63: specs.MachineStatusSpec.HardwareStatus.blockdevices:type_name -> specs.MachineStatusSpec.HardwareStatus.BlockDevice - 108, // 64: specs.MachineStatusSpec.NetworkStatus.network_links:type_name -> specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus - 21, // 65: specs.MachineStatusSpec.Schematic.overlay:type_name -> specs.Overlay - 22, // 66: specs.MachineStatusSpec.Schematic.meta_values:type_name -> specs.MetaValue - 9, // 67: specs.MachineSetSpec.MachineClass.allocation_type:type_name -> specs.MachineSetSpec.MachineClass.Type - 10, // 68: specs.MachineSetSpec.MachineAllocation.allocation_type:type_name -> specs.MachineSetSpec.MachineAllocation.Type - 11, // 69: specs.MachineSetSpec.MachineAllocation.source:type_name -> specs.MachineSetSpec.MachineAllocation.Source - 114, // 70: specs.MachineSetSpec.UpdateStrategyConfig.rolling:type_name -> specs.MachineSetSpec.RollingUpdateStrategyConfig - 2, // 71: specs.ControlPlaneStatusSpec.Condition.type:type_name -> specs.ConditionType - 13, // 72: specs.ControlPlaneStatusSpec.Condition.status:type_name -> specs.ControlPlaneStatusSpec.Condition.Status - 14, // 73: specs.ControlPlaneStatusSpec.Condition.severity:type_name -> specs.ControlPlaneStatusSpec.Condition.Severity - 118, // 74: specs.KubernetesStatusSpec.NodeStaticPods.static_pods:type_name -> specs.KubernetesStatusSpec.StaticPodStatus - 22, // 75: specs.MachineClassSpec.Provision.meta_values:type_name -> specs.MetaValue - 3, // 76: specs.MachineClassSpec.Provision.grpc_tunnel:type_name -> specs.GrpcTunnelMode - 20, // 77: specs.MachineConfigGenOptionsSpec.InstallImage.secure_boot_status:type_name -> specs.SecureBootStatus - 17, // 78: specs.MachineExtensionsStatusSpec.Item.phase:type_name -> specs.MachineExtensionsStatusSpec.Item.Phase - 79, // [79:79] is the sub-list for method output_type - 79, // [79:79] is the sub-list for method input_type - 79, // [79:79] is the sub-list for extension type_name - 79, // [79:79] is the sub-list for extension extendee - 0, // [0:79] is the sub-list for field type_name + 19, // 61: specs.InfraMachineConfigSpec.power_state:type_name -> specs.InfraMachineConfigSpec.MachinePowerState + 107, // 62: specs.MachineStatusSpec.HardwareStatus.processors:type_name -> specs.MachineStatusSpec.HardwareStatus.Processor + 108, // 63: specs.MachineStatusSpec.HardwareStatus.memory_modules:type_name -> specs.MachineStatusSpec.HardwareStatus.MemoryModule + 109, // 64: specs.MachineStatusSpec.HardwareStatus.blockdevices:type_name -> specs.MachineStatusSpec.HardwareStatus.BlockDevice + 110, // 65: specs.MachineStatusSpec.NetworkStatus.network_links:type_name -> specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus + 22, // 66: specs.MachineStatusSpec.Schematic.overlay:type_name -> specs.Overlay + 23, // 67: specs.MachineStatusSpec.Schematic.meta_values:type_name -> specs.MetaValue + 9, // 68: specs.MachineSetSpec.MachineClass.allocation_type:type_name -> specs.MachineSetSpec.MachineClass.Type + 10, // 69: specs.MachineSetSpec.MachineAllocation.allocation_type:type_name -> specs.MachineSetSpec.MachineAllocation.Type + 11, // 70: specs.MachineSetSpec.MachineAllocation.source:type_name -> specs.MachineSetSpec.MachineAllocation.Source + 116, // 71: specs.MachineSetSpec.UpdateStrategyConfig.rolling:type_name -> specs.MachineSetSpec.RollingUpdateStrategyConfig + 2, // 72: specs.ControlPlaneStatusSpec.Condition.type:type_name -> specs.ConditionType + 13, // 73: specs.ControlPlaneStatusSpec.Condition.status:type_name -> specs.ControlPlaneStatusSpec.Condition.Status + 14, // 74: specs.ControlPlaneStatusSpec.Condition.severity:type_name -> specs.ControlPlaneStatusSpec.Condition.Severity + 120, // 75: specs.KubernetesStatusSpec.NodeStaticPods.static_pods:type_name -> specs.KubernetesStatusSpec.StaticPodStatus + 23, // 76: specs.MachineClassSpec.Provision.meta_values:type_name -> specs.MetaValue + 3, // 77: specs.MachineClassSpec.Provision.grpc_tunnel:type_name -> specs.GrpcTunnelMode + 21, // 78: specs.MachineConfigGenOptionsSpec.InstallImage.secure_boot_status:type_name -> specs.SecureBootStatus + 17, // 79: specs.MachineExtensionsStatusSpec.Item.phase:type_name -> specs.MachineExtensionsStatusSpec.Item.Phase + 80, // [80:80] is the sub-list for method output_type + 80, // [80:80] is the sub-list for method input_type + 80, // [80:80] is the sub-list for extension type_name + 80, // [80:80] is the sub-list for extension extendee + 0, // [0:80] is the sub-list for field type_name } func init() { file_omni_specs_omni_proto_init() } @@ -9481,8 +9601,8 @@ func file_omni_specs_omni_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_omni_specs_omni_proto_rawDesc, - NumEnums: 19, - NumMessages: 110, + NumEnums: 20, + NumMessages: 111, NumExtensions: 0, NumServices: 0, }, diff --git a/client/api/omni/specs/omni.proto b/client/api/omni/specs/omni.proto index 6e828ad9..754388ba 100644 --- a/client/api/omni/specs/omni.proto +++ b/client/api/omni/specs/omni.proto @@ -1254,3 +1254,15 @@ message ClusterMachineRequestStatusSpec { string provider_id = 3; Stage stage = 4; } + +// InfraMachineConfigSpec is the spec of the user-owned InfraMachineConfig resource. +message InfraMachineConfigSpec { + enum MachinePowerState { + POWER_STATE_DEFAULT = 0; + POWER_STATE_OFF = 1; + POWER_STATE_ON = 2; + } + + MachinePowerState power_state = 1; + bool accepted = 2; +} diff --git a/client/api/omni/specs/omni_vtproto.pb.go b/client/api/omni/specs/omni_vtproto.pb.go index 2934562d..b610d684 100644 --- a/client/api/omni/specs/omni_vtproto.pb.go +++ b/client/api/omni/specs/omni_vtproto.pb.go @@ -2373,6 +2373,24 @@ func (m *ClusterMachineRequestStatusSpec) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *InfraMachineConfigSpec) CloneVT() *InfraMachineConfigSpec { + if m == nil { + return (*InfraMachineConfigSpec)(nil) + } + r := new(InfraMachineConfigSpec) + r.PowerState = m.PowerState + r.Accepted = m.Accepted + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *InfraMachineConfigSpec) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *MachineSpec) EqualVT(that *MachineSpec) bool { if this == that { return true @@ -5582,6 +5600,28 @@ func (this *ClusterMachineRequestStatusSpec) EqualMessageVT(thatMsg proto.Messag } return this.EqualVT(that) } +func (this *InfraMachineConfigSpec) EqualVT(that *InfraMachineConfigSpec) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.PowerState != that.PowerState { + return false + } + if this.Accepted != that.Accepted { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *InfraMachineConfigSpec) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*InfraMachineConfigSpec) + if !ok { + return false + } + return this.EqualVT(that) +} func (m *MachineSpec) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -11840,6 +11880,54 @@ func (m *ClusterMachineRequestStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (i return len(dAtA) - i, nil } +func (m *InfraMachineConfigSpec) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InfraMachineConfigSpec) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *InfraMachineConfigSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Accepted { + i-- + if m.Accepted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.PowerState != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.PowerState)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *MachineSpec) SizeVT() (n int) { if m == nil { return 0 @@ -14297,6 +14385,22 @@ func (m *ClusterMachineRequestStatusSpec) SizeVT() (n int) { return n } +func (m *InfraMachineConfigSpec) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PowerState != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.PowerState)) + } + if m.Accepted { + n += 2 + } + n += len(m.unknownFields) + return n +} + func (m *MachineSpec) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -29832,3 +29936,93 @@ func (m *ClusterMachineRequestStatusSpec) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *InfraMachineConfigSpec) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InfraMachineConfigSpec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InfraMachineConfigSpec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PowerState", wireType) + } + m.PowerState = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PowerState |= InfraMachineConfigSpec_MachinePowerState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Accepted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Accepted = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/client/api/omni/specs/siderolink.pb.go b/client/api/omni/specs/siderolink.pb.go index 7c700e04..006296d0 100644 --- a/client/api/omni/specs/siderolink.pb.go +++ b/client/api/omni/specs/siderolink.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/siderolink.proto diff --git a/client/api/omni/specs/system.pb.go b/client/api/omni/specs/system.pb.go index 8dec66ce..e912def3 100644 --- a/client/api/omni/specs/system.pb.go +++ b/client/api/omni/specs/system.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/system.proto diff --git a/client/api/omni/specs/virtual.pb.go b/client/api/omni/specs/virtual.pb.go index 4284045c..b9b88501 100644 --- a/client/api/omni/specs/virtual.pb.go +++ b/client/api/omni/specs/virtual.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc v4.24.4 // source: omni/specs/virtual.proto diff --git a/client/api/talos/machine/machine.pb.gw.go b/client/api/talos/machine/machine.pb.gw.go index ac2464e3..8d00b6df 100644 --- a/client/api/talos/machine/machine.pb.gw.go +++ b/client/api/talos/machine/machine.pb.gw.go @@ -10,6 +10,7 @@ package machine import ( "context" + "errors" "io" "net/http" @@ -27,99 +28,96 @@ import ( ) // Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = metadata.Join +var ( + _ codes.Code + _ io.Reader + _ status.Status + _ = errors.New + _ = runtime.String + _ = utilities.NewDoubleArray + _ = metadata.Join +) func request_MachineService_ApplyConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ApplyConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ApplyConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ApplyConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ApplyConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ApplyConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ApplyConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ApplyConfiguration(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Bootstrap_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.BootstrapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.BootstrapRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Bootstrap(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Bootstrap_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.BootstrapRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.BootstrapRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Bootstrap(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Containers_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ContainersRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ContainersRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Containers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Containers_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ContainersRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ContainersRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Containers(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Copy_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_CopyClient, runtime.ServerMetadata, error) { - var protoReq extMachine.CopyRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.CopyRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Copy(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -130,69 +128,64 @@ func request_MachineService_Copy_0(ctx context.Context, marshaler runtime.Marsha } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_CPUInfo_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.CPUInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_CPUInfo_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.CPUInfo(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_DiskStats_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.DiskStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_DiskStats_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.DiskStats(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Dmesg_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_DmesgClient, runtime.ServerMetadata, error) { - var protoReq extMachine.DmesgRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.DmesgRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Dmesg(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -203,17 +196,16 @@ func request_MachineService_Dmesg_0(ctx context.Context, marshaler runtime.Marsh } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_Events_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_EventsClient, runtime.ServerMetadata, error) { - var protoReq extMachine.EventsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EventsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Events(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -224,111 +216,102 @@ func request_MachineService_Events_0(ctx context.Context, marshaler runtime.Mars } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_EtcdMemberList_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdMemberListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdMemberListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdMemberList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdMemberList_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdMemberListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdMemberListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdMemberList(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdRemoveMemberByID_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdRemoveMemberByIDRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdRemoveMemberByIDRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdRemoveMemberByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdRemoveMemberByID_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdRemoveMemberByIDRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdRemoveMemberByIDRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdRemoveMemberByID(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdLeaveCluster_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdLeaveClusterRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdLeaveClusterRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdLeaveCluster(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdLeaveCluster_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdLeaveClusterRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdLeaveClusterRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdLeaveCluster(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdForfeitLeadership_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdForfeitLeadershipRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdForfeitLeadershipRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdForfeitLeadership(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdForfeitLeadership_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdForfeitLeadershipRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdForfeitLeadershipRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdForfeitLeadership(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdRecover_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -342,7 +325,7 @@ func request_MachineService_EtcdRecover_0(ctx context.Context, marshaler runtime for { var protoReq extCommon.Data err = dec.Decode(&protoReq) - if err == io.EOF { + if errors.Is(err, io.EOF) { break } if err != nil { @@ -350,14 +333,13 @@ func request_MachineService_EtcdRecover_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } if err = stream.Send(&protoReq); err != nil { - if err == io.EOF { + if errors.Is(err, io.EOF) { break } grpclog.Errorf("Failed to send request: %v", err) return nil, metadata, err } } - if err := stream.CloseSend(); err != nil { grpclog.Errorf("Failed to terminate client stream: %v", err) return nil, metadata, err @@ -368,21 +350,19 @@ func request_MachineService_EtcdRecover_0(ctx context.Context, marshaler runtime return nil, metadata, err } metadata.HeaderMD = header - msg, err := stream.CloseAndRecv() metadata.TrailerMD = stream.Trailer() return msg, metadata, err - } func request_MachineService_EtcdSnapshot_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_EtcdSnapshotClient, runtime.ServerMetadata, error) { - var protoReq extMachine.EtcdSnapshotRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.EtcdSnapshotRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.EtcdSnapshot(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -393,173 +373,160 @@ func request_MachineService_EtcdSnapshot_0(ctx context.Context, marshaler runtim } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_EtcdAlarmList_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdAlarmList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdAlarmList_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdAlarmList(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdAlarmDisarm_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdAlarmDisarm(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdAlarmDisarm_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdAlarmDisarm(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdDefragment_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdDefragment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdDefragment_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdDefragment(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_EtcdStatus_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.EtcdStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_EtcdStatus_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.EtcdStatus(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_GenerateConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.GenerateConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.GenerateConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GenerateConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_GenerateConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.GenerateConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.GenerateConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GenerateConfiguration(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Hostname_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Hostname(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Hostname_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Hostname(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Kubeconfig_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_KubeconfigClient, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Kubeconfig(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -570,17 +537,16 @@ func request_MachineService_Kubeconfig_0(ctx context.Context, marshaler runtime. } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_List_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_ListClient, runtime.ServerMetadata, error) { - var protoReq extMachine.ListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.List(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -591,17 +557,16 @@ func request_MachineService_List_0(ctx context.Context, marshaler runtime.Marsha } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_DiskUsage_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_DiskUsageClient, runtime.ServerMetadata, error) { - var protoReq extMachine.DiskUsageRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.DiskUsageRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.DiskUsage(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -612,43 +577,40 @@ func request_MachineService_DiskUsage_0(ctx context.Context, marshaler runtime.M } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_LoadAvg_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.LoadAvg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_LoadAvg_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.LoadAvg(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Logs_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_LogsClient, runtime.ServerMetadata, error) { - var protoReq extMachine.LogsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.LogsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Logs(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -659,121 +621,112 @@ func request_MachineService_Logs_0(ctx context.Context, marshaler runtime.Marsha } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_Memory_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Memory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Memory_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Memory(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Mounts_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Mounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Mounts_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Mounts(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_NetworkDeviceStats_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.NetworkDeviceStats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_NetworkDeviceStats_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.NetworkDeviceStats(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Processes_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Processes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Processes_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Processes(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Read_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_ReadClient, runtime.ServerMetadata, error) { - var protoReq extMachine.ReadRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ReadRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.Read(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -784,381 +737,352 @@ func request_MachineService_Read_0(ctx context.Context, marshaler runtime.Marsha } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_Reboot_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RebootRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RebootRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Reboot(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Reboot_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RebootRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RebootRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Reboot(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Restart_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RestartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RestartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Restart(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Restart_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RestartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RestartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Restart(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Rollback_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RollbackRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RollbackRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Rollback(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Rollback_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.RollbackRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.RollbackRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Rollback(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Reset_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ResetRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ResetRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Reset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Reset_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ResetRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ResetRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Reset(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_ServiceList_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ServiceList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ServiceList_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ServiceList(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_ServiceRestart_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceRestartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceRestartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ServiceRestart(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ServiceRestart_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceRestartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceRestartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ServiceRestart(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_ServiceStart_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceStartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceStartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ServiceStart(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ServiceStart_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceStartRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceStartRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ServiceStart(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_ServiceStop_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceStopRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceStopRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ServiceStop(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ServiceStop_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ServiceStopRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ServiceStopRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ServiceStop(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Shutdown_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ShutdownRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ShutdownRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Shutdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Shutdown_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ShutdownRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ShutdownRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Shutdown(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Stats_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.StatsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.StatsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Stats(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Stats_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.StatsRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.StatsRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Stats(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_SystemStat_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.SystemStat(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_SystemStat_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.SystemStat(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Upgrade_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.UpgradeRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.UpgradeRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Upgrade(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Upgrade_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.UpgradeRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.UpgradeRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Upgrade(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_Version_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Version(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Version_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extEmptypb.Empty - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extEmptypb.Empty + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Version(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_GenerateClientConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.GenerateClientConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.GenerateClientConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GenerateClientConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_GenerateClientConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.GenerateClientConfigurationRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.GenerateClientConfigurationRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GenerateClientConfiguration(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_PacketCapture_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_PacketCaptureClient, runtime.ServerMetadata, error) { - var protoReq extMachine.PacketCaptureRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.PacketCaptureRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.PacketCapture(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -1169,95 +1093,88 @@ func request_MachineService_PacketCapture_0(ctx context.Context, marshaler runti } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_Netstat_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.NetstatRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.NetstatRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Netstat(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_Netstat_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.NetstatRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.NetstatRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Netstat(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_MetaWrite_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.MetaWriteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.MetaWriteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.MetaWrite(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_MetaWrite_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.MetaWriteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.MetaWriteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.MetaWrite(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_MetaDelete_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.MetaDeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.MetaDeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.MetaDelete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_MetaDelete_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.MetaDeleteRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.MetaDeleteRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.MetaDelete(ctx, &protoReq) return msg, metadata, err - } func request_MachineService_ImageList_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (extMachine.MachineService_ImageListClient, runtime.ServerMetadata, error) { - var protoReq extMachine.ImageListRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ImageListRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - stream, err := client.ImageList(ctx, &protoReq) if err != nil { return nil, metadata, err @@ -1268,33 +1185,30 @@ func request_MachineService_ImageList_0(ctx context.Context, marshaler runtime.M } metadata.HeaderMD = header return stream, metadata, nil - } func request_MachineService_ImagePull_0(ctx context.Context, marshaler runtime.Marshaler, client extMachine.MachineServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ImagePullRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ImagePullRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ImagePull(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err - } func local_request_MachineService_ImagePull_0(ctx context.Context, marshaler runtime.Marshaler, server extMachine.MachineServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq extMachine.ImagePullRequest - var metadata runtime.ServerMetadata - - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + var ( + protoReq extMachine.ImagePullRequest + metadata runtime.ServerMetadata + ) + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ImagePull(ctx, &protoReq) return msg, metadata, err - } // RegisterMachineServiceHandlerServer registers the http handlers for service MachineService to "mux". @@ -1303,16 +1217,13 @@ func local_request_MachineService_ImagePull_0(ctx context.Context, marshaler run // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMachineServiceHandlerFromEndpoint instead. // GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server extMachine.MachineServiceServer) error { - - mux.Handle("POST", pattern_MachineService_ApplyConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ApplyConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ApplyConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/ApplyConfiguration")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ApplyConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/ApplyConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1324,20 +1235,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ApplyConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Bootstrap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Bootstrap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Bootstrap", runtime.WithHTTPPathPattern("/machine.MachineService/Bootstrap")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Bootstrap", runtime.WithHTTPPathPattern("/machine.MachineService/Bootstrap")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1349,20 +1255,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Bootstrap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Containers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Containers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Containers", runtime.WithHTTPPathPattern("/machine.MachineService/Containers")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Containers", runtime.WithHTTPPathPattern("/machine.MachineService/Containers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1374,27 +1275,22 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Containers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_Copy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Copy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_CPUInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_CPUInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/CPUInfo", runtime.WithHTTPPathPattern("/machine.MachineService/CPUInfo")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/CPUInfo", runtime.WithHTTPPathPattern("/machine.MachineService/CPUInfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1406,20 +1302,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_CPUInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_DiskStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_DiskStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/DiskStats", runtime.WithHTTPPathPattern("/machine.MachineService/DiskStats")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/DiskStats", runtime.WithHTTPPathPattern("/machine.MachineService/DiskStats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1431,34 +1322,29 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_DiskStats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_Dmesg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Dmesg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - mux.Handle("POST", pattern_MachineService_Events_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Events_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_EtcdMemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdMemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdMemberList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdMemberList")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdMemberList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdMemberList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1470,20 +1356,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdMemberList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdRemoveMemberByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdRemoveMemberByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdRemoveMemberByID", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRemoveMemberByID")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdRemoveMemberByID", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRemoveMemberByID")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1495,20 +1376,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdRemoveMemberByID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdLeaveCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdLeaveCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdLeaveCluster", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdLeaveCluster")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdLeaveCluster", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdLeaveCluster")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1520,20 +1396,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdLeaveCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdForfeitLeadership_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdForfeitLeadership_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdForfeitLeadership", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdForfeitLeadership")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdForfeitLeadership", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdForfeitLeadership")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1545,34 +1416,29 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdForfeitLeadership_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_EtcdRecover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdRecover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - mux.Handle("POST", pattern_MachineService_EtcdSnapshot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdSnapshot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_EtcdAlarmList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdAlarmList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmList")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1584,20 +1450,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdAlarmList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdAlarmDisarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdAlarmDisarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmDisarm", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmDisarm")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmDisarm", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmDisarm")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1609,20 +1470,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdAlarmDisarm_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdDefragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdDefragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdDefragment", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdDefragment")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdDefragment", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdDefragment")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1634,20 +1490,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdDefragment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdStatus", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdStatus")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/EtcdStatus", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdStatus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1659,20 +1510,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_GenerateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_GenerateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/GenerateConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateConfiguration")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/GenerateConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1684,20 +1530,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_GenerateConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Hostname_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Hostname_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Hostname", runtime.WithHTTPPathPattern("/machine.MachineService/Hostname")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Hostname", runtime.WithHTTPPathPattern("/machine.MachineService/Hostname")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1709,41 +1550,36 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Hostname_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - mux.Handle("POST", pattern_MachineService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - mux.Handle("POST", pattern_MachineService_DiskUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_DiskUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_LoadAvg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_LoadAvg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/LoadAvg", runtime.WithHTTPPathPattern("/machine.MachineService/LoadAvg")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/LoadAvg", runtime.WithHTTPPathPattern("/machine.MachineService/LoadAvg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1755,27 +1591,22 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_LoadAvg_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_Logs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Logs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_Memory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Memory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Memory", runtime.WithHTTPPathPattern("/machine.MachineService/Memory")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Memory", runtime.WithHTTPPathPattern("/machine.MachineService/Memory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1787,20 +1618,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Memory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Mounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Mounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Mounts", runtime.WithHTTPPathPattern("/machine.MachineService/Mounts")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Mounts", runtime.WithHTTPPathPattern("/machine.MachineService/Mounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1812,20 +1638,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Mounts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_NetworkDeviceStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_NetworkDeviceStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/NetworkDeviceStats", runtime.WithHTTPPathPattern("/machine.MachineService/NetworkDeviceStats")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/NetworkDeviceStats", runtime.WithHTTPPathPattern("/machine.MachineService/NetworkDeviceStats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1837,20 +1658,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_NetworkDeviceStats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Processes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Processes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Processes", runtime.WithHTTPPathPattern("/machine.MachineService/Processes")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Processes", runtime.WithHTTPPathPattern("/machine.MachineService/Processes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1862,27 +1678,22 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Processes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_Reboot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Reboot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Reboot", runtime.WithHTTPPathPattern("/machine.MachineService/Reboot")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Reboot", runtime.WithHTTPPathPattern("/machine.MachineService/Reboot")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1894,20 +1705,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Reboot_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Restart", runtime.WithHTTPPathPattern("/machine.MachineService/Restart")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Restart", runtime.WithHTTPPathPattern("/machine.MachineService/Restart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1919,20 +1725,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Restart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Rollback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Rollback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Rollback", runtime.WithHTTPPathPattern("/machine.MachineService/Rollback")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Rollback", runtime.WithHTTPPathPattern("/machine.MachineService/Rollback")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1944,20 +1745,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Rollback_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Reset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Reset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Reset", runtime.WithHTTPPathPattern("/machine.MachineService/Reset")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Reset", runtime.WithHTTPPathPattern("/machine.MachineService/Reset")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1969,20 +1765,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Reset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceList", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceList")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceList", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1994,20 +1785,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceRestart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceRestart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceRestart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceRestart")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceRestart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceRestart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2019,20 +1805,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceRestart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceStart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStart")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceStart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2044,20 +1825,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceStart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceStop", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStop")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ServiceStop", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2069,20 +1845,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceStop_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Shutdown", runtime.WithHTTPPathPattern("/machine.MachineService/Shutdown")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Shutdown", runtime.WithHTTPPathPattern("/machine.MachineService/Shutdown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2094,20 +1865,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Shutdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Stats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Stats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Stats", runtime.WithHTTPPathPattern("/machine.MachineService/Stats")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Stats", runtime.WithHTTPPathPattern("/machine.MachineService/Stats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2119,20 +1885,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Stats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_SystemStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_SystemStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/SystemStat", runtime.WithHTTPPathPattern("/machine.MachineService/SystemStat")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/SystemStat", runtime.WithHTTPPathPattern("/machine.MachineService/SystemStat")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2144,20 +1905,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_SystemStat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Upgrade_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Upgrade_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Upgrade", runtime.WithHTTPPathPattern("/machine.MachineService/Upgrade")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Upgrade", runtime.WithHTTPPathPattern("/machine.MachineService/Upgrade")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2169,20 +1925,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Upgrade_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Version_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Version_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Version", runtime.WithHTTPPathPattern("/machine.MachineService/Version")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Version", runtime.WithHTTPPathPattern("/machine.MachineService/Version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2194,20 +1945,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Version_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_GenerateClientConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_GenerateClientConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/GenerateClientConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateClientConfiguration")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/GenerateClientConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateClientConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2219,27 +1965,22 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_GenerateClientConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_PacketCapture_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_PacketCapture_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_Netstat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Netstat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Netstat", runtime.WithHTTPPathPattern("/machine.MachineService/Netstat")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/Netstat", runtime.WithHTTPPathPattern("/machine.MachineService/Netstat")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2251,20 +1992,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Netstat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_MetaWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_MetaWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/MetaWrite", runtime.WithHTTPPathPattern("/machine.MachineService/MetaWrite")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/MetaWrite", runtime.WithHTTPPathPattern("/machine.MachineService/MetaWrite")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2276,20 +2012,15 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_MetaWrite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_MetaDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_MetaDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/MetaDelete", runtime.WithHTTPPathPattern("/machine.MachineService/MetaDelete")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/MetaDelete", runtime.WithHTTPPathPattern("/machine.MachineService/MetaDelete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2301,27 +2032,22 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_MetaDelete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - mux.Handle("POST", pattern_MachineService_ImageList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ImageList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return }) - - mux.Handle("POST", pattern_MachineService_ImagePull_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ImagePull_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ImagePull", runtime.WithHTTPPathPattern("/machine.MachineService/ImagePull")) + annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/machine.MachineService/ImagePull", runtime.WithHTTPPathPattern("/machine.MachineService/ImagePull")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2333,9 +2059,7 @@ func RegisterMachineServiceHandlerServer(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ImagePull_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) return nil @@ -2362,7 +2086,6 @@ func RegisterMachineServiceHandlerFromEndpoint(ctx context.Context, mux *runtime } }() }() - return RegisterMachineServiceHandler(ctx, mux, conn) } @@ -2378,14 +2101,11 @@ func RegisterMachineServiceHandler(ctx context.Context, mux *runtime.ServeMux, c // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "extMachine.MachineServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client extMachine.MachineServiceClient) error { - - mux.Handle("POST", pattern_MachineService_ApplyConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ApplyConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ApplyConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/ApplyConfiguration")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ApplyConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/ApplyConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2396,18 +2116,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ApplyConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Bootstrap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Bootstrap_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Bootstrap", runtime.WithHTTPPathPattern("/machine.MachineService/Bootstrap")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Bootstrap", runtime.WithHTTPPathPattern("/machine.MachineService/Bootstrap")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2418,18 +2133,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Bootstrap_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Containers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Containers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Containers", runtime.WithHTTPPathPattern("/machine.MachineService/Containers")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Containers", runtime.WithHTTPPathPattern("/machine.MachineService/Containers")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2440,18 +2150,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Containers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Copy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Copy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Copy", runtime.WithHTTPPathPattern("/machine.MachineService/Copy")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Copy", runtime.WithHTTPPathPattern("/machine.MachineService/Copy")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2462,18 +2167,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Copy_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_CPUInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_CPUInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/CPUInfo", runtime.WithHTTPPathPattern("/machine.MachineService/CPUInfo")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/CPUInfo", runtime.WithHTTPPathPattern("/machine.MachineService/CPUInfo")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2484,18 +2184,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_CPUInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_DiskStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_DiskStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/DiskStats", runtime.WithHTTPPathPattern("/machine.MachineService/DiskStats")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/DiskStats", runtime.WithHTTPPathPattern("/machine.MachineService/DiskStats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2506,18 +2201,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_DiskStats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Dmesg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Dmesg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Dmesg", runtime.WithHTTPPathPattern("/machine.MachineService/Dmesg")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Dmesg", runtime.WithHTTPPathPattern("/machine.MachineService/Dmesg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2528,18 +2218,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Dmesg_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Events_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Events_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Events", runtime.WithHTTPPathPattern("/machine.MachineService/Events")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Events", runtime.WithHTTPPathPattern("/machine.MachineService/Events")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2550,18 +2235,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Events_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdMemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdMemberList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdMemberList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdMemberList")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdMemberList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdMemberList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2572,18 +2252,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdMemberList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdRemoveMemberByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdRemoveMemberByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdRemoveMemberByID", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRemoveMemberByID")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdRemoveMemberByID", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRemoveMemberByID")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2594,18 +2269,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdRemoveMemberByID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdLeaveCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdLeaveCluster_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdLeaveCluster", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdLeaveCluster")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdLeaveCluster", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdLeaveCluster")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2616,18 +2286,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdLeaveCluster_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdForfeitLeadership_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdForfeitLeadership_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdForfeitLeadership", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdForfeitLeadership")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdForfeitLeadership", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdForfeitLeadership")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2638,18 +2303,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdForfeitLeadership_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdRecover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdRecover_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdRecover", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRecover")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdRecover", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdRecover")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2660,18 +2320,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdRecover_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdSnapshot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdSnapshot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdSnapshot", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdSnapshot")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdSnapshot", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdSnapshot")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2682,18 +2337,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdSnapshot_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdAlarmList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdAlarmList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmList")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmList", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2704,18 +2354,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdAlarmList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdAlarmDisarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdAlarmDisarm_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmDisarm", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmDisarm")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdAlarmDisarm", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdAlarmDisarm")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2726,18 +2371,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdAlarmDisarm_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdDefragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdDefragment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdDefragment", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdDefragment")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdDefragment", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdDefragment")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2748,18 +2388,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdDefragment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_EtcdStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_EtcdStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdStatus", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdStatus")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/EtcdStatus", runtime.WithHTTPPathPattern("/machine.MachineService/EtcdStatus")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2770,18 +2405,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_EtcdStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_GenerateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_GenerateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/GenerateConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateConfiguration")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/GenerateConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2792,18 +2422,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_GenerateConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Hostname_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Hostname_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Hostname", runtime.WithHTTPPathPattern("/machine.MachineService/Hostname")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Hostname", runtime.WithHTTPPathPattern("/machine.MachineService/Hostname")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2814,18 +2439,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Hostname_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Kubeconfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Kubeconfig", runtime.WithHTTPPathPattern("/machine.MachineService/Kubeconfig")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Kubeconfig", runtime.WithHTTPPathPattern("/machine.MachineService/Kubeconfig")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2836,18 +2456,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Kubeconfig_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_List_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/List", runtime.WithHTTPPathPattern("/machine.MachineService/List")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/List", runtime.WithHTTPPathPattern("/machine.MachineService/List")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2858,18 +2473,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_List_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_DiskUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_DiskUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/DiskUsage", runtime.WithHTTPPathPattern("/machine.MachineService/DiskUsage")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/DiskUsage", runtime.WithHTTPPathPattern("/machine.MachineService/DiskUsage")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2880,18 +2490,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_DiskUsage_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_LoadAvg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_LoadAvg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/LoadAvg", runtime.WithHTTPPathPattern("/machine.MachineService/LoadAvg")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/LoadAvg", runtime.WithHTTPPathPattern("/machine.MachineService/LoadAvg")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2902,18 +2507,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_LoadAvg_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Logs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Logs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Logs", runtime.WithHTTPPathPattern("/machine.MachineService/Logs")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Logs", runtime.WithHTTPPathPattern("/machine.MachineService/Logs")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2924,18 +2524,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Logs_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Memory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Memory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Memory", runtime.WithHTTPPathPattern("/machine.MachineService/Memory")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Memory", runtime.WithHTTPPathPattern("/machine.MachineService/Memory")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2946,18 +2541,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Memory_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Mounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Mounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Mounts", runtime.WithHTTPPathPattern("/machine.MachineService/Mounts")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Mounts", runtime.WithHTTPPathPattern("/machine.MachineService/Mounts")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2968,18 +2558,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Mounts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_NetworkDeviceStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_NetworkDeviceStats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/NetworkDeviceStats", runtime.WithHTTPPathPattern("/machine.MachineService/NetworkDeviceStats")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/NetworkDeviceStats", runtime.WithHTTPPathPattern("/machine.MachineService/NetworkDeviceStats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2990,18 +2575,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_NetworkDeviceStats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Processes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Processes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Processes", runtime.WithHTTPPathPattern("/machine.MachineService/Processes")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Processes", runtime.WithHTTPPathPattern("/machine.MachineService/Processes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3012,18 +2592,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Processes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Read", runtime.WithHTTPPathPattern("/machine.MachineService/Read")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Read", runtime.WithHTTPPathPattern("/machine.MachineService/Read")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3034,18 +2609,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Read_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Reboot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Reboot_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Reboot", runtime.WithHTTPPathPattern("/machine.MachineService/Reboot")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Reboot", runtime.WithHTTPPathPattern("/machine.MachineService/Reboot")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3056,18 +2626,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Reboot_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Restart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Restart", runtime.WithHTTPPathPattern("/machine.MachineService/Restart")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Restart", runtime.WithHTTPPathPattern("/machine.MachineService/Restart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3078,18 +2643,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Restart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Rollback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Rollback_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Rollback", runtime.WithHTTPPathPattern("/machine.MachineService/Rollback")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Rollback", runtime.WithHTTPPathPattern("/machine.MachineService/Rollback")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3100,18 +2660,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Rollback_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Reset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Reset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Reset", runtime.WithHTTPPathPattern("/machine.MachineService/Reset")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Reset", runtime.WithHTTPPathPattern("/machine.MachineService/Reset")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3122,18 +2677,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Reset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceList", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceList")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceList", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3144,18 +2694,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceList_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceRestart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceRestart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceRestart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceRestart")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceRestart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceRestart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3166,18 +2711,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceRestart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceStart_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceStart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStart")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceStart", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStart")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3188,18 +2728,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceStart_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ServiceStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ServiceStop_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceStop", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStop")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ServiceStop", runtime.WithHTTPPathPattern("/machine.MachineService/ServiceStop")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3210,18 +2745,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ServiceStop_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Shutdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Shutdown", runtime.WithHTTPPathPattern("/machine.MachineService/Shutdown")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Shutdown", runtime.WithHTTPPathPattern("/machine.MachineService/Shutdown")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3232,18 +2762,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Shutdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Stats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Stats_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Stats", runtime.WithHTTPPathPattern("/machine.MachineService/Stats")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Stats", runtime.WithHTTPPathPattern("/machine.MachineService/Stats")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3254,18 +2779,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Stats_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_SystemStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_SystemStat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/SystemStat", runtime.WithHTTPPathPattern("/machine.MachineService/SystemStat")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/SystemStat", runtime.WithHTTPPathPattern("/machine.MachineService/SystemStat")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3276,18 +2796,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_SystemStat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Upgrade_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Upgrade_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Upgrade", runtime.WithHTTPPathPattern("/machine.MachineService/Upgrade")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Upgrade", runtime.WithHTTPPathPattern("/machine.MachineService/Upgrade")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3298,18 +2813,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Upgrade_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Version_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Version_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Version", runtime.WithHTTPPathPattern("/machine.MachineService/Version")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Version", runtime.WithHTTPPathPattern("/machine.MachineService/Version")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3320,18 +2830,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Version_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_GenerateClientConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_GenerateClientConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/GenerateClientConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateClientConfiguration")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/GenerateClientConfiguration", runtime.WithHTTPPathPattern("/machine.MachineService/GenerateClientConfiguration")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3342,18 +2847,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_GenerateClientConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_PacketCapture_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_PacketCapture_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/PacketCapture", runtime.WithHTTPPathPattern("/machine.MachineService/PacketCapture")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/PacketCapture", runtime.WithHTTPPathPattern("/machine.MachineService/PacketCapture")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3364,18 +2864,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_PacketCapture_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_Netstat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_Netstat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Netstat", runtime.WithHTTPPathPattern("/machine.MachineService/Netstat")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/Netstat", runtime.WithHTTPPathPattern("/machine.MachineService/Netstat")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3386,18 +2881,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_Netstat_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_MetaWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_MetaWrite_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/MetaWrite", runtime.WithHTTPPathPattern("/machine.MachineService/MetaWrite")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/MetaWrite", runtime.WithHTTPPathPattern("/machine.MachineService/MetaWrite")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3408,18 +2898,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_MetaWrite_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_MetaDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_MetaDelete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/MetaDelete", runtime.WithHTTPPathPattern("/machine.MachineService/MetaDelete")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/MetaDelete", runtime.WithHTTPPathPattern("/machine.MachineService/MetaDelete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3430,18 +2915,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_MetaDelete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ImageList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ImageList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ImageList", runtime.WithHTTPPathPattern("/machine.MachineService/ImageList")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ImageList", runtime.WithHTTPPathPattern("/machine.MachineService/ImageList")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3452,18 +2932,13 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ImageList_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) - }) - - mux.Handle("POST", pattern_MachineService_ImagePull_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle(http.MethodPost, pattern_MachineService_ImagePull_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ImagePull", runtime.WithHTTPPathPattern("/machine.MachineService/ImagePull")) + annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/machine.MachineService/ImagePull", runtime.WithHTTPPathPattern("/machine.MachineService/ImagePull")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -3474,214 +2949,113 @@ func RegisterMachineServiceHandlerClient(ctx context.Context, mux *runtime.Serve runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MachineService_ImagePull_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - }) - return nil } var ( - pattern_MachineService_ApplyConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ApplyConfiguration"}, "")) - - pattern_MachineService_Bootstrap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Bootstrap"}, "")) - - pattern_MachineService_Containers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Containers"}, "")) - - pattern_MachineService_Copy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Copy"}, "")) - - pattern_MachineService_CPUInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "CPUInfo"}, "")) - - pattern_MachineService_DiskStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "DiskStats"}, "")) - - pattern_MachineService_Dmesg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Dmesg"}, "")) - - pattern_MachineService_Events_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Events"}, "")) - - pattern_MachineService_EtcdMemberList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdMemberList"}, "")) - - pattern_MachineService_EtcdRemoveMemberByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdRemoveMemberByID"}, "")) - - pattern_MachineService_EtcdLeaveCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdLeaveCluster"}, "")) - - pattern_MachineService_EtcdForfeitLeadership_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdForfeitLeadership"}, "")) - - pattern_MachineService_EtcdRecover_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdRecover"}, "")) - - pattern_MachineService_EtcdSnapshot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdSnapshot"}, "")) - - pattern_MachineService_EtcdAlarmList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdAlarmList"}, "")) - - pattern_MachineService_EtcdAlarmDisarm_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdAlarmDisarm"}, "")) - - pattern_MachineService_EtcdDefragment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdDefragment"}, "")) - - pattern_MachineService_EtcdStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdStatus"}, "")) - - pattern_MachineService_GenerateConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "GenerateConfiguration"}, "")) - - pattern_MachineService_Hostname_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Hostname"}, "")) - - pattern_MachineService_Kubeconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Kubeconfig"}, "")) - - pattern_MachineService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "List"}, "")) - - pattern_MachineService_DiskUsage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "DiskUsage"}, "")) - - pattern_MachineService_LoadAvg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "LoadAvg"}, "")) - - pattern_MachineService_Logs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Logs"}, "")) - - pattern_MachineService_Memory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Memory"}, "")) - - pattern_MachineService_Mounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Mounts"}, "")) - - pattern_MachineService_NetworkDeviceStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "NetworkDeviceStats"}, "")) - - pattern_MachineService_Processes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Processes"}, "")) - - pattern_MachineService_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Read"}, "")) - - pattern_MachineService_Reboot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Reboot"}, "")) - - pattern_MachineService_Restart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Restart"}, "")) - - pattern_MachineService_Rollback_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Rollback"}, "")) - - pattern_MachineService_Reset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Reset"}, "")) - - pattern_MachineService_ServiceList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceList"}, "")) - - pattern_MachineService_ServiceRestart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceRestart"}, "")) - - pattern_MachineService_ServiceStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceStart"}, "")) - - pattern_MachineService_ServiceStop_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceStop"}, "")) - - pattern_MachineService_Shutdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Shutdown"}, "")) - - pattern_MachineService_Stats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Stats"}, "")) - - pattern_MachineService_SystemStat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "SystemStat"}, "")) - - pattern_MachineService_Upgrade_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Upgrade"}, "")) - - pattern_MachineService_Version_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Version"}, "")) - + pattern_MachineService_ApplyConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ApplyConfiguration"}, "")) + pattern_MachineService_Bootstrap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Bootstrap"}, "")) + pattern_MachineService_Containers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Containers"}, "")) + pattern_MachineService_Copy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Copy"}, "")) + pattern_MachineService_CPUInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "CPUInfo"}, "")) + pattern_MachineService_DiskStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "DiskStats"}, "")) + pattern_MachineService_Dmesg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Dmesg"}, "")) + pattern_MachineService_Events_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Events"}, "")) + pattern_MachineService_EtcdMemberList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdMemberList"}, "")) + pattern_MachineService_EtcdRemoveMemberByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdRemoveMemberByID"}, "")) + pattern_MachineService_EtcdLeaveCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdLeaveCluster"}, "")) + pattern_MachineService_EtcdForfeitLeadership_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdForfeitLeadership"}, "")) + pattern_MachineService_EtcdRecover_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdRecover"}, "")) + pattern_MachineService_EtcdSnapshot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdSnapshot"}, "")) + pattern_MachineService_EtcdAlarmList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdAlarmList"}, "")) + pattern_MachineService_EtcdAlarmDisarm_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdAlarmDisarm"}, "")) + pattern_MachineService_EtcdDefragment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdDefragment"}, "")) + pattern_MachineService_EtcdStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "EtcdStatus"}, "")) + pattern_MachineService_GenerateConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "GenerateConfiguration"}, "")) + pattern_MachineService_Hostname_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Hostname"}, "")) + pattern_MachineService_Kubeconfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Kubeconfig"}, "")) + pattern_MachineService_List_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "List"}, "")) + pattern_MachineService_DiskUsage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "DiskUsage"}, "")) + pattern_MachineService_LoadAvg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "LoadAvg"}, "")) + pattern_MachineService_Logs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Logs"}, "")) + pattern_MachineService_Memory_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Memory"}, "")) + pattern_MachineService_Mounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Mounts"}, "")) + pattern_MachineService_NetworkDeviceStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "NetworkDeviceStats"}, "")) + pattern_MachineService_Processes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Processes"}, "")) + pattern_MachineService_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Read"}, "")) + pattern_MachineService_Reboot_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Reboot"}, "")) + pattern_MachineService_Restart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Restart"}, "")) + pattern_MachineService_Rollback_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Rollback"}, "")) + pattern_MachineService_Reset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Reset"}, "")) + pattern_MachineService_ServiceList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceList"}, "")) + pattern_MachineService_ServiceRestart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceRestart"}, "")) + pattern_MachineService_ServiceStart_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceStart"}, "")) + pattern_MachineService_ServiceStop_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ServiceStop"}, "")) + pattern_MachineService_Shutdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Shutdown"}, "")) + pattern_MachineService_Stats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Stats"}, "")) + pattern_MachineService_SystemStat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "SystemStat"}, "")) + pattern_MachineService_Upgrade_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Upgrade"}, "")) + pattern_MachineService_Version_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Version"}, "")) pattern_MachineService_GenerateClientConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "GenerateClientConfiguration"}, "")) - - pattern_MachineService_PacketCapture_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "PacketCapture"}, "")) - - pattern_MachineService_Netstat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Netstat"}, "")) - - pattern_MachineService_MetaWrite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "MetaWrite"}, "")) - - pattern_MachineService_MetaDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "MetaDelete"}, "")) - - pattern_MachineService_ImageList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ImageList"}, "")) - - pattern_MachineService_ImagePull_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ImagePull"}, "")) + pattern_MachineService_PacketCapture_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "PacketCapture"}, "")) + pattern_MachineService_Netstat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "Netstat"}, "")) + pattern_MachineService_MetaWrite_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "MetaWrite"}, "")) + pattern_MachineService_MetaDelete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "MetaDelete"}, "")) + pattern_MachineService_ImageList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ImageList"}, "")) + pattern_MachineService_ImagePull_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"machine.MachineService", "ImagePull"}, "")) ) var ( - forward_MachineService_ApplyConfiguration_0 = runtime.ForwardResponseMessage - - forward_MachineService_Bootstrap_0 = runtime.ForwardResponseMessage - - forward_MachineService_Containers_0 = runtime.ForwardResponseMessage - - forward_MachineService_Copy_0 = runtime.ForwardResponseStream - - forward_MachineService_CPUInfo_0 = runtime.ForwardResponseMessage - - forward_MachineService_DiskStats_0 = runtime.ForwardResponseMessage - - forward_MachineService_Dmesg_0 = runtime.ForwardResponseStream - - forward_MachineService_Events_0 = runtime.ForwardResponseStream - - forward_MachineService_EtcdMemberList_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdRemoveMemberByID_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdLeaveCluster_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdForfeitLeadership_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdRecover_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdSnapshot_0 = runtime.ForwardResponseStream - - forward_MachineService_EtcdAlarmList_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdAlarmDisarm_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdDefragment_0 = runtime.ForwardResponseMessage - - forward_MachineService_EtcdStatus_0 = runtime.ForwardResponseMessage - - forward_MachineService_GenerateConfiguration_0 = runtime.ForwardResponseMessage - - forward_MachineService_Hostname_0 = runtime.ForwardResponseMessage - - forward_MachineService_Kubeconfig_0 = runtime.ForwardResponseStream - - forward_MachineService_List_0 = runtime.ForwardResponseStream - - forward_MachineService_DiskUsage_0 = runtime.ForwardResponseStream - - forward_MachineService_LoadAvg_0 = runtime.ForwardResponseMessage - - forward_MachineService_Logs_0 = runtime.ForwardResponseStream - - forward_MachineService_Memory_0 = runtime.ForwardResponseMessage - - forward_MachineService_Mounts_0 = runtime.ForwardResponseMessage - - forward_MachineService_NetworkDeviceStats_0 = runtime.ForwardResponseMessage - - forward_MachineService_Processes_0 = runtime.ForwardResponseMessage - - forward_MachineService_Read_0 = runtime.ForwardResponseStream - - forward_MachineService_Reboot_0 = runtime.ForwardResponseMessage - - forward_MachineService_Restart_0 = runtime.ForwardResponseMessage - - forward_MachineService_Rollback_0 = runtime.ForwardResponseMessage - - forward_MachineService_Reset_0 = runtime.ForwardResponseMessage - - forward_MachineService_ServiceList_0 = runtime.ForwardResponseMessage - - forward_MachineService_ServiceRestart_0 = runtime.ForwardResponseMessage - - forward_MachineService_ServiceStart_0 = runtime.ForwardResponseMessage - - forward_MachineService_ServiceStop_0 = runtime.ForwardResponseMessage - - forward_MachineService_Shutdown_0 = runtime.ForwardResponseMessage - - forward_MachineService_Stats_0 = runtime.ForwardResponseMessage - - forward_MachineService_SystemStat_0 = runtime.ForwardResponseMessage - - forward_MachineService_Upgrade_0 = runtime.ForwardResponseMessage - - forward_MachineService_Version_0 = runtime.ForwardResponseMessage - + forward_MachineService_ApplyConfiguration_0 = runtime.ForwardResponseMessage + forward_MachineService_Bootstrap_0 = runtime.ForwardResponseMessage + forward_MachineService_Containers_0 = runtime.ForwardResponseMessage + forward_MachineService_Copy_0 = runtime.ForwardResponseStream + forward_MachineService_CPUInfo_0 = runtime.ForwardResponseMessage + forward_MachineService_DiskStats_0 = runtime.ForwardResponseMessage + forward_MachineService_Dmesg_0 = runtime.ForwardResponseStream + forward_MachineService_Events_0 = runtime.ForwardResponseStream + forward_MachineService_EtcdMemberList_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdRemoveMemberByID_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdLeaveCluster_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdForfeitLeadership_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdRecover_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdSnapshot_0 = runtime.ForwardResponseStream + forward_MachineService_EtcdAlarmList_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdAlarmDisarm_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdDefragment_0 = runtime.ForwardResponseMessage + forward_MachineService_EtcdStatus_0 = runtime.ForwardResponseMessage + forward_MachineService_GenerateConfiguration_0 = runtime.ForwardResponseMessage + forward_MachineService_Hostname_0 = runtime.ForwardResponseMessage + forward_MachineService_Kubeconfig_0 = runtime.ForwardResponseStream + forward_MachineService_List_0 = runtime.ForwardResponseStream + forward_MachineService_DiskUsage_0 = runtime.ForwardResponseStream + forward_MachineService_LoadAvg_0 = runtime.ForwardResponseMessage + forward_MachineService_Logs_0 = runtime.ForwardResponseStream + forward_MachineService_Memory_0 = runtime.ForwardResponseMessage + forward_MachineService_Mounts_0 = runtime.ForwardResponseMessage + forward_MachineService_NetworkDeviceStats_0 = runtime.ForwardResponseMessage + forward_MachineService_Processes_0 = runtime.ForwardResponseMessage + forward_MachineService_Read_0 = runtime.ForwardResponseStream + forward_MachineService_Reboot_0 = runtime.ForwardResponseMessage + forward_MachineService_Restart_0 = runtime.ForwardResponseMessage + forward_MachineService_Rollback_0 = runtime.ForwardResponseMessage + forward_MachineService_Reset_0 = runtime.ForwardResponseMessage + forward_MachineService_ServiceList_0 = runtime.ForwardResponseMessage + forward_MachineService_ServiceRestart_0 = runtime.ForwardResponseMessage + forward_MachineService_ServiceStart_0 = runtime.ForwardResponseMessage + forward_MachineService_ServiceStop_0 = runtime.ForwardResponseMessage + forward_MachineService_Shutdown_0 = runtime.ForwardResponseMessage + forward_MachineService_Stats_0 = runtime.ForwardResponseMessage + forward_MachineService_SystemStat_0 = runtime.ForwardResponseMessage + forward_MachineService_Upgrade_0 = runtime.ForwardResponseMessage + forward_MachineService_Version_0 = runtime.ForwardResponseMessage forward_MachineService_GenerateClientConfiguration_0 = runtime.ForwardResponseMessage - - forward_MachineService_PacketCapture_0 = runtime.ForwardResponseStream - - forward_MachineService_Netstat_0 = runtime.ForwardResponseMessage - - forward_MachineService_MetaWrite_0 = runtime.ForwardResponseMessage - - forward_MachineService_MetaDelete_0 = runtime.ForwardResponseMessage - - forward_MachineService_ImageList_0 = runtime.ForwardResponseStream - - forward_MachineService_ImagePull_0 = runtime.ForwardResponseMessage + forward_MachineService_PacketCapture_0 = runtime.ForwardResponseStream + forward_MachineService_Netstat_0 = runtime.ForwardResponseMessage + forward_MachineService_MetaWrite_0 = runtime.ForwardResponseMessage + forward_MachineService_MetaDelete_0 = runtime.ForwardResponseMessage + forward_MachineService_ImageList_0 = runtime.ForwardResponseStream + forward_MachineService_ImagePull_0 = runtime.ForwardResponseMessage ) diff --git a/client/go.mod b/client/go.mod index 6b2beca4..9139e44a 100644 --- a/client/go.mod +++ b/client/go.mod @@ -14,7 +14,7 @@ require ( github.com/ProtonMail/gopenpgp/v2 v2.7.5 github.com/adrg/xdg v0.5.3 github.com/blang/semver v3.5.1+incompatible - github.com/cosi-project/runtime v0.7.1 + github.com/cosi-project/runtime v0.7.2 github.com/dustin/go-humanize v1.0.1 github.com/fatih/color v1.18.0 github.com/gertd/go-pluralize v0.2.1 diff --git a/client/go.sum b/client/go.sum index d29abe4d..7913c1ab 100644 --- a/client/go.sum +++ b/client/go.sum @@ -27,8 +27,8 @@ github.com/containerd/go-cni v1.1.10 h1:c2U73nld7spSWfiJwSh/8W9DK+/qQwYM2rngIhCy github.com/containerd/go-cni v1.1.10/go.mod h1:/Y/sL8yqYQn1ZG1om1OncJB1W4zN3YmjfP/ShCzG/OY= github.com/containernetworking/cni v1.2.3 h1:hhOcjNVUQTnzdRJ6alC5XF+wd9mfGIUaj8FuJbEslXM= github.com/containernetworking/cni v1.2.3/go.mod h1:DuLgF+aPd3DzcTQTtp/Nvl1Kim23oFKdm2okJzBQA5M= -github.com/cosi-project/runtime v0.7.1 h1:cOF2/ljLa0NPQV6/S1RZHcSUXM0UyOlD5F3fwwYSQEg= -github.com/cosi-project/runtime v0.7.1/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8= +github.com/cosi-project/runtime v0.7.2 h1:b8/v/YpP75LNYLyP5x0+EdqPWtNn6sfJggGGzkqZ0H4= +github.com/cosi-project/runtime v0.7.2/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= diff --git a/client/pkg/omni/resources/common/common.go b/client/pkg/omni/resources/common/common.go index 2c98bb14..f85f5c39 100644 --- a/client/pkg/omni/resources/common/common.go +++ b/client/pkg/omni/resources/common/common.go @@ -28,4 +28,5 @@ var UserManagedResourceTypes = []resource.Type{ omni.EtcdBackupS3ConfType, omni.ExtensionsConfigurationType, omni.MachineRequestSetType, + omni.InfraMachineConfigType, } diff --git a/client/pkg/omni/resources/infra/infra.go b/client/pkg/omni/resources/infra/infra.go index d704cb64..5f00067e 100644 --- a/client/pkg/omni/resources/infra/infra.go +++ b/client/pkg/omni/resources/infra/infra.go @@ -10,6 +10,9 @@ import "github.com/siderolabs/omni/client/pkg/omni/resources/registry" func init() { registry.MustRegisterResource(MachineRequestType, &MachineRequest{}) registry.MustRegisterResource(MachineRequestStatusType, &MachineRequestStatus{}) + registry.MustRegisterResource(InfraMachineStateType, &MachineState{}) + registry.MustRegisterResource(InfraMachineType, &Machine{}) + registry.MustRegisterResource(InfraMachineStatusType, &MachineStatus{}) registry.MustRegisterResource(InfraProviderStatusType, &ProviderStatus{}) registry.MustRegisterResource(ConfigPatchRequestType, &ConfigPatchRequest{}) } diff --git a/client/pkg/omni/resources/infra/machine.go b/client/pkg/omni/resources/infra/machine.go new file mode 100644 index 00000000..cd28cb82 --- /dev/null +++ b/client/pkg/omni/resources/infra/machine.go @@ -0,0 +1,70 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package infra + +import ( + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/resource/meta" + "github.com/cosi-project/runtime/pkg/resource/protobuf" + "github.com/cosi-project/runtime/pkg/resource/typed" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" +) + +// NewMachine creates a new Machine resource. +func NewMachine(id string) *Machine { + return typed.NewResource[MachineSpec, MachineExtension]( + resource.NewMetadata(resources.InfraProviderNamespace, InfraMachineType, id, resource.VersionUndefined), + protobuf.NewResourceSpec(&specs.InfraMachineSpec{}), + ) +} + +const ( + // InfraMachineType is the type of Machine resource. + // + // tsgen:InfraMachineType + InfraMachineType = resource.Type("InfraMachines.omni.sidero.dev") +) + +// Machine resource describes an infra machine. +type Machine = typed.Resource[MachineSpec, MachineExtension] + +// MachineSpec wraps specs.MachineSpec. +type MachineSpec = protobuf.ResourceSpec[specs.InfraMachineSpec, *specs.InfraMachineSpec] + +// MachineExtension providers auxiliary methods for Machine resource. +type MachineExtension struct{} + +// ResourceDefinition implements [typed.Extension] interface. +func (MachineExtension) ResourceDefinition() meta.ResourceDefinitionSpec { + return meta.ResourceDefinitionSpec{ + Type: InfraMachineType, + Aliases: []resource.Type{}, + DefaultNamespace: resources.InfraProviderNamespace, + PrintColumns: []meta.PrintColumn{ + { + Name: "Preferred Power State", + JSONPath: "{.preferredpowerstate}", + }, + { + Name: "Accepted", + JSONPath: "{.accepted}", + }, + { + Name: "Cluster Talos Version", + JSONPath: "{.clustertalosversion}", + }, + { + Name: "Extensions", + JSONPath: "{.extensions}", + }, + { + Name: "Wipe ID", + JSONPath: "{.wipeid}", + }, + }, + } +} diff --git a/client/pkg/omni/resources/infra/machine_state.go b/client/pkg/omni/resources/infra/machine_state.go new file mode 100644 index 00000000..87bd2ec1 --- /dev/null +++ b/client/pkg/omni/resources/infra/machine_state.go @@ -0,0 +1,56 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package infra + +import ( + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/resource/meta" + "github.com/cosi-project/runtime/pkg/resource/protobuf" + "github.com/cosi-project/runtime/pkg/resource/typed" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" +) + +// NewMachineState creates a new MachineState resource. +func NewMachineState(id string) *MachineState { + return typed.NewResource[MachineStateSpec, MachineStateExtension]( + resource.NewMetadata(resources.InfraProviderNamespace, InfraMachineStateType, id, resource.VersionUndefined), + protobuf.NewResourceSpec(&specs.InfraMachineStateSpec{}), + ) +} + +const ( + // InfraMachineStateType is the type of MachineState resource. + // + // tsgen:InfraMachineStateType + InfraMachineStateType = resource.Type("InfraMachineStates.omni.sidero.dev") +) + +// MachineState resource describes an infra machine state. +// +// It is a shared resource between the respective infra provider and Omni - both can read and write it. +type MachineState = typed.Resource[MachineStateSpec, MachineStateExtension] + +// MachineStateSpec wraps specs.MachineStateSpec. +type MachineStateSpec = protobuf.ResourceSpec[specs.InfraMachineStateSpec, *specs.InfraMachineStateSpec] + +// MachineStateExtension providers auxiliary methods for MachineState resource. +type MachineStateExtension struct{} + +// ResourceDefinition implements [typed.Extension] interface. +func (MachineStateExtension) ResourceDefinition() meta.ResourceDefinitionSpec { + return meta.ResourceDefinitionSpec{ + Type: InfraMachineStateType, + Aliases: []resource.Type{}, + DefaultNamespace: resources.InfraProviderNamespace, + PrintColumns: []meta.PrintColumn{ + { + Name: "Installed", + JSONPath: "{.installed}", + }, + }, + } +} diff --git a/client/pkg/omni/resources/infra/machine_status.go b/client/pkg/omni/resources/infra/machine_status.go new file mode 100644 index 00000000..4d3e70cc --- /dev/null +++ b/client/pkg/omni/resources/infra/machine_status.go @@ -0,0 +1,58 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package infra + +import ( + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/resource/meta" + "github.com/cosi-project/runtime/pkg/resource/protobuf" + "github.com/cosi-project/runtime/pkg/resource/typed" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" +) + +// NewMachineStatus creates a new MachineStatus resource. +func NewMachineStatus(id string) *MachineStatus { + return typed.NewResource[MachineStatusSpec, MachineStatusExtension]( + resource.NewMetadata(resources.InfraProviderNamespace, InfraMachineStatusType, id, resource.VersionUndefined), + protobuf.NewResourceSpec(&specs.InfraMachineStatusSpec{}), + ) +} + +const ( + // InfraMachineStatusType is the type of MachineStatus resource. + // + // tsgen:InfraMachineStatusType + InfraMachineStatusType = resource.Type("InfraMachineStatuses.omni.sidero.dev") +) + +// MachineStatus resource describes an infra machine status. +type MachineStatus = typed.Resource[MachineStatusSpec, MachineStatusExtension] + +// MachineStatusSpec wraps specs.MachineStatusSpec. +type MachineStatusSpec = protobuf.ResourceSpec[specs.InfraMachineStatusSpec, *specs.InfraMachineStatusSpec] + +// MachineStatusExtension providers auxiliary methods for MachineStatus resource. +type MachineStatusExtension struct{} + +// ResourceDefinition implements [typed.Extension] interface. +func (MachineStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec { + return meta.ResourceDefinitionSpec{ + Type: InfraMachineStatusType, + Aliases: []resource.Type{}, + DefaultNamespace: resources.InfraProviderNamespace, + PrintColumns: []meta.PrintColumn{ + { + Name: "Power State", + JSONPath: "{.powerstate}", + }, + { + Name: "Ready to Use", + JSONPath: "{.readytouse}", + }, + }, + } +} diff --git a/client/pkg/omni/resources/omni/infra_machine_config.go b/client/pkg/omni/resources/omni/infra_machine_config.go new file mode 100644 index 00000000..978c0f3f --- /dev/null +++ b/client/pkg/omni/resources/omni/infra_machine_config.go @@ -0,0 +1,58 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +package omni + +import ( + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/resource/meta" + "github.com/cosi-project/runtime/pkg/resource/protobuf" + "github.com/cosi-project/runtime/pkg/resource/typed" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" +) + +// NewInfraMachineConfig creates a new InfraMachineConfig resource. +func NewInfraMachineConfig(ns, id string) *InfraMachineConfig { + return typed.NewResource[InfraMachineConfigSpec, InfraMachineConfigExtension]( + resource.NewMetadata(ns, InfraMachineConfigType, id, resource.VersionUndefined), + protobuf.NewResourceSpec(&specs.InfraMachineConfigSpec{}), + ) +} + +const ( + // InfraMachineConfigType is the type of InfraMachineConfig resource. + // + // tsgen:InfraMachineConfigType + InfraMachineConfigType = resource.Type("InfraMachineConfigs.omni.sidero.dev") +) + +// InfraMachineConfig resource describes a machineConfig request. +type InfraMachineConfig = typed.Resource[InfraMachineConfigSpec, InfraMachineConfigExtension] + +// InfraMachineConfigSpec wraps specs.InfraMachineConfigSpec. +type InfraMachineConfigSpec = protobuf.ResourceSpec[specs.InfraMachineConfigSpec, *specs.InfraMachineConfigSpec] + +// InfraMachineConfigExtension providers auxiliary methods for InfraMachineConfig resource. +type InfraMachineConfigExtension struct{} + +// ResourceDefinition implements [typed.Extension] interface. +func (InfraMachineConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec { + return meta.ResourceDefinitionSpec{ + Type: InfraMachineConfigType, + Aliases: []resource.Type{}, + DefaultNamespace: resources.DefaultNamespace, + PrintColumns: []meta.PrintColumn{ + { + Name: "Power State", + JSONPath: "{.powerstate}", + }, + { + Name: "Accepted", + JSONPath: "{.accepted}", + }, + }, + } +} diff --git a/client/pkg/omni/resources/omni/labels.go b/client/pkg/omni/resources/omni/labels.go index 9240757c..e7393076 100644 --- a/client/pkg/omni/resources/omni/labels.go +++ b/client/pkg/omni/resources/omni/labels.go @@ -57,6 +57,10 @@ const ( // LabelInfraProviderID is the infra provider ID for the resources managed by infra providers, e.g., infra.MachineRequest, infra.MachineRequestStatus. LabelInfraProviderID = SystemLabelPrefix + "infra-provider-id" + // LabelIsStaticInfraProvider is set on the infra.ProviderStatus resources to mark them as static providers - they do not work with MachineRequests to + // allocate and de-allocate machines, but rather work with a static set of machines (e.g., bare-metal machines). + LabelIsStaticInfraProvider = SystemLabelPrefix + "is-static-infra-provider" + // LabelMachineClassName is the name of the machine class. LabelMachineClassName = SystemLabelPrefix + "machine-class-name" @@ -76,6 +80,9 @@ const ( // Setting this label will make MachineSetNode controller ignore such machines for the manual label selectors. // tsgen:LabelNoManualAllocation LabelNoManualAllocation = SystemLabelPrefix + "no-manual-allocation" + + // LabelIsManagedByStaticInfraProvider is set on the machines managed by static infra providers. + LabelIsManagedByStaticInfraProvider = SystemLabelPrefix + "is-managed-by-static-infra-provider" ) const ( diff --git a/client/pkg/omni/resources/omni/omni.go b/client/pkg/omni/resources/omni/omni.go index fa8c8f44..49e24fb9 100644 --- a/client/pkg/omni/resources/omni/omni.go +++ b/client/pkg/omni/resources/omni/omni.go @@ -46,6 +46,7 @@ func init() { registry.MustRegisterResource(FeaturesConfigType, &FeaturesConfig{}) registry.MustRegisterResource(ImagePullRequestType, &ImagePullRequest{}) registry.MustRegisterResource(ImagePullStatusType, &ImagePullStatus{}) + registry.MustRegisterResource(InfraMachineConfigType, &InfraMachineConfig{}) registry.MustRegisterResource(InstallationMediaType, &InstallationMedia{}) registry.MustRegisterResource(ControlPlaneStatusType, &ControlPlaneStatus{}) registry.MustRegisterResource(KubeconfigType, &Kubeconfig{}) diff --git a/cmd/integration-test/pkg/tests/auth.go b/cmd/integration-test/pkg/tests/auth.go index e3661b76..707ea1e4 100644 --- a/cmd/integration-test/pkg/tests/auth.go +++ b/cmd/integration-test/pkg/tests/auth.go @@ -614,6 +614,7 @@ func AssertResourceAuthz(rootCtx context.Context, rootCli *client.Client, client machineSetNode := omni.NewMachineSetNode(resources.DefaultNamespace, uuid.New().String(), machineSet) machineClass := omni.NewMachineClass(resources.DefaultNamespace, uuid.New().String()) machineRequestSet := omni.NewMachineRequestSet(resources.DefaultNamespace, uuid.New().String()) + infraMachineConfig := omni.NewInfraMachineConfig(resources.DefaultNamespace, uuid.New().String()) extensionsConfiguration := omni.NewExtensionsConfiguration(resources.DefaultNamespace, uuid.New().String()) extensionsConfiguration.Metadata().Labels().Set(omni.LabelCluster, cluster.Metadata().ID()) @@ -673,6 +674,10 @@ func AssertResourceAuthz(rootCtx context.Context, rootCli *client.Client, client resource: machineRequestSet, allowedVerbSet: allVerbsSet, }, + { + resource: infraMachineConfig, + allowedVerbSet: allVerbsSet, + }, { resource: omni.NewEtcdManualBackup(uuid.New().String()), allowedVerbSet: allVerbsSet, @@ -1041,6 +1046,9 @@ func AssertResourceAuthz(rootCtx context.Context, rootCli *client.Client, client // infra provider resources have their custom authz logic, they are unit-tested in their package delete(untestedResourceTypes, infra.MachineRequestType) delete(untestedResourceTypes, infra.MachineRequestStatusType) + delete(untestedResourceTypes, infra.InfraMachineStateType) + delete(untestedResourceTypes, infra.InfraMachineType) + delete(untestedResourceTypes, infra.InfraMachineStatusType) delete(untestedResourceTypes, infra.InfraProviderStatusType) delete(untestedResourceTypes, infra.ConfigPatchRequestType) diff --git a/frontend/src/api/omni/specs/infra.pb.ts b/frontend/src/api/omni/specs/infra.pb.ts index 001fcec1..5fbd81fd 100644 --- a/frontend/src/api/omni/specs/infra.pb.ts +++ b/frontend/src/api/omni/specs/infra.pb.ts @@ -13,6 +13,17 @@ export enum MachineRequestStatusSpecStage { FAILED = 3, } +export enum InfraMachineSpecMachinePowerState { + POWER_STATE_OFF = 0, + POWER_STATE_ON = 1, +} + +export enum InfraMachineStatusSpecMachinePowerState { + POWER_STATE_UNKNOWN = 0, + POWER_STATE_OFF = 1, + POWER_STATE_ON = 2, +} + export type MachineRequestSpec = { talos_version?: string overlay?: SpecsOmni.Overlay @@ -30,6 +41,23 @@ export type MachineRequestStatusSpec = { status?: string } +export type InfraMachineSpec = { + preferred_power_state?: InfraMachineSpecMachinePowerState + accepted?: boolean + cluster_talos_version?: string + extensions?: string[] + wipe_id?: string +} + +export type InfraMachineStateSpec = { + installed?: boolean +} + +export type InfraMachineStatusSpec = { + power_state?: InfraMachineStatusSpecMachinePowerState + ready_to_use?: boolean +} + export type InfraProviderStatusSpec = { schema?: string name?: string diff --git a/frontend/src/api/omni/specs/omni.pb.ts b/frontend/src/api/omni/specs/omni.pb.ts index a0b61928..f1b3246d 100644 --- a/frontend/src/api/omni/specs/omni.pb.ts +++ b/frontend/src/api/omni/specs/omni.pb.ts @@ -150,6 +150,12 @@ export enum ClusterMachineRequestStatusSpecStage { FAILED = 5, } +export enum InfraMachineConfigSpecMachinePowerState { + POWER_STATE_DEFAULT = 0, + POWER_STATE_OFF = 1, + POWER_STATE_ON = 2, +} + export type MachineSpec = { management_address?: string connected?: boolean @@ -810,4 +816,9 @@ export type ClusterMachineRequestStatusSpec = { machine_uuid?: string provider_id?: string stage?: ClusterMachineRequestStatusSpecStage +} + +export type InfraMachineConfigSpec = { + power_state?: InfraMachineConfigSpecMachinePowerState + accepted?: boolean } \ No newline at end of file diff --git a/frontend/src/api/resources.ts b/frontend/src/api/resources.ts index 856f6245..71cda1b4 100644 --- a/frontend/src/api/resources.ts +++ b/frontend/src/api/resources.ts @@ -106,6 +106,7 @@ export const FeaturesConfigID = "features-config"; export const FeaturesConfigType = "FeaturesConfigs.omni.sidero.dev"; export const ImagePullRequestType = "ImagePullRequests.omni.sidero.dev"; export const ImagePullStatusType = "ImagePullStatuses.omni.sidero.dev"; +export const InfraMachineConfigType = "InfraMachineConfigs.omni.sidero.dev"; export const InstallationMediaType = "InstallationMedias.omni.sidero.dev"; export const KubernetesStatusType = "KubernetesStatuses.omni.sidero.dev"; export const KubernetesUpgradeManifestStatusType = "KubernetesUpgradeManifestStatuses.omni.sidero.dev"; @@ -182,8 +183,11 @@ export const PublicKeyType = "PublicKeys.omni.sidero.dev"; export const SAMLLabelRuleType = "SAMLLabelRules.omni.sidero.dev"; export const UserType = "Users.omni.sidero.dev"; export const ConfigPatchRequestType = "ConfigPatchRequests.omni.sidero.dev"; +export const InfraMachineType = "InfraMachines.omni.sidero.dev"; export const MachineRequestType = "MachineRequests.omni.sidero.dev"; export const MachineRequestStatusType = "MachineRequestStatuses.omni.sidero.dev"; +export const InfraMachineStateType = "InfraMachineStates.omni.sidero.dev"; +export const InfraMachineStatusType = "InfraMachineStatuses.omni.sidero.dev"; export const InfraProviderStatusType = "InfraProviderStatuses.omni.sidero.dev"; export const KubernetesResourceType = "KubernetesResources.omni.sidero.dev"; export const ConfigType = "Configs.omni.sidero.dev"; diff --git a/go.mod b/go.mod index fe1d7fd1..59d4cb8b 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/blang/semver/v4 v4.0.0 github.com/containers/image/v5 v5.32.2 - github.com/cosi-project/runtime v0.7.1 + github.com/cosi-project/runtime v0.7.2 github.com/cosi-project/state-etcd v0.4.0 github.com/crewjam/saml v0.4.14 github.com/dustin/go-humanize v1.0.1 diff --git a/go.sum b/go.sum index 5ccd2548..026b6c31 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosi-project/runtime v0.7.1 h1:cOF2/ljLa0NPQV6/S1RZHcSUXM0UyOlD5F3fwwYSQEg= -github.com/cosi-project/runtime v0.7.1/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8= +github.com/cosi-project/runtime v0.7.2 h1:b8/v/YpP75LNYLyP5x0+EdqPWtNn6sfJggGGzkqZ0H4= +github.com/cosi-project/runtime v0.7.2/go.mod h1:EMLs8a55tJ6zA4UyDbRsTvXBd6UIlNwZfCVGvCyiXK8= github.com/cosi-project/state-etcd v0.4.0 h1:/zf2mbqVHnp32wWDBaFGa5U1+ZwyenBzeZOgrxmNzhY= github.com/cosi-project/state-etcd v0.4.0/go.mod h1:V3UiPxXs2Nl3kls8TSnk7ABKx68fCjNZDTu2Ux9CGK8= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status.go b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status.go index 290d0ce8..358de7d4 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status.go @@ -33,6 +33,7 @@ import ( "github.com/siderolabs/omni/client/api/omni/specs" "github.com/siderolabs/omni/client/pkg/meta" "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" "github.com/siderolabs/omni/client/pkg/omni/resources/omni" "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/helpers" @@ -112,6 +113,28 @@ func NewClusterMachineConfigStatusController(imageFactoryHost string) *ClusterMa return xerrors.NewTagged[qtransform.SkipReconcileTag](fmt.Errorf("machine status '%s' does not have schematic information", machineConfig.Metadata().ID())) } + // if the machine is managed by a static infra provider, we need to ensure that the infra machine is ready to use + if _, isManagedByStaticInfraProvider := machineStatus.Metadata().Labels().Get(omni.LabelIsManagedByStaticInfraProvider); isManagedByStaticInfraProvider { + var infraMachineStatus *infra.MachineStatus + + infraMachineStatus, err = safe.ReaderGetByID[*infra.MachineStatus](ctx, r, machineStatus.Metadata().ID()) + if err != nil { + if state.IsNotFoundError(err) { + logger.Debug("machine is managed by a static infra provider but the infra machine status is not found, skip reconcile") + + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]("machine is managed by a static infra provider but the infra machine status is not found: %w", err) + } + + return fmt.Errorf("failed to get infra machine status '%s': %w", machineStatus.Metadata().ID(), err) + } + + if !infraMachineStatus.TypedSpec().Value.ReadyToUse { + logger.Debug("machine is managed by a static infra provider but is not ready to use, skip reconcile") + + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]("machine is managed by static infra provider but is not ready to use") + } + } + genOptions, err := safe.ReaderGet[*omni.MachineConfigGenOptions](ctx, r, omni.NewMachineConfigGenOptions(resources.DefaultNamespace, machineConfig.Metadata().ID()).Metadata()) if err != nil { if state.IsNotFoundError(err) { @@ -241,6 +264,11 @@ func NewClusterMachineConfigStatusController(imageFactoryHost string) *ClusterMa qtransform.WithExtraMappedInput( qtransform.MapperSameID[*omni.Machine, *omni.ClusterMachineConfig](), ), + qtransform.WithExtraMappedInput( + func(_ context.Context, _ *zap.Logger, _ controller.QRuntime, infraMachineStatus *infra.MachineStatus) ([]resource.Pointer, error) { + return []resource.Pointer{omni.NewClusterMachineConfig(resources.DefaultNamespace, infraMachineStatus.Metadata().ID()).Metadata()}, nil + }, + ), qtransform.WithExtraMappedInput( mappers.MapClusterResourceToLabeledResources[*omni.TalosConfig, *omni.ClusterMachineConfig](), ), diff --git a/internal/backend/runtime/omni/controllers/omni/infra_machine.go b/internal/backend/runtime/omni/controllers/omni/infra_machine.go new file mode 100644 index 00000000..edde7968 --- /dev/null +++ b/internal/backend/runtime/omni/controllers/omni/infra_machine.go @@ -0,0 +1,210 @@ +// Copyright (c) 2024 Sidero Labs, Inc. +// +// Use of this software is governed by the Business Source License +// included in the LICENSE file. + +package omni + +import ( + "context" + "fmt" + "slices" + + "github.com/cosi-project/runtime/pkg/controller" + "github.com/cosi-project/runtime/pkg/controller/generic/qtransform" + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/safe" + "github.com/cosi-project/runtime/pkg/state" + "github.com/google/uuid" + "github.com/siderolabs/gen/xerrors" + "github.com/siderolabs/gen/xiter" + "go.uber.org/zap" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" +) + +// InfraMachineControllerName is the name of the controller. +const InfraMachineControllerName = "InfraMachineController" + +// InfraMachineController manages InfraMachine resource lifecycle. +// +// InfraMachineController transforms an Omni Machine managed by a static infra provider to an infra.Machine, applying the user overrides in omni.InfraMachineConfig resource if present. +type InfraMachineController = qtransform.QController[*siderolink.Link, *infra.Machine] + +// NewInfraMachineController initializes InfraMachineController. +func NewInfraMachineController() *InfraMachineController { + helper := &infraMachineControllerHelper{} + + return qtransform.NewQController( + qtransform.Settings[*siderolink.Link, *infra.Machine]{ + Name: InfraMachineControllerName, + MapMetadataFunc: func(link *siderolink.Link) *infra.Machine { + return infra.NewMachine(link.Metadata().ID()) + }, + UnmapMetadataFunc: func(infraMachine *infra.Machine) *siderolink.Link { + return siderolink.NewLink(resources.DefaultNamespace, infraMachine.Metadata().ID(), nil) + }, + TransformExtraOutputFunc: helper.transformExtraOutput, + FinalizerRemovalExtraOutputFunc: helper.finalizerRemovalExtraOutput, + }, + qtransform.WithExtraMappedInput( + qtransform.MapperSameID[*omni.InfraMachineConfig, *siderolink.Link](), + ), + qtransform.WithExtraMappedInput( + qtransform.MapperSameID[*omni.SchematicConfiguration, *siderolink.Link](), + ), + qtransform.WithExtraMappedInput( + qtransform.MapperSameID[*omni.MachineExtensions, *siderolink.Link](), + ), + qtransform.WithExtraMappedInput( + qtransform.MapperSameID[*omni.ClusterMachine, *siderolink.Link](), + ), + qtransform.WithExtraMappedInput( + func(ctx context.Context, _ *zap.Logger, runtime controller.QRuntime, res *infra.ProviderStatus) ([]resource.Pointer, error) { + linkList, err := safe.ReaderListAll[*siderolink.Link](ctx, runtime, state.WithLabelQuery(resource.LabelEqual(omni.LabelInfraProviderID, res.Metadata().ID()))) + if err != nil { + return nil, err + } + + ptrSeq := xiter.Map(func(in *siderolink.Link) resource.Pointer { + return in.Metadata() + }, linkList.All()) + + return slices.Collect(ptrSeq), nil + }, + ), + ) +} + +type infraMachineControllerHelper struct{} + +func (h *infraMachineControllerHelper) transformExtraOutput(ctx context.Context, r controller.ReaderWriter, _ *zap.Logger, link *siderolink.Link, infraMachine *infra.Machine) error { + providerID, ok := link.Metadata().Annotations().Get(omni.LabelInfraProviderID) + if !ok { + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]("the link is not created by an infra provider") + } + + providerStatus, err := safe.ReaderGetByID[*infra.ProviderStatus](ctx, r, providerID) + if err != nil { + return err + } + + if _, isStaticProvider := providerStatus.Metadata().Labels().Get(omni.LabelIsStaticInfraProvider); !isStaticProvider { + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]("the link is not created by a static infra provider") + } + + if err = h.applyInfraMachineConfig(ctx, r, link, infraMachine); err != nil { + return err + } + + infraMachine.Metadata().Labels().Set(omni.LabelInfraProviderID, providerID) + + clusterMachine, err := safe.ReaderGetByID[*omni.ClusterMachine](ctx, r, link.Metadata().ID()) + if err != nil { + if state.IsNotFoundError(err) { + return nil + } + + return err + } + + // the machine is deallocated, clear the cluster information and mark it for wipe by assigning it a new wipe ID + if clusterMachine.Metadata().Phase() == resource.PhaseTearingDown { + infraMachine.TypedSpec().Value.ClusterTalosVersion = "" + infraMachine.TypedSpec().Value.Extensions = nil + infraMachine.TypedSpec().Value.WipeId = uuid.NewString() + + if err = r.RemoveFinalizer(ctx, clusterMachine.Metadata(), InfraMachineControllerName); err != nil { + return err + } + + return nil + } + + if err = r.AddFinalizer(ctx, clusterMachine.Metadata(), InfraMachineControllerName); err != nil { + return err + } + + talosVersion, extensions, err := h.getClusterInfo(ctx, r, link.Metadata().ID()) + if err != nil { + return err + } + + // set the cluster allocation information + + infraMachine.TypedSpec().Value.ClusterTalosVersion = talosVersion + infraMachine.TypedSpec().Value.Extensions = extensions + + return nil +} + +func (h *infraMachineControllerHelper) finalizerRemovalExtraOutput(ctx context.Context, r controller.ReaderWriter, _ *zap.Logger, link *siderolink.Link) error { + clusterMachine, err := safe.ReaderGetByID[*omni.ClusterMachine](ctx, r, link.Metadata().ID()) + if err != nil { + if state.IsNotFoundError(err) { + return nil + } + + return err + } + + if err = r.RemoveFinalizer(ctx, clusterMachine.Metadata(), InfraMachineControllerName); err != nil { + return err + } + + return nil +} + +// applyInfraMachineConfig applies the user-managed configuration from the omni.InfraMachineConfig resource into the infra.Machine. +func (h *infraMachineControllerHelper) applyInfraMachineConfig(ctx context.Context, r controller.Reader, link *siderolink.Link, infraMachine *infra.Machine) error { + config, err := safe.ReaderGetByID[*omni.InfraMachineConfig](ctx, r, link.Metadata().ID()) + if err != nil && !state.IsNotFoundError(err) { + return err + } + + if config != nil { // apply user configuration: acceptance, preferred power state + infraMachine.TypedSpec().Value.Accepted = config.TypedSpec().Value.Accepted + + switch config.TypedSpec().Value.PowerState { + case specs.InfraMachineConfigSpec_POWER_STATE_OFF: + infraMachine.TypedSpec().Value.PreferredPowerState = specs.InfraMachineSpec_POWER_STATE_OFF + case specs.InfraMachineConfigSpec_POWER_STATE_ON: + infraMachine.TypedSpec().Value.PreferredPowerState = specs.InfraMachineSpec_POWER_STATE_ON + case specs.InfraMachineConfigSpec_POWER_STATE_DEFAULT: // todo: introduce a resource to configure this globally or per-provider level + infraMachine.TypedSpec().Value.PreferredPowerState = specs.InfraMachineSpec_POWER_STATE_OFF + default: + return fmt.Errorf("unknown power state: %v", config.TypedSpec().Value.PowerState.String()) + } + } + + return nil +} + +// getClusterInfo returns the Talos version and extensions for the given machine. +// +// At this point, the machine is known to be associated with a cluster. +func (h *infraMachineControllerHelper) getClusterInfo(ctx context.Context, r controller.Reader, id resource.ID) (string, []string, error) { + schematicConfig, err := safe.ReaderGetByID[*omni.SchematicConfiguration](ctx, r, id) + if err != nil { + if state.IsNotFoundError(err) { + return "", nil, xerrors.NewTaggedf[qtransform.SkipReconcileTag]("schema configuration is not created yet") + } + + return "", nil, err + } + + machineExts, err := safe.ReaderGetByID[*omni.MachineExtensions](ctx, r, schematicConfig.Metadata().ID()) + if err != nil { + if state.IsNotFoundError(err) { // no extensions + return schematicConfig.TypedSpec().Value.TalosVersion, nil, nil + } + + return "", nil, err + } + + return schematicConfig.TypedSpec().Value.TalosVersion, machineExts.TypedSpec().Value.Extensions, nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/infra_machine_test.go b/internal/backend/runtime/omni/controllers/omni/infra_machine_test.go new file mode 100644 index 00000000..74a61599 --- /dev/null +++ b/internal/backend/runtime/omni/controllers/omni/infra_machine_test.go @@ -0,0 +1,141 @@ +// Copyright (c) 2024 Sidero Labs, Inc. +// +// Use of this software is governed by the Business Source License +// included in the LICENSE file. + +package omni_test + +import ( + "testing" + + "github.com/cosi-project/runtime/pkg/resource/rtestutils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + + "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" + omnictrl "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni" +) + +type InfraMachineControllerSuite struct { + OmniSuite +} + +func (suite *InfraMachineControllerSuite) TestReconcile() { + suite.startRuntime() + + suite.Require().NoError(suite.runtime.RegisterQController(omnictrl.NewInfraMachineController())) + + providerStatus := infra.NewProviderStatus("bare-metal") + + providerStatus.Metadata().Labels().Set(omni.LabelIsStaticInfraProvider, "") + suite.Require().NoError(suite.state.Create(suite.ctx, providerStatus)) + + link := siderolink.NewLink(resources.DefaultNamespace, "machine-1", nil) + + link.Metadata().Annotations().Set(omni.LabelInfraProviderID, "bare-metal") + suite.Require().NoError(suite.state.Create(suite.ctx, link)) + + infraMachine := infra.NewMachine("machine-1") + infraMachineMD := infraMachine.Metadata() + + assertResource[*infra.Machine](&suite.OmniSuite, infraMachineMD, func(r *infra.Machine, assertion *assert.Assertions) { + infraProviderID, ok := r.Metadata().Labels().Get(omni.LabelInfraProviderID) + assertion.True(ok) + assertion.Equal("bare-metal", infraProviderID) + + assertion.Equal(specs.InfraMachineSpec_POWER_STATE_OFF, r.TypedSpec().Value.PreferredPowerState) + assertion.False(r.TypedSpec().Value.Accepted) + assertion.Empty(r.TypedSpec().Value.ClusterTalosVersion) + assertion.Empty(r.TypedSpec().Value.Extensions) + assertion.Empty(r.TypedSpec().Value.WipeId) + }) + + // accept the machine, set its preferred power state to on + config := omni.NewInfraMachineConfig(resources.DefaultNamespace, "machine-1") + config.TypedSpec().Value.Accepted = true + config.TypedSpec().Value.PowerState = specs.InfraMachineConfigSpec_POWER_STATE_ON + + suite.Require().NoError(suite.state.Create(suite.ctx, config)) + + assertResource[*infra.Machine](&suite.OmniSuite, infraMachineMD, func(r *infra.Machine, assertion *assert.Assertions) { + assertion.True(r.TypedSpec().Value.Accepted) + assertion.Equal(specs.InfraMachineSpec_POWER_STATE_ON, r.TypedSpec().Value.PreferredPowerState) + }) + + // allocate the machine to a cluster + clusterMachine := omni.NewClusterMachine(resources.DefaultNamespace, "machine-1") + + suite.Require().NoError(suite.state.Create(suite.ctx, clusterMachine)) + + // assert that the finalizer is added + assertResource[*omni.ClusterMachine](&suite.OmniSuite, clusterMachine.Metadata(), func(r *omni.ClusterMachine, assertion *assert.Assertions) { + assertion.True(r.Metadata().Finalizers().Has(omnictrl.InfraMachineControllerName)) + }) + + // create schematic configuration + schematicConfig := omni.NewSchematicConfiguration(resources.DefaultNamespace, "machine-1") + + schematicConfig.TypedSpec().Value.TalosVersion = "v42.0.0" + + suite.Require().NoError(suite.state.Create(suite.ctx, schematicConfig)) + + // assert that the cluster machine has the correct talos version + assertResource[*infra.Machine](&suite.OmniSuite, clusterMachine.Metadata(), func(r *infra.Machine, assertion *assert.Assertions) { + assertion.Equal("v42.0.0", r.TypedSpec().Value.ClusterTalosVersion) + }) + + // add some extensions + extensions := omni.NewMachineExtensions(resources.DefaultNamespace, "machine-1") + + extensions.TypedSpec().Value.Extensions = []string{"foo", "bar"} + + suite.Require().NoError(suite.state.Create(suite.ctx, extensions)) + + // assert that the cluster machine has the correct extensions + assertResource[*infra.Machine](&suite.OmniSuite, clusterMachine.Metadata(), func(r *infra.Machine, assertion *assert.Assertions) { + assertion.ElementsMatch([]string{"foo", "bar"}, r.TypedSpec().Value.Extensions) + }) + + // deallocate the machine from the cluster + rtestutils.Destroy[*omni.ClusterMachine](suite.ctx, suite.T(), suite.state, []string{clusterMachine.Metadata().ID()}) + + // assert that the finalizer is removed, cluster related fields are cleared, and a new wipe ID is generated + assertResource[*infra.Machine](&suite.OmniSuite, infraMachineMD, func(r *infra.Machine, assertion *assert.Assertions) { + assertion.False(r.Metadata().Finalizers().Has(omnictrl.InfraMachineControllerName)) + + assertion.Empty(r.TypedSpec().Value.ClusterTalosVersion) + assertion.Empty(r.TypedSpec().Value.Extensions) + assertion.NotEmpty(r.TypedSpec().Value.WipeId) + }) + + // test finalizer removal + + // reallocate the machine to a cluster + suite.Require().NoError(suite.state.Create(suite.ctx, clusterMachine)) + + // assert that the finalizer is added + assertResource[*omni.ClusterMachine](&suite.OmniSuite, clusterMachine.Metadata(), func(r *omni.ClusterMachine, assertion *assert.Assertions) { + assertion.True(r.Metadata().Finalizers().Has(omnictrl.InfraMachineControllerName)) + }) + + // destroy the link + rtestutils.Destroy[*siderolink.Link](suite.ctx, suite.T(), suite.state, []string{link.Metadata().ID()}) + + // assert that the finalizer is removed + assertResource[*omni.ClusterMachine](&suite.OmniSuite, infraMachineMD, func(r *omni.ClusterMachine, assertion *assert.Assertions) { + assertion.False(r.Metadata().Finalizers().Has(omnictrl.InfraMachineControllerName)) + }) + + // assert that infra.Machine is removed + assertNoResource[*infra.Machine](&suite.OmniSuite, infraMachine) +} + +func TestInfraMachineControllerSuite(t *testing.T) { + t.Parallel() + + suite.Run(t, new(InfraMachineControllerSuite)) +} diff --git a/internal/backend/runtime/omni/controllers/omni/machine.go b/internal/backend/runtime/omni/controllers/omni/machine.go index e86626a9..3b127fdb 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine.go +++ b/internal/backend/runtime/omni/controllers/omni/machine.go @@ -11,12 +11,14 @@ import ( "github.com/cosi-project/runtime/pkg/controller" "github.com/cosi-project/runtime/pkg/controller/generic/qtransform" + "github.com/cosi-project/runtime/pkg/resource" "github.com/cosi-project/runtime/pkg/safe" "github.com/cosi-project/runtime/pkg/state" "github.com/siderolabs/gen/xerrors" "go.uber.org/zap" "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" "github.com/siderolabs/omni/client/pkg/omni/resources/omni" "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/helpers" @@ -27,8 +29,10 @@ import ( // MachineController plays the role of machine discovery. type MachineController = qtransform.QController[*siderolink.Link, *omni.Machine] -// NewMachineController instanciates the machine controller. +// NewMachineController instantiates the machine controller. func NewMachineController() *MachineController { + helper := &machineControllerHelper{} + return qtransform.NewQController( qtransform.Settings[*siderolink.Link, *omni.Machine]{ Name: "MachineController", @@ -38,57 +42,116 @@ func NewMachineController() *MachineController { UnmapMetadataFunc: func(machine *omni.Machine) *siderolink.Link { return siderolink.NewLink(resources.DefaultNamespace, machine.Metadata().ID(), nil) }, - TransformFunc: func(ctx context.Context, r controller.Reader, _ *zap.Logger, link *siderolink.Link, machine *omni.Machine) error { - var machineRequestSetID string - - if _, ok := link.Metadata().Annotations().Get(omni.LabelInfraProviderID); ok { - _, ok = link.Metadata().Labels().Get(omni.LabelMachineRequest) - if !ok { - return xerrors.NewTaggedf[qtransform.SkipReconcileTag]( - "the link is created by the infra provider, but doesn't have the machine request label yet", - ) - } - - machineRequestSetID, ok = link.Metadata().Labels().Get(omni.LabelMachineRequestSet) - if !ok { - return xerrors.NewTaggedf[qtransform.SkipReconcileTag]( - "the link is created by the infra provider, but doesn't have the machine request label yet", - ) - } - } - - // convert SideroLink subnet to an IP address - ipPrefix, err := netip.ParsePrefix(link.TypedSpec().Value.NodeSubnet) - if err != nil { - return err - } - - helpers.CopyLabels(link, machine, omni.LabelMachineRequest, omni.LabelMachineRequestSet) - - if machineRequestSetID != "" { - machineRequestSet, err := safe.ReaderGetByID[*omni.MachineRequestSet](ctx, r, machineRequestSetID) - if err != nil && !state.IsNotFoundError(err) { - return err - } - - if machineRequestSet != nil && machineRequestSet.Metadata().Owner() == machineProvisionControllerName { - machine.Metadata().Labels().Set(omni.LabelNoManualAllocation, "") - } - } - - spec := machine.TypedSpec().Value - - spec.ManagementAddress = ipPrefix.Addr().String() - spec.Connected = link.TypedSpec().Value.Connected - - machine.Metadata().Labels().Set(omni.MachineAddressLabel, spec.ManagementAddress) - - return nil - }, + TransformFunc: helper.transform, }, qtransform.WithExtraMappedInput( qtransform.MapperNone[*omni.MachineRequestSet](), ), + qtransform.WithExtraMappedInput( + qtransform.MapperNone[*infra.ProviderStatus](), + ), + qtransform.WithExtraMappedInput( + func(_ context.Context, _ *zap.Logger, _ controller.QRuntime, infraMachine *infra.Machine) ([]resource.Pointer, error) { + ptr := siderolink.NewLink(resources.DefaultNamespace, infraMachine.Metadata().ID(), nil).Metadata() + + return []resource.Pointer{ptr}, nil + }, + ), qtransform.WithConcurrency(4), ) } + +type machineControllerHelper struct{} + +func (h *machineControllerHelper) transform(ctx context.Context, r controller.Reader, _ *zap.Logger, link *siderolink.Link, machine *omni.Machine) error { + if err := h.handleInfraProvider(ctx, r, link, machine); err != nil { + return err + } + + // convert SideroLink subnet to an IP address + ipPrefix, err := netip.ParsePrefix(link.TypedSpec().Value.NodeSubnet) + if err != nil { + return err + } + + helpers.CopyLabels(link, machine, omni.LabelMachineRequest, omni.LabelMachineRequestSet) + + spec := machine.TypedSpec().Value + + spec.ManagementAddress = ipPrefix.Addr().String() + spec.Connected = link.TypedSpec().Value.Connected + + machine.Metadata().Labels().Set(omni.MachineAddressLabel, spec.ManagementAddress) + + return nil +} + +// handleInfraProvider checks if the link has an infra provider ID annotation, and if so, runs the infra provider handling logic - static or provisioning (regular). +func (h *machineControllerHelper) handleInfraProvider(ctx context.Context, r controller.Reader, link *siderolink.Link, machine *omni.Machine) error { + infraProviderID, ok := link.Metadata().Annotations().Get(omni.LabelInfraProviderID) + if !ok { // not created by an infra provider, skip + return nil + } + + providerStatus, err := safe.ReaderGetByID[*infra.ProviderStatus](ctx, r, infraProviderID) + if err != nil { + return err + } + + if _, isStaticProvider := providerStatus.Metadata().Labels().Get(omni.LabelIsStaticInfraProvider); isStaticProvider { // static infra provider flow, e.g., bare-metal + return h.handleStaticInfraProvider(ctx, r, machine) + } + + // provisioning (regular) infra provider flow, e.g., kubevirt + return h.handleProvisioningInfraProvider(ctx, r, link, machine) +} + +// handleStaticInfraProvider checks if the machine managed by a static infra provider was accepted by the user. +func (h *machineControllerHelper) handleStaticInfraProvider(ctx context.Context, r controller.Reader, machine *omni.Machine) error { + machine.Metadata().Labels().Set(omni.LabelIsManagedByStaticInfraProvider, "") + + infraMachine, err := safe.ReaderGetByID[*infra.Machine](ctx, r, machine.Metadata().ID()) + if err != nil && !state.IsNotFoundError(err) { + return err + } + + accepted := infraMachine != nil && infraMachine.TypedSpec().Value.Accepted + + if !accepted { + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]( + "the link is created by a static infra provider, but the machine is not yet accepted", + ) + } + + return nil +} + +// handleProvisioningInfraProvider checks if the machine managed by a provisioning infra provider has the machine request and machine request set labels set. +// +// It then matches the machine request set owner to the machine provision controller, and if it matches, sets the no manual allocation label on the machine. +func (h *machineControllerHelper) handleProvisioningInfraProvider(ctx context.Context, r controller.Reader, link *siderolink.Link, machine *omni.Machine) error { + _, ok := link.Metadata().Labels().Get(omni.LabelMachineRequest) + if !ok { + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]( + "the link is created by the infra provider, but doesn't have the machine request label yet", + ) + } + + machineRequestSetID, ok := link.Metadata().Labels().Get(omni.LabelMachineRequestSet) + if !ok { + return xerrors.NewTaggedf[qtransform.SkipReconcileTag]( + "the link is created by the infra provider, but doesn't have the machine request set label yet", + ) + } + + machineRequestSet, err := safe.ReaderGetByID[*omni.MachineRequestSet](ctx, r, machineRequestSetID) + if err != nil && !state.IsNotFoundError(err) { + return err + } + + if machineRequestSet != nil && machineRequestSet.Metadata().Owner() == machineProvisionControllerName { + machine.Metadata().Labels().Set(omni.LabelNoManualAllocation, "") + } + + return nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status.go b/internal/backend/runtime/omni/controllers/omni/machine_status.go index e62a46ba..ac7dd6cd 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_status.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_status.go @@ -249,7 +249,7 @@ func (ctrl *MachineStatusController) reconcileRunning(ctx context.Context, r con spec.Connected = connected - helpers.CopyLabels(machine, m, omni.LabelMachineRequest, omni.LabelMachineRequestSet, omni.LabelNoManualAllocation) + helpers.CopyLabels(machine, m, omni.LabelMachineRequest, omni.LabelMachineRequestSet, omni.LabelNoManualAllocation, omni.LabelIsManagedByStaticInfraProvider) if connected { m.Metadata().Labels().Set(omni.MachineStatusLabelConnected, "") diff --git a/internal/backend/runtime/omni/export_test.go b/internal/backend/runtime/omni/export_test.go index cdbfa78d..b1964cec 100644 --- a/internal/backend/runtime/omni/export_test.go +++ b/internal/backend/runtime/omni/export_test.go @@ -81,3 +81,7 @@ func SchematicConfigurationValidationOptions() []validated.StateOption { func MachineRequestSetValidationOptions(st state.State) []validated.StateOption { return machineRequestSetValidationOptions(st) } + +func InfraMachineConfigValidationOptions(st state.State) []validated.StateOption { + return infraMachineConfigValidationOptions(st) +} diff --git a/internal/backend/runtime/omni/infraprovider/state.go b/internal/backend/runtime/omni/infraprovider/state.go index a0439752..002740f0 100644 --- a/internal/backend/runtime/omni/infraprovider/state.go +++ b/internal/backend/runtime/omni/infraprovider/state.go @@ -108,8 +108,11 @@ func (st *State) Create(ctx context.Context, resource resource.Resource, option return err } - if infraProviderID != "" && resource.Metadata().Type() == infra.MachineRequestType { - return status.Errorf(codes.PermissionDenied, "infra providers are not allowed to create machine requests") + if infraProviderID != "" { + switch resource.Metadata().Type() { + case infra.MachineRequestType, infra.InfraMachineType: + return status.Errorf(codes.PermissionDenied, "infra providers are not allowed to create %q resources", resource.Metadata().Type()) + } } if infraProviderID == "" { @@ -137,7 +140,8 @@ func (st *State) Update(ctx context.Context, newResource resource.Resource, opts return st.innerState.Update(ctx, newResource, opts...) } - if newResource.Metadata().Type() == infra.MachineRequestType { + switch newResource.Metadata().Type() { + case infra.MachineRequestType, infra.InfraMachineType: oldMd := oldResource.Metadata().Copy() oldMd.Finalizers().Set(resource.Finalizers{}) @@ -145,7 +149,7 @@ func (st *State) Update(ctx context.Context, newResource resource.Resource, opts newMd.Finalizers().Set(resource.Finalizers{}) if !oldMd.Equal(newMd) { - return status.Errorf(codes.PermissionDenied, "infra providers are not allowed to update machine requests other than setting finalizers") + return status.Errorf(codes.PermissionDenied, "infra providers are not allowed to update %q resources other than setting finalizers", newResource.Metadata().Type()) } } diff --git a/internal/backend/runtime/omni/infraprovider/state_test.go b/internal/backend/runtime/omni/infraprovider/state_test.go index aa607a6a..441cd1d5 100644 --- a/internal/backend/runtime/omni/infraprovider/state_test.go +++ b/internal/backend/runtime/omni/infraprovider/state_test.go @@ -7,6 +7,7 @@ package infraprovider_test import ( "context" + "fmt" "testing" "time" @@ -38,7 +39,6 @@ import ( const ( infraProviderID = "qemu-1" talosVersion = "v1.2.3" - schematicID = "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" infraProviderResNamespace = resources.InfraProviderSpecificNamespacePrefix + infraProviderID ) @@ -58,66 +58,47 @@ func TestInfraProviderAccess(t *testing.T) { mr := infra.NewMachineRequest("test-mr") - // create - err := st.Create(ctx, mr) - assert.ErrorContains(t, err, "infra providers are not allowed to create machine requests") - - // prepare for update - mr.Metadata().Labels().Set(omni.LabelInfraProviderID, infraProviderID) - - mr.TypedSpec().Value.TalosVersion = talosVersion - - require.NoError(t, innerSt.Create(ctx, mr)) - - // update spec - _, err = safe.StateUpdateWithConflicts(ctx, st, mr.Metadata(), func(res *infra.MachineRequest) error { + testInfraProviderAccessInputResource(ctx, t, st, innerSt, mr, func(res *infra.MachineRequest) { + res.TypedSpec().Value.TalosVersion = talosVersion + }, func(res *infra.MachineRequest) error { res.TypedSpec().Value.TalosVersion = "v1.2.4" return nil + }, func(t *testing.T, err error) { + assert.True(t, validated.IsValidationError(err)) + assert.ErrorContains(t, err, "machine request spec is immutable") }) - assert.True(t, validated.IsValidationError(err)) - assert.ErrorContains(t, err, "machine request spec is immutable") - // update metadata labels - _, err = safe.StateUpdateWithConflicts(ctx, st, mr.Metadata(), func(res *infra.MachineRequest) error { - res.Metadata().Labels().Set("foo", "bar") + // InfraMachine - return nil - }) - assert.ErrorContains(t, err, "infra providers are not allowed to update machine requests other than setting finalizers") + infraMachine := infra.NewMachine("test-im") - // update metadata - add finalizer - _, err = safe.StateUpdateWithConflicts(ctx, st, mr.Metadata(), func(res *infra.MachineRequest) error { - res.Metadata().Finalizers().Add("foobar") + testInfraProviderAccessInputResource(ctx, t, st, innerSt, infraMachine, func(res *infra.Machine) { + res.TypedSpec().Value.PreferredPowerState = specs.InfraMachineSpec_POWER_STATE_ON + }, func(res *infra.Machine) error { + res.TypedSpec().Value.PreferredPowerState = specs.InfraMachineSpec_POWER_STATE_OFF return nil + }, func(t *testing.T, err error) { + require.NoError(t, err) }) - assert.NoError(t, err) // MachineRequestStatus - mrs := infra.NewMachineRequestStatus("test-mrs") - - // create - assert.NoError(t, st.Create(ctx, mrs)) - - // assert that the label is set - res, err := innerSt.Get(ctx, mrs.Metadata()) - require.NoError(t, err) + testInfraProviderAccessOutputResource(ctx, t, st, innerSt, infra.NewMachineRequestStatus("test-mrs"), func(res *infra.MachineRequestStatus) error { + res.TypedSpec().Value.Id = "12345" + res.TypedSpec().Value.Stage = specs.MachineRequestStatusSpec_PROVISIONING - cpID, _ := res.Metadata().Labels().Get(omni.LabelInfraProviderID) - assert.Equal(t, infraProviderID, cpID) + return nil + }) - // update - _, err = safe.StateUpdateWithConflicts(ctx, st, mrs.Metadata(), func(res *infra.MachineRequestStatus) error { - res.Metadata().Labels().Set("foo", "bar") + // InfraMachineStatus - res.TypedSpec().Value.Id = "12345" - res.TypedSpec().Value.Stage = specs.MachineRequestStatusSpec_PROVISIONING + testInfraProviderAccessOutputResource(ctx, t, st, innerSt, infra.NewMachineStatus("test-ims"), func(res *infra.MachineStatus) error { + res.TypedSpec().Value.PowerState = specs.InfraMachineStatusSpec_POWER_STATE_ON return nil }) - assert.NoError(t, err) // InfraProviderStatus @@ -139,10 +120,10 @@ func TestInfraProviderAccess(t *testing.T) { assert.NoError(t, st.Create(ctx, cpr)) // assert that the label is set - res, err = innerSt.Get(ctx, cpr.Metadata()) + res, err := innerSt.Get(ctx, cpr.Metadata()) require.NoError(t, err) - cpID, _ = res.Metadata().Labels().Get(omni.LabelInfraProviderID) + cpID, _ := res.Metadata().Labels().Get(omni.LabelInfraProviderID) assert.Equal(t, infraProviderID, cpID) // update @@ -154,6 +135,58 @@ func TestInfraProviderAccess(t *testing.T) { assert.NoError(t, err) } +func testInfraProviderAccessInputResource[T resource.Resource](ctx context.Context, t *testing.T, st state.State, innerSt state.CoreState, + res T, prepareRes func(res T), updateRes func(res T) error, assertUpdateResult func(*testing.T, error), +) { + // create + err := st.Create(ctx, res) + assert.ErrorContains(t, err, fmt.Sprintf("infra providers are not allowed to create %q resources", res.Metadata().Type())) + + // prepare for update + res.Metadata().Labels().Set(omni.LabelInfraProviderID, infraProviderID) + + prepareRes(res) + + require.NoError(t, innerSt.Create(ctx, res)) + + // update spec + _, err = safe.StateUpdateWithConflicts(ctx, st, res.Metadata(), updateRes) + + assertUpdateResult(t, err) + + // update metadata labels + _, err = st.UpdateWithConflicts(ctx, res.Metadata(), func(res resource.Resource) error { + res.Metadata().Labels().Set("foo", "bar") + + return nil + }) + assert.ErrorContains(t, err, fmt.Sprintf("infra providers are not allowed to update %q resources other than setting finalizers", res.Metadata().Type())) + + // update metadata - add finalizer + _, err = st.UpdateWithConflicts(ctx, res.Metadata(), func(res resource.Resource) error { + res.Metadata().Finalizers().Add("foobar") + + return nil + }) + assert.NoError(t, err) +} + +func testInfraProviderAccessOutputResource[T resource.Resource](ctx context.Context, t *testing.T, st state.State, innerSt state.CoreState, res T, updateRes func(res T) error) { + // create + assert.NoError(t, st.Create(ctx, res)) + + // assert that the label is set + resAfterCreate, err := innerSt.Get(ctx, res.Metadata()) + require.NoError(t, err) + + cpID, _ := resAfterCreate.Metadata().Labels().Get(omni.LabelInfraProviderID) + assert.Equal(t, infraProviderID, cpID) + + // update + _, err = safe.StateUpdateWithConflicts(ctx, st, res.Metadata(), updateRes) + assert.NoError(t, err) +} + func TestInternalAccess(t *testing.T) { t.Parallel() diff --git a/internal/backend/runtime/omni/omni.go b/internal/backend/runtime/omni/omni.go index 7e00afe4..945648ff 100644 --- a/internal/backend/runtime/omni/omni.go +++ b/internal/backend/runtime/omni/omni.go @@ -265,6 +265,7 @@ func New(talosClientFactory *talos.ClientFactory, dnsService *dns.Service, workl omnictrl.NewMachineRequestSetStatusController(), omnictrl.NewClusterMachineRequestStatusController(), omnictrl.NewMachineTeardownController(), + omnictrl.NewInfraMachineController(), omnictrl.NewInfraProviderConfigPatchController(), } @@ -331,6 +332,7 @@ func New(talosClientFactory *talos.ClientFactory, dnsService *dns.Service, workl samlLabelRuleValidationOptions(), s3ConfigValidationOptions(), machineRequestSetValidationOptions(resourceState), + infraMachineConfigValidationOptions(resourceState), ) return &Runtime{ diff --git a/internal/backend/runtime/omni/state_access.go b/internal/backend/runtime/omni/state_access.go index 520708e8..4a88b142 100644 --- a/internal/backend/runtime/omni/state_access.go +++ b/internal/backend/runtime/omni/state_access.go @@ -392,6 +392,7 @@ func filterAccess(ctx context.Context, access state.Access) error { omni.EtcdManualBackupType, omni.ImagePullRequestType, omni.ImagePullStatusType, + omni.InfraMachineConfigType, omni.KubernetesStatusType, omni.KubernetesUpgradeManifestStatusType, omni.KubernetesUpgradeStatusType, @@ -505,6 +506,9 @@ func filterAccessByType(access state.Access) error { case infra.MachineRequestType, // read-only for all except for InfraProvider role (checked in filterAccess) infra.MachineRequestStatusType, // read-only for all except for InfraProvider role (checked in filterAccess) + infra.InfraMachineType, // read-only for all except for InfraProvider role (checked in filterAccess) + infra.InfraMachineStateType, // read-only for all except for InfraProvider role (checked in filterAccess) + infra.InfraMachineStatusType, // read-only for all except for InfraProvider role (checked in filterAccess) infra.InfraProviderStatusType, // read-only for all except for InfraProvider role (checked in filterAccess) omni.ClusterBootstrapStatusType, omni.ClusterDestroyStatusType, diff --git a/internal/backend/runtime/omni/state_validation.go b/internal/backend/runtime/omni/state_validation.go index 3d03d84a..535064d2 100644 --- a/internal/backend/runtime/omni/state_validation.go +++ b/internal/backend/runtime/omni/state_validation.go @@ -31,6 +31,7 @@ import ( authres "github.com/siderolabs/omni/client/pkg/omni/resources/auth" "github.com/siderolabs/omni/client/pkg/omni/resources/infra" "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/etcdbackup/store" "github.com/siderolabs/omni/internal/backend/runtime/omni/validated" "github.com/siderolabs/omni/internal/pkg/auth/accesspolicy" @@ -1073,3 +1074,30 @@ func validateProviderData(ctx context.Context, st state.State, providerID, provi return validateSchema(providerStatus) } + +func infraMachineConfigValidationOptions(st state.State) []validated.StateOption { + return []validated.StateOption{ + validated.WithUpdateValidations(validated.NewUpdateValidationForType(func(_ context.Context, oldRes, newRes *omni.InfraMachineConfig, _ ...state.UpdateOption) error { + if oldRes.TypedSpec().Value.Accepted && !newRes.TypedSpec().Value.Accepted { + return errors.New("an accepted machine cannot be unaccepted") + } + + return nil + })), + validated.WithDestroyValidations(validated.NewDestroyValidationForType(func(ctx context.Context, _ resource.Pointer, res *omni.InfraMachineConfig, _ ...state.DestroyOption) error { + if !res.TypedSpec().Value.Accepted { + return nil + } + + if _, err := safe.StateGetByID[*siderolink.Link](ctx, st, res.Metadata().ID()); err != nil { + if state.IsNotFoundError(err) { + return nil + } + + return err + } + + return errors.New("cannot delete the config for an already accepted machine config while it is linked to a machine") + })), + } +} diff --git a/internal/backend/runtime/omni/state_validation_test.go b/internal/backend/runtime/omni/state_validation_test.go index 3e45636c..e71e85b9 100644 --- a/internal/backend/runtime/omni/state_validation_test.go +++ b/internal/backend/runtime/omni/state_validation_test.go @@ -29,6 +29,7 @@ import ( "github.com/siderolabs/omni/client/pkg/omni/resources/auth" "github.com/siderolabs/omni/client/pkg/omni/resources/infra" omnires "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" "github.com/siderolabs/omni/internal/backend/runtime/omni" "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/etcdbackup" "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/etcdbackup/store" @@ -1168,6 +1169,54 @@ size: t2.small require.NoError(t, err) } +func TestInfraMachineConfigValidation(t *testing.T) { + t.Parallel() + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + t.Cleanup(cancel) + + innerSt := state.WrapCore(namespaced.NewState(inmem.Build)) + st := validated.NewState(innerSt, omni.InfraMachineConfigValidationOptions(innerSt)...) + wrappedState := state.WrapCore(st) + + conf := omnires.NewInfraMachineConfig(resources.DefaultNamespace, "test") + link := siderolink.NewLink(resources.DefaultNamespace, "test", nil) + + require.NoError(t, st.Create(ctx, conf)) + require.NoError(t, st.Create(ctx, link)) + + // can delete the conf, as it is not accepted + require.NoError(t, st.Destroy(ctx, conf.Metadata())) + + // recreate the conf, as accepted this time + conf = omnires.NewInfraMachineConfig(resources.DefaultNamespace, "test") + conf.TypedSpec().Value.Accepted = true + + require.NoError(t, st.Create(ctx, conf)) + + // try to "unaccept" it + + _, err := safe.StateUpdateWithConflicts(ctx, wrappedState, conf.Metadata(), func(res *omnires.InfraMachineConfig) error { + res.TypedSpec().Value.Accepted = false + + return nil + }) + require.True(t, validated.IsValidationError(err), "expected validation error") + assert.ErrorContains(t, err, "an accepted machine cannot be unaccepted") + + // try to destroy it + + err = st.Destroy(ctx, conf.Metadata()) + require.True(t, validated.IsValidationError(err), "expected validation error") + assert.ErrorContains(t, err, "cannot delete the config for an already accepted machine config while it is linked to a machine") + + // destroy the link + require.NoError(t, st.Destroy(ctx, link.Metadata())) + + // now it can be destroyed + require.NoError(t, st.Destroy(ctx, conf.Metadata())) +} + type mockEtcdBackupStoreFactory struct { store etcdbackup.Store } diff --git a/internal/backend/server.go b/internal/backend/server.go index ec292197..2c25c284 100644 --- a/internal/backend/server.go +++ b/internal/backend/server.go @@ -96,7 +96,7 @@ import ( "github.com/siderolabs/omni/internal/pkg/errgroup" "github.com/siderolabs/omni/internal/pkg/grpcutil" "github.com/siderolabs/omni/internal/pkg/kms" - "github.com/siderolabs/omni/internal/pkg/machinestatus" + "github.com/siderolabs/omni/internal/pkg/machineevent" "github.com/siderolabs/omni/internal/pkg/siderolink" "github.com/siderolabs/omni/internal/pkg/xcontext" ) @@ -555,7 +555,7 @@ func (s *Server) runMachineAPI(ctx context.Context) error { } omniState := s.omniRuntime.State() - machineStatusHandler := machinestatus.NewHandler(omniState, s.logger, s.siderolinkEventsCh) + machineEventHandler := machineevent.NewHandler(omniState, s.logger, s.siderolinkEventsCh) slink, err := siderolink.NewManager( ctx, @@ -566,7 +566,7 @@ func (s *Server) runMachineAPI(ctx context.Context) error { zap.AddStacktrace(zapcore.ErrorLevel), // prevent warn level from printing stack traces ), s.logHandler, - machineStatusHandler, + machineEventHandler, s.linkCounterDeltaCh, ) if err != nil { diff --git a/internal/pkg/machineevent/handler.go b/internal/pkg/machineevent/handler.go new file mode 100644 index 00000000..052c2b95 --- /dev/null +++ b/internal/pkg/machineevent/handler.go @@ -0,0 +1,180 @@ +// Copyright (c) 2024 Sidero Labs, Inc. +// +// Use of this software is governed by the Business Source License +// included in the LICENSE file. + +package machineevent + +import ( + "context" + "fmt" + "net/netip" + "strings" + + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/safe" + "github.com/cosi-project/runtime/pkg/state" + "github.com/siderolabs/gen/channel" + "github.com/siderolabs/siderolink/pkg/events" + "github.com/siderolabs/talos/pkg/machinery/api/common" + machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" + "go.uber.org/zap" + + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/helpers" + "github.com/siderolabs/omni/internal/pkg/auth/actor" +) + +// Handler is a machine event handler. +type Handler struct { + logger *zap.Logger + state state.State + notifyCh chan<- *omni.MachineStatusSnapshot +} + +// NewHandler creates a new machine event handler. +func NewHandler(state state.State, logger *zap.Logger, notifyCh chan<- *omni.MachineStatusSnapshot) *Handler { + return &Handler{ + state: state, + logger: logger, + notifyCh: notifyCh, + } +} + +// HandleEvent is called on each event coming from the Talos nodes. +func (handler *Handler) HandleEvent(ctx context.Context, event events.Event) error { + ctx = actor.MarkContextAsInternalActor(ctx) + + ipPort, err := netip.ParseAddrPort(event.Node) + if err != nil { + return err + } + + ip := ipPort.Addr().String() + + machines, err := safe.StateListAll[*omni.Machine]( + ctx, + handler.state, + state.WithLabelQuery(resource.LabelEqual(omni.MachineAddressLabel, ip)), + ) + if err != nil { + return err + } + + if machines.Len() == 0 { + return fmt.Errorf("no machines found for address %s", ip) + } + + machineID := machines.Get(0).Metadata().ID() + + switch event := event.Payload.(type) { + case *machineapi.MachineStatusEvent: + return handler.handleMachineStatusEvent(ctx, event, machineID) + case *machineapi.SequenceEvent: + return handler.handleSequenceEvent(ctx, event, machineID) + default: // nothing, we ignore other events + } + + return nil +} + +func (handler *Handler) handleMachineStatusEvent(ctx context.Context, event *machineapi.MachineStatusEvent, machineID resource.ID) error { + handler.logger.Info("got machine status event", + zap.String("machine", machineID), + zap.String("stage", event.Stage.String()), + zap.Any("status", event.Status), + ) + + snapshot := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, machineID) + + snapshot.TypedSpec().Value.MachineStatus = event + + channel.SendWithContext(ctx, handler.notifyCh, snapshot) + + return nil +} + +// handleSequenceEvent handles a sequence event: it updates the infra.MachineState if there is a matching infra.Machine. +func (handler *Handler) handleSequenceEvent(ctx context.Context, event *machineapi.SequenceEvent, machineID resource.ID) error { + logger := handler.logger.With(zap.String("machine", machineID), zap.String("sequence", event.Sequence), zap.Stringer("action", event.Action)) + + logger.Debug("got machine sequence event") + + // installation detection logic, taken from: + // https://github.com/siderolabs/sidero/blob/999e6e9fae0419c5245f3807d000f1af90dc90ba/app/sidero-controller-manager/cmd/events-manager/adapter.go#L177-L196 + setInstalled := false + + switch { + case event.GetSequence() == "install" && event.GetAction() == machineapi.SequenceEvent_NOOP && event.GetError().GetCode() == common.Code_FATAL: + if strings.Contains(event.GetError().GetMessage(), "unix.Reboot") { + setInstalled = true + } + case event.GetSequence() == "boot" && event.GetAction() == machineapi.SequenceEvent_START: + setInstalled = true + } + + // check if there is an infra machine for the machine + infraMachine, err := safe.StateGetByID[*infra.Machine](ctx, handler.state, machineID) + if err != nil { + if state.IsNotFoundError(err) { + logger.Debug("no matching infra.Machine found for machine, remove machine state if it exists", zap.String("machine", machineID)) + + return handler.removeMachineState(ctx, machineID) + } + + return err + } + + if !setInstalled { + return nil + } + + modify := func(res *infra.MachineState) error { + helpers.CopyAllLabels(infraMachine, res) + helpers.CopyAllAnnotations(infraMachine, res) + + res.TypedSpec().Value.Installed = true + + return nil + } + + machineState := infra.NewMachineState(machineID) + + if err = modify(machineState); err != nil { + return err + } + + err = handler.state.Create(ctx, machineState) + if err != nil { + if state.IsConflictError(err) { + if _, err = safe.StateUpdateWithConflicts(ctx, handler.state, machineState.Metadata(), modify); err != nil { + return err + } + } + + return err + } + + logger.Info("marked infra machine as installed") + + return nil +} + +func (handler *Handler) removeMachineState(ctx context.Context, machineID resource.ID) error { + md := infra.NewMachineState(machineID).Metadata() + + destroyReady, err := handler.state.Teardown(ctx, md) + if err != nil && !state.IsNotFoundError(err) { + return err + } + + if destroyReady { + if err = handler.state.Destroy(ctx, md); err != nil && !state.IsNotFoundError(err) { + return err + } + } + + return nil +} diff --git a/internal/pkg/machineevent/handler_test.go b/internal/pkg/machineevent/handler_test.go new file mode 100644 index 00000000..7b667bb8 --- /dev/null +++ b/internal/pkg/machineevent/handler_test.go @@ -0,0 +1,113 @@ +// Copyright (c) 2024 Sidero Labs, Inc. +// +// Use of this software is governed by the Business Source License +// included in the LICENSE file. + +package machineevent_test + +import ( + "context" + "testing" + "time" + + "github.com/cosi-project/runtime/pkg/safe" + "github.com/cosi-project/runtime/pkg/state" + "github.com/cosi-project/runtime/pkg/state/impl/inmem" + "github.com/cosi-project/runtime/pkg/state/impl/namespaced" + "github.com/siderolabs/siderolink/pkg/events" + "github.com/siderolabs/talos/pkg/machinery/api/common" + "github.com/siderolabs/talos/pkg/machinery/api/machine" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.uber.org/zap/zaptest" + + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/infra" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + "github.com/siderolabs/omni/internal/pkg/machineevent" +) + +func TestSequenceEvent(t *testing.T) { + st := state.WrapCore(namespaced.NewState(inmem.Build)) + logger := zaptest.NewLogger(t) + handler := machineevent.NewHandler(st, logger, nil) + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + t.Cleanup(cancel) + + testMachine := omni.NewMachine(resources.DefaultNamespace, "test-machine") + infraMachine := infra.NewMachine("test-machine") + + testMachine.Metadata().Labels().Set(omni.MachineAddressLabel, "127.0.0.1") + + require.NoError(t, st.Create(ctx, testMachine)) + require.NoError(t, st.Create(ctx, infraMachine)) + + event := events.Event{ + Node: "127.0.0.1:4242", + Payload: &machine.SequenceEvent{ + Sequence: "initialize", + }, + } + + require.NoError(t, handler.HandleEvent(ctx, event)) + + assertInfraMachineState(ctx, t, st, false, false) + + // assert installed condition 1 + + event.Payload = &machine.SequenceEvent{ + Sequence: "install", + Action: machine.SequenceEvent_NOOP, + Error: &common.Error{ + Code: common.Code_FATAL, + Message: "something unix.Reboot something", + }, + } + + require.NoError(t, handler.HandleEvent(ctx, event)) + + assertInfraMachineState(ctx, t, st, true, true) + + require.NoError(t, st.Destroy(ctx, infra.NewMachineState("test-machine").Metadata())) + + // assert installed condition 2 + + event.Payload = &machine.SequenceEvent{ + Sequence: "boot", + Action: machine.SequenceEvent_START, + } + + require.NoError(t, handler.HandleEvent(ctx, event)) + + assertInfraMachineState(ctx, t, st, true, true) + + // remove the infra machine, assert that state is removed + + require.NoError(t, st.Destroy(ctx, infraMachine.Metadata())) + + event.Payload = &machine.SequenceEvent{ + Sequence: "something", + } + + require.NoError(t, handler.HandleEvent(ctx, event)) + + assertInfraMachineState(ctx, t, st, false, false) +} + +func assertInfraMachineState(ctx context.Context, t *testing.T, st state.State, exists, installed bool) { + machineState, err := safe.StateGetByID[*infra.MachineState](ctx, st, "test-machine") + if err != nil { + if !state.IsNotFoundError(err) { + require.NoError(t, err) + } + + if exists { + require.Fail(t, "machine state not found") + } + + return + } + + assert.Equal(t, installed, machineState.TypedSpec().Value.Installed) +} diff --git a/internal/pkg/machinestatus/machinestatus.go b/internal/pkg/machineevent/machineevent.go similarity index 60% rename from internal/pkg/machinestatus/machinestatus.go rename to internal/pkg/machineevent/machineevent.go index 071be7ec..4bf915e2 100644 --- a/internal/pkg/machinestatus/machinestatus.go +++ b/internal/pkg/machineevent/machineevent.go @@ -3,5 +3,5 @@ // Use of this software is governed by the Business Source License // included in the LICENSE file. -// Package machinestatus provides a handler for machine status events. -package machinestatus +// Package machineevent provides a handler for machine events. +package machineevent diff --git a/internal/pkg/machinestatus/handler.go b/internal/pkg/machinestatus/handler.go deleted file mode 100644 index 4c209d44..00000000 --- a/internal/pkg/machinestatus/handler.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2024 Sidero Labs, Inc. -// -// Use of this software is governed by the Business Source License -// included in the LICENSE file. - -package machinestatus - -import ( - "context" - "fmt" - "net/netip" - - "github.com/cosi-project/runtime/pkg/resource" - "github.com/cosi-project/runtime/pkg/safe" - "github.com/cosi-project/runtime/pkg/state" - "github.com/siderolabs/gen/channel" - "github.com/siderolabs/siderolink/pkg/events" - machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" - "go.uber.org/zap" - - "github.com/siderolabs/omni/client/pkg/omni/resources" - "github.com/siderolabs/omni/client/pkg/omni/resources/omni" - "github.com/siderolabs/omni/internal/pkg/auth/actor" -) - -// Handler is a machine status handler. -type Handler struct { - logger *zap.Logger - state state.State - notifyCh chan<- *omni.MachineStatusSnapshot -} - -// NewHandler creates a new machine status handler. -func NewHandler(state state.State, logger *zap.Logger, notifyCh chan<- *omni.MachineStatusSnapshot) *Handler { - return &Handler{ - state: state, - logger: logger, - notifyCh: notifyCh, - } -} - -// HandleEvent is called on each event coming from the Talos nodes. -func (handler *Handler) HandleEvent(ctx context.Context, event events.Event) error { - ctx = actor.MarkContextAsInternalActor(ctx) - - ipPort, err := netip.ParseAddrPort(event.Node) - if err != nil { - return err - } - - ip := ipPort.Addr().String() - - machines, err := safe.StateListAll[*omni.Machine]( - ctx, - handler.state, - state.WithLabelQuery(resource.LabelEqual(omni.MachineAddressLabel, ip)), - ) - if err != nil { - return err - } - - if machines.Len() == 0 { - return fmt.Errorf("no machines found for address %s", ip) - } - - switch event := event.Payload.(type) { - case *machineapi.MachineStatusEvent: - return handler.handleMachineStatusEvent(ctx, event, machines.Get(0).Metadata().ID()) - default: // nothing, we ignore other events - } - - return nil -} - -func (handler *Handler) handleMachineStatusEvent(ctx context.Context, event *machineapi.MachineStatusEvent, machineID resource.ID) error { - handler.logger.Info("got machine status event", - zap.String("machine", machineID), - zap.String("stage", event.Stage.String()), - zap.Any("status", event.Status), - ) - - snapshot := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, machineID) - - snapshot.TypedSpec().Value.MachineStatus = event - - channel.SendWithContext(ctx, handler.notifyCh, snapshot) - - return nil -} diff --git a/internal/pkg/siderolink/manager.go b/internal/pkg/siderolink/manager.go index 699e42b6..2cc07733 100644 --- a/internal/pkg/siderolink/manager.go +++ b/internal/pkg/siderolink/manager.go @@ -56,7 +56,7 @@ import ( "github.com/siderolabs/omni/internal/pkg/errgroup" "github.com/siderolabs/omni/internal/pkg/grpcutil" "github.com/siderolabs/omni/internal/pkg/logreceiver" - "github.com/siderolabs/omni/internal/pkg/machinestatus" + "github.com/siderolabs/omni/internal/pkg/machineevent" "github.com/siderolabs/omni/internal/pkg/siderolink/trustd" ) @@ -81,15 +81,15 @@ func NewManager( params Params, logger *zap.Logger, handler *LogHandler, - machineStatusHandler *machinestatus.Handler, + machineEventHandler *machineevent.Handler, deltaCh chan<- LinkCounterDeltas, ) (*Manager, error) { manager := &Manager{ - logger: logger, - state: state, - wgHandler: wgHandler, - logHandler: handler, - machineStatusHandler: machineStatusHandler, + logger: logger, + state: state, + wgHandler: wgHandler, + logHandler: handler, + machineEventHandler: machineEventHandler, metricBytesReceived: prometheus.NewCounter(prometheus.CounterOpts{ Name: "omni_siderolink_received_bytes_total", Help: "Number of bytes received from the SideroLink interface.", @@ -136,12 +136,12 @@ func NewManager( // Manager sets up Siderolink server, manages it's state. type Manager struct { pb.UnimplementedProvisionServiceServer - config *siderolink.Config - logger *zap.Logger - state state.State - wgHandler WireguardHandler - logHandler *LogHandler - machineStatusHandler *machinestatus.Handler + config *siderolink.Config + logger *zap.Logger + state state.State + wgHandler WireguardHandler + logHandler *LogHandler + machineEventHandler *machineevent.Handler metricBytesReceived prometheus.Counter metricBytesSent prometheus.Counter @@ -412,8 +412,9 @@ func (manager *Manager) startEventsGRPC(ctx context.Context, eg *errgroup.Group, server := grpc.NewServer( grpc.SharedWriteBuffer(true), ) - sink := events.NewSink(manager.machineStatusHandler, []proto.Message{ + sink := events.NewSink(manager.machineEventHandler, []proto.Message{ &machineapi.MachineStatusEvent{}, + &machineapi.SequenceEvent{}, // used to detect if Talos was installed on the disk, which is used by static infra providers (e.g., bare-metal infra provider) }) eventsapi.RegisterEventSinkServiceServer(server, sink) diff --git a/internal/pkg/siderolink/siderolink_test.go b/internal/pkg/siderolink/siderolink_test.go index 240cab68..24a5ea10 100644 --- a/internal/pkg/siderolink/siderolink_test.go +++ b/internal/pkg/siderolink/siderolink_test.go @@ -39,7 +39,7 @@ import ( "github.com/siderolabs/omni/internal/pkg/config" "github.com/siderolabs/omni/internal/pkg/errgroup" "github.com/siderolabs/omni/internal/pkg/grpcutil" - "github.com/siderolabs/omni/internal/pkg/machinestatus" + "github.com/siderolabs/omni/internal/pkg/machineevent" sideromanager "github.com/siderolabs/omni/internal/pkg/siderolink" ) @@ -115,9 +115,9 @@ func (suite *SiderolinkSuite) SetupTest() { var err error - machineStatusHandler := machinestatus.NewHandler(suite.state, zaptest.NewLogger(suite.T()), make(chan *omni.MachineStatusSnapshot)) + eventHandler := machineevent.NewHandler(suite.state, zaptest.NewLogger(suite.T()), make(chan *omni.MachineStatusSnapshot)) - suite.manager, err = sideromanager.NewManager(suite.ctx, suite.state, &fakeWireguardHandler{}, params, zaptest.NewLogger(suite.T()), nil, machineStatusHandler, nil) + suite.manager, err = sideromanager.NewManager(suite.ctx, suite.state, &fakeWireguardHandler{}, params, zaptest.NewLogger(suite.T()), nil, eventHandler, nil) suite.Require().NoError(err) suite.startManager(params)