diff --git a/.drone.yml b/.drone.yml index aaca3ea81..13ab5fffb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -41,6 +41,8 @@ steps: - name: build-pull-request image: autonomy/build-container:latest pull: always + environment: + PLATFORM: linux/amd64,linux/arm64 commands: - make REGISTRY=registry.dev.talos-systems.io PUSH=true when: @@ -81,6 +83,7 @@ steps: from_secret: ghcr_username GHCR_PASSWORD: from_secret: ghcr_token + PLATFORM: linux/amd64,linux/arm64 commands: - docker login --username "$${GHCR_USERNAME}" --password "$${GHCR_PASSWORD}" ghcr.io - make PUSH=true @@ -182,6 +185,6 @@ depends_on: - default --- kind: signature -hmac: 6e8280c06e511ffeb8fb07e94c0920ffaa13ecaadba0dcba1b432b1351cc4d0a +hmac: 201f40ae8975352489a50a2bda0c9480b3aa191772a1501a62dca5decd1f2aa4 ... diff --git a/Dockerfile b/Dockerfile index 965a6f225..e5cd57153 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,26 +11,26 @@ FROM ghcr.io/talos-systems/ca-certificates:${PKGS} AS pkg-ca-certificates FROM ghcr.io/talos-systems/fhs:${PKGS} AS pkg-fhs FROM ghcr.io/talos-systems/ipmitool:${PKGS} AS pkg-ipmitool FROM ghcr.io/talos-systems/libressl:${PKGS} AS pkg-libressl -FROM ghcr.io/talos-systems/linux-firmware:${PKGS} AS pkg-linux-firmware +FROM --platform=amd64 ghcr.io/talos-systems/linux-firmware:${PKGS} AS pkg-linux-firmware-amd64 +FROM --platform=arm64 ghcr.io/talos-systems/linux-firmware:${PKGS} AS pkg-linux-firmware-arm64 FROM ghcr.io/talos-systems/musl:${PKGS} AS pkg-musl -FROM ghcr.io/talos-systems/kernel:${PKGS} AS pkg-kernel +FROM --platform=amd64 ghcr.io/talos-systems/kernel:${PKGS} AS pkg-kernel-amd64 +FROM --platform=arm64 ghcr.io/talos-systems/kernel:${PKGS} AS pkg-kernel-arm64 # The base target provides the base for running various tasks against the source # code -FROM golang:1.16 AS base +FROM --platform=${BUILDPLATFORM} ${TOOLS} AS base +SHELL ["/toolchain/bin/bash", "-c"] +ENV PATH /toolchain/bin:/toolchain/go/bin:/go/bin +RUN ["/toolchain/bin/mkdir", "/bin", "/tmp"] +RUN ["/toolchain/bin/ln", "-svf", "/toolchain/bin/bash", "/bin/sh"] +RUN ["/toolchain/bin/ln", "-svf", "/toolchain/etc/ssl", "/etc/ssl"] ENV GO111MODULE on ENV GOPROXY https://proxy.golang.org ENV CGO_ENABLED 0 ENV GOCACHE /.cache/go-build ENV GOMODCACHE /.cache/mod -WORKDIR /tmp -RUN apt-get update \ - && apt-get install -y unzip \ - && curl -L https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip -o /tmp/protoc.zip \ - && unzip -o /tmp/protoc.zip -d /usr/local bin/protoc \ - && unzip -o /tmp/protoc.zip -d /usr/local 'include/*' -RUN --mount=type=cache,target=/.cache go install github.com/golang/protobuf/protoc-gen-go@v1.3 RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 RUN --mount=type=cache,target=/.cache go install k8s.io/code-generator/cmd/conversion-gen@v0.21.0 RUN --mount=type=cache,target=/.cache go install mvdan.cc/gofumpt/gofumports@v0.1.1 @@ -63,7 +63,7 @@ FROM base AS generate-build COPY ./app/metal-controller-manager/internal/api/api.proto \ /src/app/metal-controller-manager/internal/api/api.proto RUN protoc -I/src/app/metal-controller-manager/internal/api \ - --go_out=plugins=grpc,paths=source_relative:/src/app/metal-controller-manager/internal/api \ + --go_out=paths=source_relative:/src/app/metal-controller-manager/internal/api --go-grpc_out=paths=source_relative:/src/app/metal-controller-manager/internal/api \ api.proto RUN --mount=type=cache,target=/.cache controller-gen object:headerFile="./hack/boilerplate.go.txt" paths="./..." RUN --mount=type=cache,target=/.cache conversion-gen --input-dirs="./app/cluster-api-provider-sidero/api/v1alpha2" --output-base ./ --output-file-base="zz_generated.conversion" --go-header-file="./hack/boilerplate.go.txt" @@ -75,7 +75,7 @@ COPY --from=generate-build /src/app/cluster-api-provider-sidero/api ./app/cluste COPY --from=generate-build /src/app/metal-controller-manager/api ./app/metal-controller-manager/api COPY --from=generate-build /src/app/metal-controller-manager/internal/api ./app/metal-controller-manager/internal/api -FROM alpine:3.13 AS release-build +FROM --platform=${BUILDPLATFORM} alpine:3.13 AS release-build ADD https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.1.0/kustomize_v4.1.0_linux_amd64.tar.gz . RUN tar -xf kustomize_v4.1.0_linux_amd64.tar.gz -C /usr/local/bin && rm kustomize_v4.1.0_linux_amd64.tar.gz COPY ./config ./config @@ -102,7 +102,8 @@ COPY --from=release-build /metadata.yaml /infrastructure-sidero/${TAG}/metadata. COPY --from=release-build /cluster-template.yaml /infrastructure-sidero/${TAG}/cluster-template.yaml FROM base AS build-cluster-api-provider-sidero -RUN --mount=type=cache,target=/.cache GOOS=linux go build -ldflags "-s -w" -o /manager ./app/cluster-api-provider-sidero +ARG TARGETARCH +RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "-s -w" -o /manager ./app/cluster-api-provider-sidero RUN chmod +x /manager ## TODO(rsmitty): make bmc pkg and move to talos-systems image @@ -117,36 +118,36 @@ LABEL org.opencontainers.image.source https://github.com/talos-systems/sidero ENTRYPOINT [ "/manager" ] FROM base AS build-metal-controller-manager -RUN --mount=type=cache,target=/.cache GOOS=linux go build -ldflags "-s -w" -o /manager ./app/metal-controller-manager +ARG TARGETARCH +RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "-s -w" -o /manager ./app/metal-controller-manager RUN chmod +x /manager FROM scratch AS assets -ADD http://boot.ipxe.org/undionly.kpxe /undionly.kpxe -ADD http://boot.ipxe.org/ipxe.efi /ipxe.efi +ADD http://boot.ipxe.org/undionly.kpxe /amd64/undionly.kpxe +ADD http://boot.ipxe.org/ipxe.efi /amd64/ipxe.efi +ADD http://boot.ipxe.org/arm64-efi/ipxe.efi /arm64/ipxe.efi -FROM base AS agent-build -RUN --mount=type=cache,target=/.cache GOOS=linux go build -ldflags "-s -w" -o /agent ./app/metal-controller-manager/cmd/agent +FROM base AS agent-build-amd64 +RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o /agent ./app/metal-controller-manager/cmd/agent RUN chmod +x /agent -FROM scratch AS agent -COPY --from=pkg-ca-certificates / / -COPY --from=pkg-fhs / / -COPY --from=agent-build /agent /agent -LABEL org.opencontainers.image.source https://github.com/talos-systems/sidero -ENTRYPOINT [ "/agent" ] +FROM base AS agent-build-arm64 +RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o /agent ./app/metal-controller-manager/cmd/agent +RUN chmod +x /agent -FROM ${TOOLS} AS initramfs-archive -ENV PATH /toolchain/bin -RUN [ "/toolchain/bin/mkdir", "/bin" ] -RUN [ "ln", "-s", "/toolchain/bin/bash", "/bin/sh" ] +FROM base AS initramfs-archive-amd64 WORKDIR /initramfs -COPY --from=agent /agent ./init -COPY --from=pkg-linux-firmware /lib/firmware/bnx2 ./lib/firmware/bnx2 -COPY --from=pkg-linux-firmware /lib/firmware/bnx2x ./lib/firmware/bnx2x +COPY --from=agent-build-amd64 /agent ./init +COPY --from=pkg-linux-firmware-amd64 /lib/firmware/bnx2 ./lib/firmware/bnx2 +COPY --from=pkg-linux-firmware-amd64 /lib/firmware/bnx2x ./lib/firmware/bnx2x RUN set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/initramfs.xz -FROM scratch AS initramfs -COPY --from=initramfs-archive /initramfs.xz /initramfs.xz +FROM base AS initramfs-archive-arm64 +WORKDIR /initramfs +COPY --from=agent-build-arm64 /agent ./init +COPY --from=pkg-linux-firmware-arm64 /lib/firmware/bnx2 ./lib/firmware/bnx2 +COPY --from=pkg-linux-firmware-arm64 /lib/firmware/bnx2x ./lib/firmware/bnx2x +RUN set -o pipefail && find . 2>/dev/null | cpio -H newc -o | xz -v -C crc32 -0 -e -T 0 -z >/initramfs.xz FROM scratch AS metal-controller-manager COPY --from=pkg-ca-certificates / / @@ -154,17 +155,21 @@ COPY --from=pkg-fhs / / COPY --from=pkg-musl / / COPY --from=pkg-libressl / / COPY --from=pkg-ipmitool / / -COPY --from=assets /undionly.kpxe /var/lib/sidero/tftp/undionly.kpxe -COPY --from=assets /undionly.kpxe /var/lib/sidero/tftp/undionly.kpxe.0 -COPY --from=assets /ipxe.efi /var/lib/sidero/tftp/ipxe.efi -COPY --from=initramfs /initramfs.xz /var/lib/sidero/env/agent/initramfs.xz -COPY --from=pkg-kernel /boot/vmlinuz /var/lib/sidero/env/agent/vmlinuz +COPY --from=assets /amd64/undionly.kpxe /var/lib/sidero/tftp/undionly.kpxe +COPY --from=assets /amd64/undionly.kpxe /var/lib/sidero/tftp/undionly.kpxe.0 +COPY --from=assets /amd64/ipxe.efi /var/lib/sidero/tftp/ipxe.efi +COPY --from=assets /arm64/ipxe.efi /var/lib/sidero/tftp/ipxe-arm64.efi +COPY --from=initramfs-archive-amd64 /initramfs.xz /var/lib/sidero/env/agent-amd64/initramfs.xz +COPY --from=initramfs-archive-arm64 /initramfs.xz /var/lib/sidero/env/agent-arm64/initramfs.xz +COPY --from=pkg-kernel-amd64 /boot/vmlinuz /var/lib/sidero/env/agent-amd64/vmlinuz +COPY --from=pkg-kernel-arm64 /boot/vmlinuz /var/lib/sidero/env/agent-arm64/vmlinuz COPY --from=build-metal-controller-manager /manager /manager LABEL org.opencontainers.image.source https://github.com/talos-systems/sidero ENTRYPOINT [ "/manager" ] FROM base AS build-metal-metadata-server -RUN --mount=type=cache,target=/.cache GOOS=linux go build -ldflags "-s -w" -o /metal-metadata-server ./app/metal-metadata-server +ARG TARGETARCH +RUN --mount=type=cache,target=/.cache GOOS=linux GOARCH=${TARGETARCH} go build -ldflags "-s -w" -o /metal-metadata-server ./app/metal-metadata-server RUN chmod +x /metal-metadata-server FROM scratch AS metal-metadata-server diff --git a/Makefile b/Makefile index f458e4417..6609298be 100644 --- a/Makefile +++ b/Makefile @@ -90,11 +90,11 @@ docker-%: ## Builds the specified target defined in the Dockerfile using the doc .PHONY: generate generate: ## Generate source code. - @$(MAKE) local-$@ DEST=./ + @$(MAKE) local-$@ DEST=./ PLATFORM=linux/amd64 .PHONY: manifests manifests: ## Generate manifests (e.g. CRD, RBAC, etc.). - @$(MAKE) local-$@ DEST=./ + @$(MAKE) local-$@ DEST=./ PLATFORM=linux/amd64 # Artifacts @@ -129,7 +129,7 @@ talos-artifacts: $(ARTIFACTS)/$(TALOS_RELEASE) .PHONY: sfyra sfyra: ## Build the Sfyra test binary. - @$(MAKE) local-$@ DEST=./$(ARTIFACTS) + @$(MAKE) local-$@ DEST=./$(ARTIFACTS) PLATFORM=linux/amd64 .PHONY: clusterctl-release clusterctl-release: release @@ -171,10 +171,10 @@ run: install ## Run the controller locally. This is for testing purposes only. .PHONY: fmt fmt: ## Formats the source code. - @$(MAKE) local-fmt DEST=./ + @$(MAKE) local-fmt DEST=./ PLATFORM=linux/amd64 lint-%: ## Runs the specified linter. Valid options are go, protobuf, and markdown (e.g. lint-go). - @$(MAKE) target-lint-$* + @$(MAKE) target-lint-$* PLATFORM=linux/amd64 lint: ## Runs linters on go, protobuf, and markdown file types. @$(MAKE) lint-go lint-markdown lint-sfyra @@ -183,11 +183,11 @@ lint: ## Runs linters on go, protobuf, and markdown file types. .PHONY: unit-tests unit-tests: ## Performs unit tests. - @$(MAKE) local-$@ DEST=$(ARTIFACTS) + @$(MAKE) local-$@ DEST=$(ARTIFACTS) PLATFORM=linux/amd64 .PHONY: unit-tests-race unit-tests-race: ## Performs unit tests with race detection enabled. - @$(MAKE) target-$@ + @$(MAKE) target-$@ PLATFORM=linux/amd64 # Utilities diff --git a/app/metal-controller-manager/internal/api/api.pb.go b/app/metal-controller-manager/internal/api/api.pb.go index db96275d2..fc9e8ebd4 100644 --- a/app/metal-controller-manager/internal/api/api.pb.go +++ b/app/metal-controller-manager/internal/api/api.pb.go @@ -1,833 +1,911 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.15.6 // source: api.proto package api import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type SystemInformation struct { - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Manufacturer string `protobuf:"bytes,2,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` - ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - SerialNumber string `protobuf:"bytes,5,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"` - SkuNumber string `protobuf:"bytes,6,opt,name=sku_number,json=skuNumber,proto3" json:"sku_number,omitempty"` - Family string `protobuf:"bytes,7,opt,name=family,proto3" json:"family,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SystemInformation) Reset() { *m = SystemInformation{} } -func (m *SystemInformation) String() string { return proto.CompactTextString(m) } -func (*SystemInformation) ProtoMessage() {} -func (*SystemInformation) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SystemInformation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SystemInformation.Unmarshal(m, b) + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Manufacturer string `protobuf:"bytes,2,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` + ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + SerialNumber string `protobuf:"bytes,5,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"` + SkuNumber string `protobuf:"bytes,6,opt,name=sku_number,json=skuNumber,proto3" json:"sku_number,omitempty"` + Family string `protobuf:"bytes,7,opt,name=family,proto3" json:"family,omitempty"` } -func (m *SystemInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SystemInformation.Marshal(b, m, deterministic) +func (x *SystemInformation) Reset() { + *x = SystemInformation{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SystemInformation) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemInformation.Merge(m, src) +func (x *SystemInformation) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SystemInformation) XXX_Size() int { - return xxx_messageInfo_SystemInformation.Size(m) -} +func (*SystemInformation) ProtoMessage() {} -func (m *SystemInformation) XXX_DiscardUnknown() { - xxx_messageInfo_SystemInformation.DiscardUnknown(m) +func (x *SystemInformation) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SystemInformation proto.InternalMessageInfo +// Deprecated: Use SystemInformation.ProtoReflect.Descriptor instead. +func (*SystemInformation) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{0} +} -func (m *SystemInformation) GetUuid() string { - if m != nil { - return m.Uuid +func (x *SystemInformation) GetUuid() string { + if x != nil { + return x.Uuid } return "" } -func (m *SystemInformation) GetManufacturer() string { - if m != nil { - return m.Manufacturer +func (x *SystemInformation) GetManufacturer() string { + if x != nil { + return x.Manufacturer } return "" } -func (m *SystemInformation) GetProductName() string { - if m != nil { - return m.ProductName +func (x *SystemInformation) GetProductName() string { + if x != nil { + return x.ProductName } return "" } -func (m *SystemInformation) GetVersion() string { - if m != nil { - return m.Version +func (x *SystemInformation) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *SystemInformation) GetSerialNumber() string { - if m != nil { - return m.SerialNumber +func (x *SystemInformation) GetSerialNumber() string { + if x != nil { + return x.SerialNumber } return "" } -func (m *SystemInformation) GetSkuNumber() string { - if m != nil { - return m.SkuNumber +func (x *SystemInformation) GetSkuNumber() string { + if x != nil { + return x.SkuNumber } return "" } -func (m *SystemInformation) GetFamily() string { - if m != nil { - return m.Family +func (x *SystemInformation) GetFamily() string { + if x != nil { + return x.Family } return "" } type CPU struct { - Manufacturer string `protobuf:"bytes,1,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CPU) Reset() { *m = CPU{} } -func (m *CPU) String() string { return proto.CompactTextString(m) } -func (*CPU) ProtoMessage() {} -func (*CPU) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} + Manufacturer string `protobuf:"bytes,1,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` } -func (m *CPU) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CPU.Unmarshal(m, b) +func (x *CPU) Reset() { + *x = CPU{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CPU) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CPU.Marshal(b, m, deterministic) +func (x *CPU) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CPU) XXX_Merge(src proto.Message) { - xxx_messageInfo_CPU.Merge(m, src) -} +func (*CPU) ProtoMessage() {} -func (m *CPU) XXX_Size() int { - return xxx_messageInfo_CPU.Size(m) +func (x *CPU) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *CPU) XXX_DiscardUnknown() { - xxx_messageInfo_CPU.DiscardUnknown(m) +// Deprecated: Use CPU.ProtoReflect.Descriptor instead. +func (*CPU) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{1} } -var xxx_messageInfo_CPU proto.InternalMessageInfo - -func (m *CPU) GetManufacturer() string { - if m != nil { - return m.Manufacturer +func (x *CPU) GetManufacturer() string { + if x != nil { + return x.Manufacturer } return "" } -func (m *CPU) GetVersion() string { - if m != nil { - return m.Version +func (x *CPU) GetVersion() string { + if x != nil { + return x.Version } return "" } type CreateServerRequest struct { - SystemInformation *SystemInformation `protobuf:"bytes,1,opt,name=system_information,json=systemInformation,proto3" json:"system_information,omitempty"` - Cpu *CPU `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"` - Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CreateServerRequest) Reset() { *m = CreateServerRequest{} } -func (m *CreateServerRequest) String() string { return proto.CompactTextString(m) } -func (*CreateServerRequest) ProtoMessage() {} -func (*CreateServerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} + SystemInformation *SystemInformation `protobuf:"bytes,1,opt,name=system_information,json=systemInformation,proto3" json:"system_information,omitempty"` + Cpu *CPU `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` } -func (m *CreateServerRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateServerRequest.Unmarshal(m, b) +func (x *CreateServerRequest) Reset() { + *x = CreateServerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CreateServerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateServerRequest.Marshal(b, m, deterministic) +func (x *CreateServerRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CreateServerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateServerRequest.Merge(m, src) -} +func (*CreateServerRequest) ProtoMessage() {} -func (m *CreateServerRequest) XXX_Size() int { - return xxx_messageInfo_CreateServerRequest.Size(m) +func (x *CreateServerRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *CreateServerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CreateServerRequest.DiscardUnknown(m) +// Deprecated: Use CreateServerRequest.ProtoReflect.Descriptor instead. +func (*CreateServerRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{2} } -var xxx_messageInfo_CreateServerRequest proto.InternalMessageInfo - -func (m *CreateServerRequest) GetSystemInformation() *SystemInformation { - if m != nil { - return m.SystemInformation +func (x *CreateServerRequest) GetSystemInformation() *SystemInformation { + if x != nil { + return x.SystemInformation } return nil } -func (m *CreateServerRequest) GetCpu() *CPU { - if m != nil { - return m.Cpu +func (x *CreateServerRequest) GetCpu() *CPU { + if x != nil { + return x.Cpu } return nil } -func (m *CreateServerRequest) GetHostname() string { - if m != nil { - return m.Hostname +func (x *CreateServerRequest) GetHostname() string { + if x != nil { + return x.Hostname } return "" } type Address struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Address) Reset() { *m = Address{} } -func (m *Address) String() string { return proto.CompactTextString(m) } -func (*Address) ProtoMessage() {} -func (*Address) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` } -func (m *Address) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Address.Unmarshal(m, b) +func (x *Address) Reset() { + *x = Address{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Address.Marshal(b, m, deterministic) +func (x *Address) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Address) XXX_Merge(src proto.Message) { - xxx_messageInfo_Address.Merge(m, src) -} +func (*Address) ProtoMessage() {} -func (m *Address) XXX_Size() int { - return xxx_messageInfo_Address.Size(m) +func (x *Address) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Address) XXX_DiscardUnknown() { - xxx_messageInfo_Address.DiscardUnknown(m) +// Deprecated: Use Address.ProtoReflect.Descriptor instead. +func (*Address) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{3} } -var xxx_messageInfo_Address proto.InternalMessageInfo - -func (m *Address) GetType() string { - if m != nil { - return m.Type +func (x *Address) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *Address) GetAddress() string { - if m != nil { - return m.Address +func (x *Address) GetAddress() string { + if x != nil { + return x.Address } return "" } type CreateServerResponse struct { - Wipe bool `protobuf:"varint,1,opt,name=wipe,proto3" json:"wipe,omitempty"` - InsecureWipe bool `protobuf:"varint,2,opt,name=insecure_wipe,json=insecureWipe,proto3" json:"insecure_wipe,omitempty"` - RebootTimeout float64 `protobuf:"fixed64,3,opt,name=reboot_timeout,json=rebootTimeout,proto3" json:"reboot_timeout,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CreateServerResponse) Reset() { *m = CreateServerResponse{} } -func (m *CreateServerResponse) String() string { return proto.CompactTextString(m) } -func (*CreateServerResponse) ProtoMessage() {} -func (*CreateServerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} + Wipe bool `protobuf:"varint,1,opt,name=wipe,proto3" json:"wipe,omitempty"` + InsecureWipe bool `protobuf:"varint,2,opt,name=insecure_wipe,json=insecureWipe,proto3" json:"insecure_wipe,omitempty"` + RebootTimeout float64 `protobuf:"fixed64,3,opt,name=reboot_timeout,json=rebootTimeout,proto3" json:"reboot_timeout,omitempty"` } -func (m *CreateServerResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateServerResponse.Unmarshal(m, b) +func (x *CreateServerResponse) Reset() { + *x = CreateServerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CreateServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateServerResponse.Marshal(b, m, deterministic) +func (x *CreateServerResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CreateServerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateServerResponse.Merge(m, src) -} +func (*CreateServerResponse) ProtoMessage() {} -func (m *CreateServerResponse) XXX_Size() int { - return xxx_messageInfo_CreateServerResponse.Size(m) +func (x *CreateServerResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *CreateServerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CreateServerResponse.DiscardUnknown(m) +// Deprecated: Use CreateServerResponse.ProtoReflect.Descriptor instead. +func (*CreateServerResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{4} } -var xxx_messageInfo_CreateServerResponse proto.InternalMessageInfo - -func (m *CreateServerResponse) GetWipe() bool { - if m != nil { - return m.Wipe +func (x *CreateServerResponse) GetWipe() bool { + if x != nil { + return x.Wipe } return false } -func (m *CreateServerResponse) GetInsecureWipe() bool { - if m != nil { - return m.InsecureWipe +func (x *CreateServerResponse) GetInsecureWipe() bool { + if x != nil { + return x.InsecureWipe } return false } -func (m *CreateServerResponse) GetRebootTimeout() float64 { - if m != nil { - return m.RebootTimeout +func (x *CreateServerResponse) GetRebootTimeout() float64 { + if x != nil { + return x.RebootTimeout } return 0 } type MarkServerAsWipedRequest struct { - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MarkServerAsWipedRequest) Reset() { *m = MarkServerAsWipedRequest{} } -func (m *MarkServerAsWipedRequest) String() string { return proto.CompactTextString(m) } -func (*MarkServerAsWipedRequest) ProtoMessage() {} -func (*MarkServerAsWipedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` } -func (m *MarkServerAsWipedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MarkServerAsWipedRequest.Unmarshal(m, b) +func (x *MarkServerAsWipedRequest) Reset() { + *x = MarkServerAsWipedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MarkServerAsWipedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MarkServerAsWipedRequest.Marshal(b, m, deterministic) +func (x *MarkServerAsWipedRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MarkServerAsWipedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarkServerAsWipedRequest.Merge(m, src) -} +func (*MarkServerAsWipedRequest) ProtoMessage() {} -func (m *MarkServerAsWipedRequest) XXX_Size() int { - return xxx_messageInfo_MarkServerAsWipedRequest.Size(m) +func (x *MarkServerAsWipedRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *MarkServerAsWipedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MarkServerAsWipedRequest.DiscardUnknown(m) +// Deprecated: Use MarkServerAsWipedRequest.ProtoReflect.Descriptor instead. +func (*MarkServerAsWipedRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{5} } -var xxx_messageInfo_MarkServerAsWipedRequest proto.InternalMessageInfo - -func (m *MarkServerAsWipedRequest) GetUuid() string { - if m != nil { - return m.Uuid +func (x *MarkServerAsWipedRequest) GetUuid() string { + if x != nil { + return x.Uuid } return "" } type HeartbeatRequest struct { - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *HeartbeatRequest) Reset() { *m = HeartbeatRequest{} } -func (m *HeartbeatRequest) String() string { return proto.CompactTextString(m) } -func (*HeartbeatRequest) ProtoMessage() {} -func (*HeartbeatRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` } -func (m *HeartbeatRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeartbeatRequest.Unmarshal(m, b) +func (x *HeartbeatRequest) Reset() { + *x = HeartbeatRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *HeartbeatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeartbeatRequest.Marshal(b, m, deterministic) +func (x *HeartbeatRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *HeartbeatRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatRequest.Merge(m, src) -} +func (*HeartbeatRequest) ProtoMessage() {} -func (m *HeartbeatRequest) XXX_Size() int { - return xxx_messageInfo_HeartbeatRequest.Size(m) +func (x *HeartbeatRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *HeartbeatRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatRequest.DiscardUnknown(m) +// Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead. +func (*HeartbeatRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{6} } -var xxx_messageInfo_HeartbeatRequest proto.InternalMessageInfo - -func (m *HeartbeatRequest) GetUuid() string { - if m != nil { - return m.Uuid +func (x *HeartbeatRequest) GetUuid() string { + if x != nil { + return x.Uuid } return "" } type MarkServerAsWipedResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *MarkServerAsWipedResponse) Reset() { *m = MarkServerAsWipedResponse{} } -func (m *MarkServerAsWipedResponse) String() string { return proto.CompactTextString(m) } -func (*MarkServerAsWipedResponse) ProtoMessage() {} -func (*MarkServerAsWipedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{7} -} - -func (m *MarkServerAsWipedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MarkServerAsWipedResponse.Unmarshal(m, b) +func (x *MarkServerAsWipedResponse) Reset() { + *x = MarkServerAsWipedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MarkServerAsWipedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MarkServerAsWipedResponse.Marshal(b, m, deterministic) +func (x *MarkServerAsWipedResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MarkServerAsWipedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarkServerAsWipedResponse.Merge(m, src) -} +func (*MarkServerAsWipedResponse) ProtoMessage() {} -func (m *MarkServerAsWipedResponse) XXX_Size() int { - return xxx_messageInfo_MarkServerAsWipedResponse.Size(m) +func (x *MarkServerAsWipedResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *MarkServerAsWipedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MarkServerAsWipedResponse.DiscardUnknown(m) +// Deprecated: Use MarkServerAsWipedResponse.ProtoReflect.Descriptor instead. +func (*MarkServerAsWipedResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{7} } -var xxx_messageInfo_MarkServerAsWipedResponse proto.InternalMessageInfo - type HeartbeatResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *HeartbeatResponse) Reset() { *m = HeartbeatResponse{} } -func (m *HeartbeatResponse) String() string { return proto.CompactTextString(m) } -func (*HeartbeatResponse) ProtoMessage() {} -func (*HeartbeatResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{8} +func (x *HeartbeatResponse) Reset() { + *x = HeartbeatResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *HeartbeatResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HeartbeatResponse.Unmarshal(m, b) +func (x *HeartbeatResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *HeartbeatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HeartbeatResponse.Marshal(b, m, deterministic) -} +func (*HeartbeatResponse) ProtoMessage() {} -func (m *HeartbeatResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_HeartbeatResponse.Merge(m, src) -} - -func (m *HeartbeatResponse) XXX_Size() int { - return xxx_messageInfo_HeartbeatResponse.Size(m) +func (x *HeartbeatResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *HeartbeatResponse) XXX_DiscardUnknown() { - xxx_messageInfo_HeartbeatResponse.DiscardUnknown(m) +// Deprecated: Use HeartbeatResponse.ProtoReflect.Descriptor instead. +func (*HeartbeatResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{8} } -var xxx_messageInfo_HeartbeatResponse proto.InternalMessageInfo - type ReconcileServerAddressesRequest struct { - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - Address []*Address `protobuf:"bytes,2,rep,name=address,proto3" json:"address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ReconcileServerAddressesRequest) Reset() { *m = ReconcileServerAddressesRequest{} } -func (m *ReconcileServerAddressesRequest) String() string { return proto.CompactTextString(m) } -func (*ReconcileServerAddressesRequest) ProtoMessage() {} -func (*ReconcileServerAddressesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{9} + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Address []*Address `protobuf:"bytes,2,rep,name=address,proto3" json:"address,omitempty"` } -func (m *ReconcileServerAddressesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReconcileServerAddressesRequest.Unmarshal(m, b) +func (x *ReconcileServerAddressesRequest) Reset() { + *x = ReconcileServerAddressesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ReconcileServerAddressesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReconcileServerAddressesRequest.Marshal(b, m, deterministic) +func (x *ReconcileServerAddressesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ReconcileServerAddressesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReconcileServerAddressesRequest.Merge(m, src) -} +func (*ReconcileServerAddressesRequest) ProtoMessage() {} -func (m *ReconcileServerAddressesRequest) XXX_Size() int { - return xxx_messageInfo_ReconcileServerAddressesRequest.Size(m) +func (x *ReconcileServerAddressesRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *ReconcileServerAddressesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReconcileServerAddressesRequest.DiscardUnknown(m) +// Deprecated: Use ReconcileServerAddressesRequest.ProtoReflect.Descriptor instead. +func (*ReconcileServerAddressesRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{9} } -var xxx_messageInfo_ReconcileServerAddressesRequest proto.InternalMessageInfo - -func (m *ReconcileServerAddressesRequest) GetUuid() string { - if m != nil { - return m.Uuid +func (x *ReconcileServerAddressesRequest) GetUuid() string { + if x != nil { + return x.Uuid } return "" } -func (m *ReconcileServerAddressesRequest) GetAddress() []*Address { - if m != nil { - return m.Address +func (x *ReconcileServerAddressesRequest) GetAddress() []*Address { + if x != nil { + return x.Address } return nil } type ReconcileServerAddressesResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ReconcileServerAddressesResponse) Reset() { *m = ReconcileServerAddressesResponse{} } -func (m *ReconcileServerAddressesResponse) String() string { return proto.CompactTextString(m) } -func (*ReconcileServerAddressesResponse) ProtoMessage() {} -func (*ReconcileServerAddressesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{10} -} - -func (m *ReconcileServerAddressesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ReconcileServerAddressesResponse.Unmarshal(m, b) -} - -func (m *ReconcileServerAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ReconcileServerAddressesResponse.Marshal(b, m, deterministic) -} - -func (m *ReconcileServerAddressesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReconcileServerAddressesResponse.Merge(m, src) -} - -func (m *ReconcileServerAddressesResponse) XXX_Size() int { - return xxx_messageInfo_ReconcileServerAddressesResponse.Size(m) -} - -func (m *ReconcileServerAddressesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReconcileServerAddressesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReconcileServerAddressesResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*SystemInformation)(nil), "api.SystemInformation") - proto.RegisterType((*CPU)(nil), "api.CPU") - proto.RegisterType((*CreateServerRequest)(nil), "api.CreateServerRequest") - proto.RegisterType((*Address)(nil), "api.Address") - proto.RegisterType((*CreateServerResponse)(nil), "api.CreateServerResponse") - proto.RegisterType((*MarkServerAsWipedRequest)(nil), "api.MarkServerAsWipedRequest") - proto.RegisterType((*HeartbeatRequest)(nil), "api.HeartbeatRequest") - proto.RegisterType((*MarkServerAsWipedResponse)(nil), "api.MarkServerAsWipedResponse") - proto.RegisterType((*HeartbeatResponse)(nil), "api.HeartbeatResponse") - proto.RegisterType((*ReconcileServerAddressesRequest)(nil), "api.ReconcileServerAddressesRequest") - proto.RegisterType((*ReconcileServerAddressesResponse)(nil), "api.ReconcileServerAddressesResponse") -} - -func init() { - proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) -} - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 595 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdd, 0x6e, 0xd3, 0x30, - 0x18, 0x55, 0xda, 0xfd, 0xf5, 0x6b, 0x87, 0xa8, 0x07, 0x53, 0x16, 0x34, 0x18, 0x81, 0x4d, 0xbb, - 0x59, 0x23, 0x95, 0x0b, 0x24, 0xee, 0x46, 0x85, 0xc4, 0x84, 0x98, 0xa6, 0x8c, 0x09, 0x09, 0x09, - 0x55, 0x6e, 0xf2, 0xad, 0xb3, 0x96, 0xd8, 0xc1, 0x3f, 0x43, 0x7d, 0x0f, 0x5e, 0x89, 0x37, 0xe1, - 0x41, 0x50, 0x1c, 0x67, 0x6b, 0xd7, 0x76, 0xbb, 0xb3, 0xcf, 0xf9, 0x7e, 0xcf, 0x71, 0x02, 0x2d, - 0x5a, 0xb0, 0x5e, 0x21, 0x85, 0x16, 0xa4, 0x49, 0x0b, 0x16, 0xfe, 0xf3, 0xa0, 0x7b, 0x3e, 0x51, - 0x1a, 0xf3, 0x13, 0x7e, 0x29, 0x64, 0x4e, 0x35, 0x13, 0x9c, 0x10, 0x58, 0x31, 0x86, 0xa5, 0xbe, - 0xb7, 0xe7, 0x1d, 0xb6, 0x62, 0x7b, 0x26, 0x21, 0x74, 0x72, 0xca, 0xcd, 0x25, 0x4d, 0xb4, 0x91, - 0x28, 0xfd, 0x86, 0xe5, 0x66, 0x30, 0xf2, 0x1a, 0x3a, 0x85, 0x14, 0xa9, 0x49, 0xf4, 0x90, 0xd3, - 0x1c, 0xfd, 0xa6, 0x8d, 0x69, 0x3b, 0xec, 0x94, 0xe6, 0x48, 0x7c, 0x58, 0xbf, 0x41, 0xa9, 0x98, - 0xe0, 0xfe, 0x8a, 0x65, 0xeb, 0x2b, 0x79, 0x03, 0x9b, 0x0a, 0x25, 0xa3, 0xd9, 0x90, 0x9b, 0x7c, - 0x84, 0xd2, 0x5f, 0xad, 0x3a, 0x54, 0xe0, 0xa9, 0xc5, 0xc8, 0x2e, 0x80, 0xba, 0x36, 0x75, 0xc4, - 0x9a, 0x8d, 0x68, 0xa9, 0x6b, 0xe3, 0xe8, 0x6d, 0x58, 0xbb, 0xa4, 0x39, 0xcb, 0x26, 0xfe, 0xba, - 0xa5, 0xdc, 0x2d, 0x1c, 0x40, 0x73, 0x70, 0x76, 0x31, 0xb7, 0x83, 0xb7, 0x60, 0x87, 0xa9, 0x01, - 0x1b, 0x33, 0x03, 0x86, 0x7f, 0x3c, 0xd8, 0x1a, 0x48, 0xa4, 0x1a, 0xcf, 0x51, 0xde, 0xa0, 0x8c, - 0xf1, 0x97, 0x41, 0xa5, 0xc9, 0x27, 0x20, 0xca, 0x4a, 0x38, 0x64, 0x77, 0x1a, 0xda, 0xda, 0xed, - 0xfe, 0x76, 0xaf, 0x14, 0x7c, 0x4e, 0xe1, 0xb8, 0xab, 0xe6, 0x44, 0x0f, 0xa0, 0x99, 0x14, 0xc6, - 0x36, 0x6d, 0xf7, 0x37, 0x6c, 0xde, 0xe0, 0xec, 0x22, 0x2e, 0x41, 0x12, 0xc0, 0xc6, 0x95, 0x50, - 0x7a, 0x4a, 0xd4, 0xdb, 0x7b, 0xf8, 0x1e, 0xd6, 0x8f, 0xd3, 0x54, 0xa2, 0x52, 0xa5, 0x6f, 0x7a, - 0x52, 0x60, 0xed, 0x5b, 0x79, 0x2e, 0xf7, 0xa1, 0x15, 0x5d, 0xef, 0xe3, 0xae, 0xe1, 0x0d, 0x3c, - 0x9b, 0x5d, 0x47, 0x15, 0x82, 0x2b, 0x2c, 0xab, 0xfc, 0x66, 0xae, 0xca, 0x46, 0x6c, 0xcf, 0xa5, - 0x39, 0x8c, 0x2b, 0x4c, 0x8c, 0xc4, 0xa1, 0x25, 0x1b, 0x96, 0xec, 0xd4, 0xe0, 0xf7, 0x32, 0x68, - 0x1f, 0x9e, 0x48, 0x1c, 0x09, 0xa1, 0x87, 0x9a, 0xe5, 0x28, 0x8c, 0xb6, 0xb3, 0x7a, 0xf1, 0x66, - 0x85, 0x7e, 0xab, 0xc0, 0xb0, 0x07, 0xfe, 0x57, 0x2a, 0xaf, 0xab, 0xae, 0xc7, 0xaa, 0x4c, 0x4d, - 0x6b, 0x2d, 0x17, 0xbc, 0xbc, 0xf0, 0x00, 0x9e, 0x7e, 0x46, 0x2a, 0xf5, 0x08, 0xa9, 0x7e, 0x28, - 0xee, 0x05, 0xec, 0x2c, 0xa8, 0x5b, 0x2d, 0x15, 0x6e, 0x41, 0x77, 0xaa, 0x88, 0x03, 0x7f, 0xc2, - 0xab, 0x18, 0x13, 0xc1, 0x13, 0x96, 0x39, 0x11, 0x9c, 0x92, 0xa8, 0x1e, 0x68, 0x44, 0x0e, 0xa6, - 0x25, 0x6d, 0x1e, 0xb6, 0xfb, 0x1d, 0xeb, 0x96, 0xcb, 0xbd, 0x13, 0x38, 0x84, 0xbd, 0xe5, 0xe5, - 0xab, 0x11, 0xfa, 0x7f, 0x1b, 0xb0, 0x7a, 0x3c, 0x46, 0xae, 0xc9, 0x00, 0x3a, 0xd3, 0x76, 0x10, - 0xbf, 0x7a, 0x02, 0xf3, 0x0f, 0x2e, 0xd8, 0x59, 0xc0, 0x38, 0xef, 0x62, 0xe8, 0xce, 0x69, 0x40, - 0x76, 0x6d, 0xfc, 0x32, 0xcd, 0x83, 0x97, 0xcb, 0x68, 0x57, 0x73, 0x0c, 0xfe, 0xb2, 0x35, 0xc8, - 0x5b, 0x9b, 0xfb, 0x88, 0x88, 0xc1, 0xfe, 0x23, 0x51, 0xae, 0xd1, 0x07, 0x68, 0xdd, 0x7a, 0x44, - 0x9e, 0xdb, 0x9c, 0xfb, 0xc6, 0x07, 0xdb, 0xf7, 0xe1, 0x2a, 0xf7, 0xe3, 0x97, 0x1f, 0x27, 0x63, - 0xa6, 0xaf, 0xcc, 0xa8, 0x97, 0x88, 0x3c, 0xd2, 0x34, 0x13, 0xea, 0xa8, 0xfa, 0xc6, 0x54, 0xa4, - 0x58, 0x8a, 0x52, 0x44, 0xb4, 0x28, 0xa2, 0x1c, 0x35, 0xcd, 0x8e, 0x12, 0xc1, 0xb5, 0x14, 0x59, - 0x86, 0xf2, 0x28, 0xa7, 0x9c, 0x8e, 0x51, 0x46, 0x8c, 0x6b, 0x94, 0x9c, 0x66, 0x11, 0x2d, 0xd8, - 0x68, 0xcd, 0xfe, 0x21, 0xdf, 0xfd, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x22, 0xab, 0xa4, 0x2e, - 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ context.Context - _ grpc.ClientConnInterface -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AgentClient is the client API for Agent service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AgentClient interface { - CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) - MarkServerAsWiped(ctx context.Context, in *MarkServerAsWipedRequest, opts ...grpc.CallOption) (*MarkServerAsWipedResponse, error) - ReconcileServerAddresses(ctx context.Context, in *ReconcileServerAddressesRequest, opts ...grpc.CallOption) (*ReconcileServerAddressesResponse, error) - Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) -} - -type agentClient struct { - cc grpc.ClientConnInterface + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func NewAgentClient(cc grpc.ClientConnInterface) AgentClient { - return &agentClient{cc} -} - -func (c *agentClient) CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) { - out := new(CreateServerResponse) - err := c.cc.Invoke(ctx, "/api.Agent/CreateServer", in, out, opts...) - if err != nil { - return nil, err +func (x *ReconcileServerAddressesResponse) Reset() { + *x = ReconcileServerAddressesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return out, nil } -func (c *agentClient) MarkServerAsWiped(ctx context.Context, in *MarkServerAsWipedRequest, opts ...grpc.CallOption) (*MarkServerAsWipedResponse, error) { - out := new(MarkServerAsWipedResponse) - err := c.cc.Invoke(ctx, "/api.Agent/MarkServerAsWiped", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (x *ReconcileServerAddressesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *agentClient) ReconcileServerAddresses(ctx context.Context, in *ReconcileServerAddressesRequest, opts ...grpc.CallOption) (*ReconcileServerAddressesResponse, error) { - out := new(ReconcileServerAddressesResponse) - err := c.cc.Invoke(ctx, "/api.Agent/ReconcileServerAddresses", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +func (*ReconcileServerAddressesResponse) ProtoMessage() {} -func (c *agentClient) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) { - out := new(HeartbeatResponse) - err := c.cc.Invoke(ctx, "/api.Agent/Heartbeat", in, out, opts...) - if err != nil { - return nil, err +func (x *ReconcileServerAddressesResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return out, nil -} - -// AgentServer is the server API for Agent service. -type AgentServer interface { - CreateServer(context.Context, *CreateServerRequest) (*CreateServerResponse, error) - MarkServerAsWiped(context.Context, *MarkServerAsWipedRequest) (*MarkServerAsWipedResponse, error) - ReconcileServerAddresses(context.Context, *ReconcileServerAddressesRequest) (*ReconcileServerAddressesResponse, error) - Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error) -} - -// UnimplementedAgentServer can be embedded to have forward compatible implementations. -type UnimplementedAgentServer struct{} - -func (*UnimplementedAgentServer) CreateServer(ctx context.Context, req *CreateServerRequest) (*CreateServerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateServer not implemented") -} - -func (*UnimplementedAgentServer) MarkServerAsWiped(ctx context.Context, req *MarkServerAsWipedRequest) (*MarkServerAsWipedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MarkServerAsWiped not implemented") + return mi.MessageOf(x) } -func (*UnimplementedAgentServer) ReconcileServerAddresses(ctx context.Context, req *ReconcileServerAddressesRequest) (*ReconcileServerAddressesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReconcileServerAddresses not implemented") -} - -func (*UnimplementedAgentServer) Heartbeat(ctx context.Context, req *HeartbeatRequest) (*HeartbeatResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") -} - -func RegisterAgentServer(s *grpc.Server, srv AgentServer) { - s.RegisterService(&_Agent_serviceDesc, srv) -} - -func _Agent_CreateServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateServerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).CreateServer(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Agent/CreateServer", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).CreateServer(ctx, req.(*CreateServerRequest)) - } - return interceptor(ctx, in, info, handler) +// Deprecated: Use ReconcileServerAddressesResponse.ProtoReflect.Descriptor instead. +func (*ReconcileServerAddressesResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{10} +} + +var File_api_proto protoreflect.FileDescriptor + +var file_api_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, + 0x22, 0xe4, 0x01, 0x0a, 0x11, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, + 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6b, 0x75, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6b, 0x75, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x22, 0x43, 0x0a, 0x03, 0x43, 0x50, 0x55, 0x12, 0x22, + 0x0a, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, + 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x12, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x03, 0x63, + 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, + 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x37, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x76, 0x0a, 0x14, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x69, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x04, 0x77, 0x69, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x65, + 0x63, 0x75, 0x72, 0x65, 0x5f, 0x77, 0x69, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x57, 0x69, 0x70, 0x65, 0x12, 0x25, 0x0a, + 0x0e, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2e, 0x0a, 0x18, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x41, 0x73, 0x57, 0x69, 0x70, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x75, 0x75, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x10, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0x1b, 0x0a, 0x19, + 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x73, 0x57, 0x69, 0x70, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x48, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, + 0x0a, 0x1f, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x22, 0x0a, + 0x20, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xc5, 0x02, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x52, 0x0a, 0x11, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x73, + 0x57, 0x69, 0x70, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x72, 0x6b, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x73, 0x57, 0x69, 0x70, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x73, 0x57, 0x69, 0x70, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x18, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x63, + 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, + 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x2d, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x72, 0x6f, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, + 0x72, 0x2d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func _Agent_MarkServerAsWiped_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MarkServerAsWipedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).MarkServerAsWiped(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Agent/MarkServerAsWiped", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).MarkServerAsWiped(ctx, req.(*MarkServerAsWipedRequest)) - } - return interceptor(ctx, in, info, handler) -} +var ( + file_api_proto_rawDescOnce sync.Once + file_api_proto_rawDescData = file_api_proto_rawDesc +) -func _Agent_ReconcileServerAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReconcileServerAddressesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).ReconcileServerAddresses(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Agent/ReconcileServerAddresses", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).ReconcileServerAddresses(ctx, req.(*ReconcileServerAddressesRequest)) - } - return interceptor(ctx, in, info, handler) +func file_api_proto_rawDescGZIP() []byte { + file_api_proto_rawDescOnce.Do(func() { + file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) + }) + return file_api_proto_rawDescData } -func _Agent_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HeartbeatRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AgentServer).Heartbeat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.Agent/Heartbeat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgentServer).Heartbeat(ctx, req.(*HeartbeatRequest)) +var ( + file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 11) + file_api_proto_goTypes = []interface{}{ + (*SystemInformation)(nil), // 0: api.SystemInformation + (*CPU)(nil), // 1: api.CPU + (*CreateServerRequest)(nil), // 2: api.CreateServerRequest + (*Address)(nil), // 3: api.Address + (*CreateServerResponse)(nil), // 4: api.CreateServerResponse + (*MarkServerAsWipedRequest)(nil), // 5: api.MarkServerAsWipedRequest + (*HeartbeatRequest)(nil), // 6: api.HeartbeatRequest + (*MarkServerAsWipedResponse)(nil), // 7: api.MarkServerAsWipedResponse + (*HeartbeatResponse)(nil), // 8: api.HeartbeatResponse + (*ReconcileServerAddressesRequest)(nil), // 9: api.ReconcileServerAddressesRequest + (*ReconcileServerAddressesResponse)(nil), // 10: api.ReconcileServerAddressesResponse } - return interceptor(ctx, in, info, handler) -} +) -var _Agent_serviceDesc = grpc.ServiceDesc{ - ServiceName: "api.Agent", - HandlerType: (*AgentServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateServer", - Handler: _Agent_CreateServer_Handler, - }, - { - MethodName: "MarkServerAsWiped", - Handler: _Agent_MarkServerAsWiped_Handler, - }, - { - MethodName: "ReconcileServerAddresses", - Handler: _Agent_ReconcileServerAddresses_Handler, - }, - { - MethodName: "Heartbeat", - Handler: _Agent_Heartbeat_Handler, +var file_api_proto_depIdxs = []int32{ + 0, // 0: api.CreateServerRequest.system_information:type_name -> api.SystemInformation + 1, // 1: api.CreateServerRequest.cpu:type_name -> api.CPU + 3, // 2: api.ReconcileServerAddressesRequest.address:type_name -> api.Address + 2, // 3: api.Agent.CreateServer:input_type -> api.CreateServerRequest + 5, // 4: api.Agent.MarkServerAsWiped:input_type -> api.MarkServerAsWipedRequest + 9, // 5: api.Agent.ReconcileServerAddresses:input_type -> api.ReconcileServerAddressesRequest + 6, // 6: api.Agent.Heartbeat:input_type -> api.HeartbeatRequest + 4, // 7: api.Agent.CreateServer:output_type -> api.CreateServerResponse + 7, // 8: api.Agent.MarkServerAsWiped:output_type -> api.MarkServerAsWipedResponse + 10, // 9: api.Agent.ReconcileServerAddresses:output_type -> api.ReconcileServerAddressesResponse + 8, // 10: api.Agent.Heartbeat:output_type -> api.HeartbeatResponse + 7, // [7:11] is the sub-list for method output_type + 3, // [3:7] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_api_proto_init() } +func file_api_proto_init() { + if File_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SystemInformation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CPU); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateServerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Address); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateServerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkServerAsWipedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkServerAsWipedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReconcileServerAddressesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReconcileServerAddressesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", + GoTypes: file_api_proto_goTypes, + DependencyIndexes: file_api_proto_depIdxs, + MessageInfos: file_api_proto_msgTypes, + }.Build() + File_api_proto = out.File + file_api_proto_rawDesc = nil + file_api_proto_goTypes = nil + file_api_proto_depIdxs = nil } diff --git a/app/metal-controller-manager/internal/api/api_grpc.pb.go b/app/metal-controller-manager/internal/api/api_grpc.pb.go new file mode 100644 index 000000000..311de9b51 --- /dev/null +++ b/app/metal-controller-manager/internal/api/api_grpc.pb.go @@ -0,0 +1,212 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AgentClient is the client API for Agent service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AgentClient interface { + CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) + MarkServerAsWiped(ctx context.Context, in *MarkServerAsWipedRequest, opts ...grpc.CallOption) (*MarkServerAsWipedResponse, error) + ReconcileServerAddresses(ctx context.Context, in *ReconcileServerAddressesRequest, opts ...grpc.CallOption) (*ReconcileServerAddressesResponse, error) + Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) +} + +type agentClient struct { + cc grpc.ClientConnInterface +} + +func NewAgentClient(cc grpc.ClientConnInterface) AgentClient { + return &agentClient{cc} +} + +func (c *agentClient) CreateServer(ctx context.Context, in *CreateServerRequest, opts ...grpc.CallOption) (*CreateServerResponse, error) { + out := new(CreateServerResponse) + err := c.cc.Invoke(ctx, "/api.Agent/CreateServer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentClient) MarkServerAsWiped(ctx context.Context, in *MarkServerAsWipedRequest, opts ...grpc.CallOption) (*MarkServerAsWipedResponse, error) { + out := new(MarkServerAsWipedResponse) + err := c.cc.Invoke(ctx, "/api.Agent/MarkServerAsWiped", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentClient) ReconcileServerAddresses(ctx context.Context, in *ReconcileServerAddressesRequest, opts ...grpc.CallOption) (*ReconcileServerAddressesResponse, error) { + out := new(ReconcileServerAddressesResponse) + err := c.cc.Invoke(ctx, "/api.Agent/ReconcileServerAddresses", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentClient) Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error) { + out := new(HeartbeatResponse) + err := c.cc.Invoke(ctx, "/api.Agent/Heartbeat", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgentServer is the server API for Agent service. +// All implementations must embed UnimplementedAgentServer +// for forward compatibility +type AgentServer interface { + CreateServer(context.Context, *CreateServerRequest) (*CreateServerResponse, error) + MarkServerAsWiped(context.Context, *MarkServerAsWipedRequest) (*MarkServerAsWipedResponse, error) + ReconcileServerAddresses(context.Context, *ReconcileServerAddressesRequest) (*ReconcileServerAddressesResponse, error) + Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error) + mustEmbedUnimplementedAgentServer() +} + +// UnimplementedAgentServer must be embedded to have forward compatible implementations. +type UnimplementedAgentServer struct{} + +func (UnimplementedAgentServer) CreateServer(context.Context, *CreateServerRequest) (*CreateServerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateServer not implemented") +} + +func (UnimplementedAgentServer) MarkServerAsWiped(context.Context, *MarkServerAsWipedRequest) (*MarkServerAsWipedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MarkServerAsWiped not implemented") +} + +func (UnimplementedAgentServer) ReconcileServerAddresses(context.Context, *ReconcileServerAddressesRequest) (*ReconcileServerAddressesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReconcileServerAddresses not implemented") +} + +func (UnimplementedAgentServer) Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Heartbeat not implemented") +} +func (UnimplementedAgentServer) mustEmbedUnimplementedAgentServer() {} + +// UnsafeAgentServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgentServer will +// result in compilation errors. +type UnsafeAgentServer interface { + mustEmbedUnimplementedAgentServer() +} + +func RegisterAgentServer(s grpc.ServiceRegistrar, srv AgentServer) { + s.RegisterService(&Agent_ServiceDesc, srv) +} + +func _Agent_CreateServer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateServerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServer).CreateServer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Agent/CreateServer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServer).CreateServer(ctx, req.(*CreateServerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agent_MarkServerAsWiped_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MarkServerAsWipedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServer).MarkServerAsWiped(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Agent/MarkServerAsWiped", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServer).MarkServerAsWiped(ctx, req.(*MarkServerAsWipedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agent_ReconcileServerAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReconcileServerAddressesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServer).ReconcileServerAddresses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Agent/ReconcileServerAddresses", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServer).ReconcileServerAddresses(ctx, req.(*ReconcileServerAddressesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agent_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HeartbeatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServer).Heartbeat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Agent/Heartbeat", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServer).Heartbeat(ctx, req.(*HeartbeatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Agent_ServiceDesc is the grpc.ServiceDesc for Agent service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Agent_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.Agent", + HandlerType: (*AgentServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateServer", + Handler: _Agent_CreateServer_Handler, + }, + { + MethodName: "MarkServerAsWiped", + Handler: _Agent_MarkServerAsWiped_Handler, + }, + { + MethodName: "ReconcileServerAddresses", + Handler: _Agent_ReconcileServerAddresses_Handler, + }, + { + MethodName: "Heartbeat", + Handler: _Agent_Heartbeat_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/app/metal-controller-manager/internal/ipxe/ipxe_server.go b/app/metal-controller-manager/internal/ipxe/ipxe_server.go index f831cff27..67da9f4a7 100644 --- a/app/metal-controller-manager/internal/ipxe/ipxe_server.go +++ b/app/metal-controller-manager/internal/ipxe/ipxe_server.go @@ -37,7 +37,7 @@ var ( ) const bootFile = `#!ipxe -chain ipxe?uuid=${uuid}&mac=${mac:hexhyp}&domain=${domain}&hostname=${hostname}&serial=${serial} +chain ipxe?uuid=${uuid}&mac=${mac:hexhyp}&domain=${domain}&hostname=${hostname}&serial=${serial}&arch=${buildarch} ` var ipxeTemplate = template.Must(template.New("iPXE config").Parse(`#!ipxe @@ -72,6 +72,15 @@ func ipxeHandler(w http.ResponseWriter, r *http.Request) { uuid := labels["uuid"] + var arch string + + switch labels["arch"] { + case "arm64": + arch = "arm64" + default: + arch = "amd64" + } + server, serverBinding, err := lookupServer(uuid) if err != nil { log.Printf("Error looking up server: %v", err) @@ -80,7 +89,7 @@ func ipxeHandler(w http.ResponseWriter, r *http.Request) { return } - env, err := newEnvironment(server, serverBinding) + env, err := newEnvironment(server, serverBinding, arch) if err != nil { if errors.Is(err, ErrBootFromDisk) { log.Printf("Server %q booting from disk", uuid) @@ -235,14 +244,14 @@ func lookupServer(uuid string) (*metalv1alpha1.Server, *infrav1.ServerBinding, e // newEnvironment handles which env CRD we'll respect for a given server. // specied in the server spec overrides everything, specified in the server class overrides default, default is default :). -func newEnvironment(server *metalv1alpha1.Server, serverBinding *infrav1.ServerBinding) (env *metalv1alpha1.Environment, err error) { +func newEnvironment(server *metalv1alpha1.Server, serverBinding *infrav1.ServerBinding, arch string) (env *metalv1alpha1.Environment, err error) { // NB: The order of this switch statement is important. It defines the // precedence of which environment to boot. switch { case server == nil: - return newAgentEnvironment(), nil + return newAgentEnvironment(arch), nil case serverBinding == nil && !server.Status.IsClean: - return newAgentEnvironment(), nil + return newAgentEnvironment(arch), nil case serverBinding == nil: return nil, ErrNotInUse case conditions.Has(server, metalv1alpha1.ConditionPXEBooted) && !server.Spec.PXEBootAlways: @@ -273,7 +282,7 @@ func newEnvironment(server *metalv1alpha1.Server, serverBinding *infrav1.ServerB return env, nil } -func newAgentEnvironment() *metalv1alpha1.Environment { +func newAgentEnvironment(arch string) *metalv1alpha1.Environment { args := []string{ "initrd=initramfs.xz", "page_poison=1", @@ -302,7 +311,7 @@ func newAgentEnvironment() *metalv1alpha1.Environment { env := &metalv1alpha1.Environment{ ObjectMeta: metav1.ObjectMeta{ - Name: "agent", + Name: fmt.Sprintf("agent-%s", arch), }, Spec: metalv1alpha1.EnvironmentSpec{ Kernel: metalv1alpha1.Kernel{ diff --git a/go.mod b/go.mod index a3db5946f..79f6dc126 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v0.2.1-0.20200730175230-ee2de8da5be6 github.com/go-logr/zapr v0.2.0 // indirect - github.com/golang/protobuf v1.4.3 github.com/google/go-cmp v0.5.4 // indirect github.com/hashicorp/go-multierror v1.1.0 github.com/onsi/ginkgo v1.15.0 @@ -29,6 +28,7 @@ require ( golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 golang.org/x/sys v0.0.0-20210112080510-489259a85091 google.golang.org/grpc v1.36.0 + google.golang.org/protobuf v1.25.0 k8s.io/api v0.19.3 k8s.io/apiextensions-apiserver v0.19.1 k8s.io/apimachinery v0.19.3