From ed26122ce0cccd7812e35c351666ca845154dfb9 Mon Sep 17 00:00:00 2001 From: Artem Chernyshev Date: Fri, 31 May 2024 21:05:58 +0300 Subject: [PATCH] fix: implement the controller for handling machine status snapshot Make the controller run tasks that can collect machine status from each machine. Instead of changing the `MachineStatusSnapshot` directly in the siderolink events handler pass these events to the controller through the channel, so that all events are handled in the same place. If either event comes from siderolink or if task runner gets the machine status it updates the `MachineStatusSnapshot` resource. Signed-off-by: Artem Chernyshev --- client/api/omni/specs/omni.pb.go | 677 ++++++++---------- client/api/omni/specs/omni.proto | 7 +- client/api/omni/specs/omni_vtproto.pb.go | 330 --------- cmd/omni/main.go | 5 +- frontend/src/api/omni/specs/omni.pb.ts | 6 - internal/backend/dns/service_test.go | 2 + internal/backend/grpc/grpc_test.go | 4 +- .../omni/controllers/helpers/helpers.go | 59 ++ .../omni/cert_refresh_tick_test.go | 2 + .../omni/cluster_bootstrap_status_test.go | 2 + .../controllers/omni/cluster_endpoint_test.go | 2 + .../omni/cluster_kubernetes_nodes_test.go | 2 + .../omni/cluster_loadbalancer_test.go | 2 + .../cluster_machine_config_status_test.go | 2 + .../omni/cluster_machine_config_test.go | 2 + .../omni/cluster_machine_status_test.go | 2 + .../controllers/omni/cluster_status_test.go | 2 + .../omni/controllers/omni/cluster_test.go | 2 + .../omni/controllers/omni/etcd_backup_test.go | 2 + .../omni/image_pull_status_test.go | 2 + .../omni/internal/task/machine/helpers.go | 20 + .../omni/internal/task/machine/machine.go | 18 +- .../omni/internal/task/machine/poll.go | 71 -- .../controllers/omni/internal/task/runner.go | 31 + .../omni/internal/task/snapshot/snapshot.go | 217 ++++++ .../omni/controllers/omni/key_pruner_test.go | 2 + .../omni/controllers/omni/kubeconfig_test.go | 2 + .../omni/kubernetes_node_audit_test.go | 2 + .../controllers/omni/loadbalancer_test.go | 2 + .../controllers/omni/machine_cleanup_test.go | 2 + .../omni/machine_extensions_test.go | 2 + .../controllers/omni/machine_labels_test.go | 2 + .../omni/machine_set_etcd_audit_test.go | 2 + .../omni/machine_set_status_test.go | 2 + .../omni/controllers/omni/machine_status.go | 4 - .../omni/machine_status_link_test.go | 2 + .../omni/machine_status_snapshot.go | 241 +++++++ .../omni/machine_status_snapshot_test.go | 106 +++ .../controllers/omni/machine_status_test.go | 2 + .../omni/controllers/omni/machine_test.go | 2 + .../omni/maintenance_config_patch_test.go | 2 + .../omni/controllers/omni/omni_test.go | 2 +- .../redacted_cluster_machine_config_test.go | 2 + .../omni/schematic_configuration_test.go | 2 + .../omni/controllers/omni/secrets_test.go | 2 + .../controllers/omni/talos_extensions_test.go | 2 + .../omni/talos_upgrade_status_test.go | 2 + .../omni/controllers/omni/talosconfig_test.go | 2 + .../backend/runtime/omni/migration/manager.go | 4 + .../runtime/omni/migration/migration_test.go | 45 ++ .../runtime/omni/migration/migrations.go | 27 + internal/backend/runtime/omni/omni.go | 6 +- internal/backend/runtime/omni/omni_test.go | 2 +- .../backend/runtime/talos/clients_test.go | 2 + internal/backend/server.go | 9 +- .../pkg/auth/interceptor/signature_test.go | 2 + internal/pkg/machinestatus/handler.go | 170 +---- internal/pkg/machinestatus/handler_test.go | 168 ----- internal/pkg/siderolink/logstorage_test.go | 2 + internal/pkg/siderolink/siderolink_test.go | 13 +- 60 files changed, 1151 insertions(+), 1161 deletions(-) create mode 100644 internal/backend/runtime/omni/controllers/omni/internal/task/snapshot/snapshot.go create mode 100644 internal/backend/runtime/omni/controllers/omni/machine_status_snapshot.go create mode 100644 internal/backend/runtime/omni/controllers/omni/machine_status_snapshot_test.go delete mode 100644 internal/pkg/machinestatus/handler_test.go diff --git a/client/api/omni/specs/omni.pb.go b/client/api/omni/specs/omni.pb.go index 37b940d6..09d4d128 100644 --- a/client/api/omni/specs/omni.pb.go +++ b/client/api/omni/specs/omni.pb.go @@ -901,9 +901,8 @@ type MachineStatusSpec struct { ImageLabels map[string]string `protobuf:"bytes,13,rep,name=image_labels,json=imageLabels,proto3" json:"image_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Schematic *MachineStatusSpec_Schematic `protobuf:"bytes,14,opt,name=schematic,proto3" json:"schematic,omitempty"` // InitialTalosVersion is set only once when the machine first joined Omni. - InitialTalosVersion string `protobuf:"bytes,16,opt,name=initial_talos_version,json=initialTalosVersion,proto3" json:"initial_talos_version,omitempty"` - TalosMachineStatus *MachineStatusSpec_TalosMachineStatus `protobuf:"bytes,17,opt,name=talos_machine_status,json=talosMachineStatus,proto3" json:"talos_machine_status,omitempty"` - SecureBootStatus *MachineStatusSpec_SecureBootStatus `protobuf:"bytes,18,opt,name=secure_boot_status,json=secureBootStatus,proto3" json:"secure_boot_status,omitempty"` + InitialTalosVersion string `protobuf:"bytes,16,opt,name=initial_talos_version,json=initialTalosVersion,proto3" json:"initial_talos_version,omitempty"` + SecureBootStatus *MachineStatusSpec_SecureBootStatus `protobuf:"bytes,18,opt,name=secure_boot_status,json=secureBootStatus,proto3" json:"secure_boot_status,omitempty"` } func (x *MachineStatusSpec) Reset() { @@ -1029,13 +1028,6 @@ func (x *MachineStatusSpec) GetInitialTalosVersion() string { return "" } -func (x *MachineStatusSpec) GetTalosMachineStatus() *MachineStatusSpec_TalosMachineStatus { - if x != nil { - return x.TalosMachineStatus - } - return nil -} - func (x *MachineStatusSpec) GetSecureBootStatus() *MachineStatusSpec_SecureBootStatus { if x != nil { return x.SecureBootStatus @@ -5712,61 +5704,6 @@ func (x *MachineStatusSpec_SecureBootStatus) GetEnabled() bool { return false } -type MachineStatusSpec_TalosMachineStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status *machine.MachineStatusEvent `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (x *MachineStatusSpec_TalosMachineStatus) Reset() { - *x = MachineStatusSpec_TalosMachineStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[74] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MachineStatusSpec_TalosMachineStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MachineStatusSpec_TalosMachineStatus) ProtoMessage() {} - -func (x *MachineStatusSpec_TalosMachineStatus) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[74] - 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) -} - -// Deprecated: Use MachineStatusSpec_TalosMachineStatus.ProtoReflect.Descriptor instead. -func (*MachineStatusSpec_TalosMachineStatus) Descriptor() ([]byte, []int) { - return file_omni_specs_omni_proto_rawDescGZIP(), []int{1, 5} -} - -func (x *MachineStatusSpec_TalosMachineStatus) GetStatus() *machine.MachineStatusEvent { - if x != nil { - return x.Status - } - return nil -} - -func (x *MachineStatusSpec_TalosMachineStatus) GetUpdatedAt() *timestamppb.Timestamp { - if x != nil { - return x.UpdatedAt - } - return nil -} - // Processor describes machine CPU. type MachineStatusSpec_HardwareStatus_Processor struct { state protoimpl.MessageState @@ -5788,7 +5725,7 @@ type MachineStatusSpec_HardwareStatus_Processor struct { func (x *MachineStatusSpec_HardwareStatus_Processor) Reset() { *x = MachineStatusSpec_HardwareStatus_Processor{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[76] + mi := &file_omni_specs_omni_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5801,7 +5738,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[76] + mi := &file_omni_specs_omni_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5867,7 +5804,7 @@ type MachineStatusSpec_HardwareStatus_MemoryModule struct { func (x *MachineStatusSpec_HardwareStatus_MemoryModule) Reset() { *x = MachineStatusSpec_HardwareStatus_MemoryModule{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[77] + mi := &file_omni_specs_omni_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5880,7 +5817,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[77] + mi := &file_omni_specs_omni_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5941,7 +5878,7 @@ type MachineStatusSpec_HardwareStatus_BlockDevice struct { func (x *MachineStatusSpec_HardwareStatus_BlockDevice) Reset() { *x = MachineStatusSpec_HardwareStatus_BlockDevice{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[78] + mi := &file_omni_specs_omni_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5954,7 +5891,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[78] + mi := &file_omni_specs_omni_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6061,7 +5998,7 @@ type MachineStatusSpec_NetworkStatus_NetworkLinkStatus struct { func (x *MachineStatusSpec_NetworkStatus_NetworkLinkStatus) Reset() { *x = MachineStatusSpec_NetworkStatus_NetworkLinkStatus{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[79] + mi := &file_omni_specs_omni_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6074,7 +6011,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[79] + mi := &file_omni_specs_omni_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6137,7 +6074,7 @@ type MachineStatusSpec_Schematic_Overlay struct { func (x *MachineStatusSpec_Schematic_Overlay) Reset() { *x = MachineStatusSpec_Schematic_Overlay{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[80] + mi := &file_omni_specs_omni_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6150,7 +6087,7 @@ func (x *MachineStatusSpec_Schematic_Overlay) String() string { func (*MachineStatusSpec_Schematic_Overlay) ProtoMessage() {} func (x *MachineStatusSpec_Schematic_Overlay) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[80] + mi := &file_omni_specs_omni_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6192,7 +6129,7 @@ type MachineStatusSpec_Schematic_MetaValue struct { func (x *MachineStatusSpec_Schematic_MetaValue) Reset() { *x = MachineStatusSpec_Schematic_MetaValue{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[81] + mi := &file_omni_specs_omni_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6205,7 +6142,7 @@ func (x *MachineStatusSpec_Schematic_MetaValue) String() string { func (*MachineStatusSpec_Schematic_MetaValue) ProtoMessage() {} func (x *MachineStatusSpec_Schematic_MetaValue) ProtoReflect() protoreflect.Message { - mi := &file_omni_specs_omni_proto_msgTypes[81] + mi := &file_omni_specs_omni_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6249,7 +6186,7 @@ type ClusterSpec_Features struct { func (x *ClusterSpec_Features) Reset() { *x = ClusterSpec_Features{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[82] + mi := &file_omni_specs_omni_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6262,7 +6199,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[82] + mi := &file_omni_specs_omni_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6309,7 +6246,7 @@ type MachineSetSpec_MachineClass struct { func (x *MachineSetSpec_MachineClass) Reset() { *x = MachineSetSpec_MachineClass{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[83] + mi := &file_omni_specs_omni_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6322,7 +6259,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[83] + mi := &file_omni_specs_omni_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6375,7 +6312,7 @@ type MachineSetSpec_BootstrapSpec struct { func (x *MachineSetSpec_BootstrapSpec) Reset() { *x = MachineSetSpec_BootstrapSpec{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[84] + mi := &file_omni_specs_omni_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6388,7 +6325,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[84] + mi := &file_omni_specs_omni_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6432,7 +6369,7 @@ type MachineSetSpec_RollingUpdateStrategyConfig struct { func (x *MachineSetSpec_RollingUpdateStrategyConfig) Reset() { *x = MachineSetSpec_RollingUpdateStrategyConfig{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[85] + mi := &file_omni_specs_omni_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6445,7 +6382,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[85] + mi := &file_omni_specs_omni_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6482,7 +6419,7 @@ type MachineSetSpec_UpdateStrategyConfig struct { func (x *MachineSetSpec_UpdateStrategyConfig) Reset() { *x = MachineSetSpec_UpdateStrategyConfig{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[86] + mi := &file_omni_specs_omni_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6495,7 +6432,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[86] + mi := &file_omni_specs_omni_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6532,7 +6469,7 @@ type ControlPlaneStatusSpec_Condition struct { func (x *ControlPlaneStatusSpec_Condition) Reset() { *x = ControlPlaneStatusSpec_Condition{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[87] + mi := &file_omni_specs_omni_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6545,7 +6482,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[87] + mi := &file_omni_specs_omni_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6602,7 +6539,7 @@ type KubernetesStatusSpec_NodeStatus struct { func (x *KubernetesStatusSpec_NodeStatus) Reset() { *x = KubernetesStatusSpec_NodeStatus{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[88] + mi := &file_omni_specs_omni_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6615,7 +6552,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[88] + mi := &file_omni_specs_omni_proto_msgTypes[87] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6665,7 +6602,7 @@ type KubernetesStatusSpec_StaticPodStatus struct { func (x *KubernetesStatusSpec_StaticPodStatus) Reset() { *x = KubernetesStatusSpec_StaticPodStatus{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[89] + mi := &file_omni_specs_omni_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6678,7 +6615,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[89] + mi := &file_omni_specs_omni_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6727,7 +6664,7 @@ type KubernetesStatusSpec_NodeStaticPods struct { func (x *KubernetesStatusSpec_NodeStaticPods) Reset() { *x = KubernetesStatusSpec_NodeStaticPods{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[90] + mi := &file_omni_specs_omni_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6740,7 +6677,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[90] + mi := &file_omni_specs_omni_proto_msgTypes[89] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6783,7 +6720,7 @@ type KubernetesUsageSpec_Quantity struct { func (x *KubernetesUsageSpec_Quantity) Reset() { *x = KubernetesUsageSpec_Quantity{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[91] + mi := &file_omni_specs_omni_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6796,7 +6733,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[91] + mi := &file_omni_specs_omni_proto_msgTypes[90] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6845,7 +6782,7 @@ type KubernetesUsageSpec_Pod struct { func (x *KubernetesUsageSpec_Pod) Reset() { *x = KubernetesUsageSpec_Pod{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[92] + mi := &file_omni_specs_omni_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6858,7 +6795,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[92] + mi := &file_omni_specs_omni_proto_msgTypes[91] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6900,7 +6837,7 @@ type ImagePullRequestSpec_NodeImageList struct { func (x *ImagePullRequestSpec_NodeImageList) Reset() { *x = ImagePullRequestSpec_NodeImageList{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[93] + mi := &file_omni_specs_omni_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6913,7 +6850,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[93] + mi := &file_omni_specs_omni_proto_msgTypes[92] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6960,7 +6897,7 @@ type TalosExtensionsSpec_Info struct { func (x *TalosExtensionsSpec_Info) Reset() { *x = TalosExtensionsSpec_Info{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[94] + mi := &file_omni_specs_omni_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6973,7 +6910,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[94] + mi := &file_omni_specs_omni_proto_msgTypes[93] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7044,7 +6981,7 @@ type MachineExtensionsStatusSpec_Item struct { func (x *MachineExtensionsStatusSpec_Item) Reset() { *x = MachineExtensionsStatusSpec_Item{} if protoimpl.UnsafeEnabled { - mi := &file_omni_specs_omni_proto_msgTypes[95] + mi := &file_omni_specs_omni_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7057,7 +6994,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[95] + mi := &file_omni_specs_omni_proto_msgTypes[94] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7111,7 +7048,7 @@ var file_omni_specs_omni_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x22, 0xba, 0x18, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x08, 0x04, 0x10, 0x05, 0x22, 0xda, 0x16, 0x0a, 0x11, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, @@ -7154,160 +7091,146 @@ var file_omni_specs_omni_proto_rawDesc = []byte{ 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x12, 0x32, 0x0a, 0x15, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, - 0x14, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x5f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x70, - 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x4d, 0x61, 0x63, 0x68, 0x69, - 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, 0x74, 0x61, 0x6c, 0x6f, 0x73, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x57, 0x0a, 0x12, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, - 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, - 0x65, 0x63, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0xa9, 0x06, 0x0a, 0x0e, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, - 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x51, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x73, + 0x6c, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, + 0x12, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, + 0x70, 0x65, 0x63, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0xa9, 0x06, 0x0a, 0x0e, 0x48, 0x61, 0x72, 0x64, 0x77, + 0x61, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x51, 0x0a, 0x0a, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x5b, 0x0a, 0x0e, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, + 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, + 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x61, 0x72, 0x63, 0x68, 0x1a, 0xb1, 0x01, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, 0x68, 0x72, 0x65, 0x61, + 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x63, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, + 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, + 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x1a, 0x49, 0x0a, 0x0c, 0x4d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x69, + 0x7a, 0x65, 0x5f, 0x6d, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, 0x7a, + 0x65, 0x4d, 0x62, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xfa, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, + 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, + 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x77, 0x77, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x77, 0x77, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x73, 0x5f, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x73, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x64, 0x69, 0x73, 0x6b, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x69, + 0x73, 0x6b, 0x1a, 0xad, 0x03, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x29, + 0x0a, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x12, 0x5d, 0x0a, 0x0d, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x1a, 0xb7, 0x01, 0x0a, 0x11, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, + 0x10, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, + 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x65, 0x65, + 0x64, 0x5f, 0x6d, 0x62, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x70, + 0x65, 0x65, 0x64, 0x4d, 0x62, 0x70, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, + 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x70, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0xf1, 0x01, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x1a, 0xc1, 0x03, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x6d, + 0x61, 0x74, 0x69, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, + 0x0a, 0x11, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x74, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x61, 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x12, 0x44, 0x0a, 0x07, 0x6f, + 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x52, - 0x0a, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x5b, 0x0a, 0x0e, 0x6d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, - 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, 0x61, - 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x4d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x6d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, - 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x48, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x61, 0x72, 0x63, 0x68, 0x1a, 0xb1, 0x01, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, - 0x74, 0x75, 0x72, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x6e, - 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x1a, 0x49, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, - 0x6f, 0x72, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x69, 0x7a, - 0x65, 0x5f, 0x6d, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, 0x7a, 0x65, - 0x4d, 0x62, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xfa, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, - 0x0a, 0x0a, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x77, 0x77, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x77, 0x77, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x75, 0x73, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x69, 0x73, - 0x6b, 0x1a, 0xad, 0x03, 0x0a, 0x0d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x29, 0x0a, - 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x73, 0x12, 0x5d, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x38, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, - 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x1a, 0xb7, 0x01, 0x0a, 0x11, 0x4e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, - 0x0a, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, - 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x70, 0x65, 0x65, 0x64, - 0x5f, 0x6d, 0x62, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x70, 0x65, - 0x65, 0x64, 0x4d, 0x62, 0x70, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x75, - 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0xf1, 0x01, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x04, 0x73, 0x70, 0x6f, 0x74, 0x1a, 0xc1, 0x03, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x74, 0x69, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x1e, 0x0a, - 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, - 0x11, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, - 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x12, 0x44, 0x0a, 0x07, 0x6f, 0x76, - 0x65, 0x72, 0x6c, 0x61, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x70, - 0x65, 0x63, 0x73, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x2e, - 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x52, 0x07, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, - 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, 0x67, - 0x73, 0x12, 0x4d, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, - 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x12, 0x17, 0x0a, 0x07, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x75, 0x6c, 0x6c, 0x49, 0x64, 0x1a, 0x33, 0x0a, 0x07, 0x4f, 0x76, 0x65, - 0x72, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x1a, 0x33, - 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0x2c, 0x0a, 0x10, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x84, 0x01, 0x0a, 0x12, 0x54, 0x61, 0x6c, 0x6f, - 0x73, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x33, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x3e, - 0x0a, 0x10, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2f, - 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x5f, 0x50, 0x4c, 0x41, 0x4e, - 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x57, 0x4f, 0x52, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x4a, - 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x0c, 0x10, 0x0d, 0x4a, 0x04, 0x08, 0x0f, 0x10, - 0x10, 0x22, 0x45, 0x0a, 0x0f, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x73, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x79, 0x52, 0x07, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, + 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x41, 0x72, + 0x67, 0x73, 0x12, 0x4d, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, + 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x70, 0x65, + 0x63, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x75, 0x6c, 0x6c, 0x49, 0x64, 0x1a, 0x33, 0x0a, 0x07, 0x4f, 0x76, + 0x65, 0x72, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x1a, + 0x33, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0x2c, 0x0a, 0x10, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x65, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x3e, 0x0a, 0x10, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2f, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, + 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x57, 0x4f, 0x52, 0x4b, 0x45, 0x52, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, + 0x04, 0x08, 0x0c, 0x10, 0x0d, 0x4a, 0x04, 0x08, 0x0f, 0x10, 0x10, 0x4a, 0x04, 0x08, 0x11, 0x10, + 0x12, 0x22, 0x45, 0x0a, 0x0f, 0x54, 0x61, 0x6c, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x70, 0x65, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x63, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, @@ -8074,7 +7997,7 @@ func file_omni_specs_omni_proto_rawDescGZIP() []byte { } var file_omni_specs_omni_proto_enumTypes = make([]protoimpl.EnumInfo, 15) -var file_omni_specs_omni_proto_msgTypes = make([]protoimpl.MessageInfo, 96) +var file_omni_specs_omni_proto_msgTypes = make([]protoimpl.MessageInfo, 95) var file_omni_specs_omni_proto_goTypes = []interface{}{ (ConfigApplyStatus)(0), // 0: specs.ConfigApplyStatus (MachineSetPhase)(0), // 1: specs.MachineSetPhase @@ -8165,105 +8088,101 @@ var file_omni_specs_omni_proto_goTypes = []interface{}{ (*MachineStatusSpec_PlatformMetadata)(nil), // 86: specs.MachineStatusSpec.PlatformMetadata (*MachineStatusSpec_Schematic)(nil), // 87: specs.MachineStatusSpec.Schematic (*MachineStatusSpec_SecureBootStatus)(nil), // 88: specs.MachineStatusSpec.SecureBootStatus - (*MachineStatusSpec_TalosMachineStatus)(nil), // 89: specs.MachineStatusSpec.TalosMachineStatus - nil, // 90: specs.MachineStatusSpec.ImageLabelsEntry - (*MachineStatusSpec_HardwareStatus_Processor)(nil), // 91: specs.MachineStatusSpec.HardwareStatus.Processor - (*MachineStatusSpec_HardwareStatus_MemoryModule)(nil), // 92: specs.MachineStatusSpec.HardwareStatus.MemoryModule - (*MachineStatusSpec_HardwareStatus_BlockDevice)(nil), // 93: specs.MachineStatusSpec.HardwareStatus.BlockDevice - (*MachineStatusSpec_NetworkStatus_NetworkLinkStatus)(nil), // 94: specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus - (*MachineStatusSpec_Schematic_Overlay)(nil), // 95: specs.MachineStatusSpec.Schematic.Overlay - (*MachineStatusSpec_Schematic_MetaValue)(nil), // 96: specs.MachineStatusSpec.Schematic.MetaValue - (*ClusterSpec_Features)(nil), // 97: specs.ClusterSpec.Features - (*MachineSetSpec_MachineClass)(nil), // 98: specs.MachineSetSpec.MachineClass - (*MachineSetSpec_BootstrapSpec)(nil), // 99: specs.MachineSetSpec.BootstrapSpec - (*MachineSetSpec_RollingUpdateStrategyConfig)(nil), // 100: specs.MachineSetSpec.RollingUpdateStrategyConfig - (*MachineSetSpec_UpdateStrategyConfig)(nil), // 101: specs.MachineSetSpec.UpdateStrategyConfig - (*ControlPlaneStatusSpec_Condition)(nil), // 102: specs.ControlPlaneStatusSpec.Condition - (*KubernetesStatusSpec_NodeStatus)(nil), // 103: specs.KubernetesStatusSpec.NodeStatus - (*KubernetesStatusSpec_StaticPodStatus)(nil), // 104: specs.KubernetesStatusSpec.StaticPodStatus - (*KubernetesStatusSpec_NodeStaticPods)(nil), // 105: specs.KubernetesStatusSpec.NodeStaticPods - (*KubernetesUsageSpec_Quantity)(nil), // 106: specs.KubernetesUsageSpec.Quantity - (*KubernetesUsageSpec_Pod)(nil), // 107: specs.KubernetesUsageSpec.Pod - (*ImagePullRequestSpec_NodeImageList)(nil), // 108: specs.ImagePullRequestSpec.NodeImageList - (*TalosExtensionsSpec_Info)(nil), // 109: specs.TalosExtensionsSpec.Info - (*MachineExtensionsStatusSpec_Item)(nil), // 110: specs.MachineExtensionsStatusSpec.Item - (*durationpb.Duration)(nil), // 111: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 112: google.protobuf.Timestamp - (*machine.MachineStatusEvent)(nil), // 113: machine.MachineStatusEvent + nil, // 89: specs.MachineStatusSpec.ImageLabelsEntry + (*MachineStatusSpec_HardwareStatus_Processor)(nil), // 90: specs.MachineStatusSpec.HardwareStatus.Processor + (*MachineStatusSpec_HardwareStatus_MemoryModule)(nil), // 91: specs.MachineStatusSpec.HardwareStatus.MemoryModule + (*MachineStatusSpec_HardwareStatus_BlockDevice)(nil), // 92: specs.MachineStatusSpec.HardwareStatus.BlockDevice + (*MachineStatusSpec_NetworkStatus_NetworkLinkStatus)(nil), // 93: specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus + (*MachineStatusSpec_Schematic_Overlay)(nil), // 94: specs.MachineStatusSpec.Schematic.Overlay + (*MachineStatusSpec_Schematic_MetaValue)(nil), // 95: specs.MachineStatusSpec.Schematic.MetaValue + (*ClusterSpec_Features)(nil), // 96: specs.ClusterSpec.Features + (*MachineSetSpec_MachineClass)(nil), // 97: specs.MachineSetSpec.MachineClass + (*MachineSetSpec_BootstrapSpec)(nil), // 98: specs.MachineSetSpec.BootstrapSpec + (*MachineSetSpec_RollingUpdateStrategyConfig)(nil), // 99: specs.MachineSetSpec.RollingUpdateStrategyConfig + (*MachineSetSpec_UpdateStrategyConfig)(nil), // 100: specs.MachineSetSpec.UpdateStrategyConfig + (*ControlPlaneStatusSpec_Condition)(nil), // 101: specs.ControlPlaneStatusSpec.Condition + (*KubernetesStatusSpec_NodeStatus)(nil), // 102: specs.KubernetesStatusSpec.NodeStatus + (*KubernetesStatusSpec_StaticPodStatus)(nil), // 103: specs.KubernetesStatusSpec.StaticPodStatus + (*KubernetesStatusSpec_NodeStaticPods)(nil), // 104: specs.KubernetesStatusSpec.NodeStaticPods + (*KubernetesUsageSpec_Quantity)(nil), // 105: specs.KubernetesUsageSpec.Quantity + (*KubernetesUsageSpec_Pod)(nil), // 106: specs.KubernetesUsageSpec.Pod + (*ImagePullRequestSpec_NodeImageList)(nil), // 107: specs.ImagePullRequestSpec.NodeImageList + (*TalosExtensionsSpec_Info)(nil), // 108: specs.TalosExtensionsSpec.Info + (*MachineExtensionsStatusSpec_Item)(nil), // 109: specs.MachineExtensionsStatusSpec.Item + (*durationpb.Duration)(nil), // 110: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 111: google.protobuf.Timestamp + (*machine.MachineStatusEvent)(nil), // 112: machine.MachineStatusEvent } var file_omni_specs_omni_proto_depIdxs = []int32{ 84, // 0: specs.MachineStatusSpec.hardware:type_name -> specs.MachineStatusSpec.HardwareStatus 85, // 1: specs.MachineStatusSpec.network:type_name -> specs.MachineStatusSpec.NetworkStatus 3, // 2: specs.MachineStatusSpec.role:type_name -> specs.MachineStatusSpec.Role 86, // 3: specs.MachineStatusSpec.platform_metadata:type_name -> specs.MachineStatusSpec.PlatformMetadata - 90, // 4: specs.MachineStatusSpec.image_labels:type_name -> specs.MachineStatusSpec.ImageLabelsEntry + 89, // 4: specs.MachineStatusSpec.image_labels:type_name -> specs.MachineStatusSpec.ImageLabelsEntry 87, // 5: specs.MachineStatusSpec.schematic:type_name -> specs.MachineStatusSpec.Schematic - 89, // 6: specs.MachineStatusSpec.talos_machine_status:type_name -> specs.MachineStatusSpec.TalosMachineStatus - 88, // 7: specs.MachineStatusSpec.secure_boot_status:type_name -> specs.MachineStatusSpec.SecureBootStatus - 97, // 8: specs.ClusterSpec.features:type_name -> specs.ClusterSpec.Features - 19, // 9: specs.ClusterSpec.backup_configuration:type_name -> specs.EtcdBackupConf - 111, // 10: specs.EtcdBackupConf.interval:type_name -> google.protobuf.Duration - 112, // 11: specs.EtcdBackupSpec.created_at:type_name -> google.protobuf.Timestamp - 111, // 12: specs.BackupDataSpec.interval:type_name -> google.protobuf.Duration - 4, // 13: specs.EtcdBackupStatusSpec.status:type_name -> specs.EtcdBackupStatusSpec.Status - 112, // 14: specs.EtcdBackupStatusSpec.last_backup_time:type_name -> google.protobuf.Timestamp - 112, // 15: specs.EtcdBackupStatusSpec.last_backup_attempt:type_name -> google.protobuf.Timestamp - 112, // 16: specs.EtcdManualBackupSpec.backup_at:type_name -> google.protobuf.Timestamp - 25, // 17: specs.EtcdBackupOverallStatusSpec.last_backup_status:type_name -> specs.EtcdBackupStatusSpec - 5, // 18: specs.ClusterMachineStatusSpec.stage:type_name -> specs.ClusterMachineStatusSpec.Stage - 0, // 19: specs.ClusterMachineStatusSpec.config_apply_status:type_name -> specs.ConfigApplyStatus - 37, // 20: specs.ClusterStatusSpec.machines:type_name -> specs.Machines - 6, // 21: specs.ClusterStatusSpec.phase:type_name -> specs.ClusterStatusSpec.Phase - 7, // 22: specs.MachineSetSpec.update_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy - 98, // 23: specs.MachineSetSpec.machine_class:type_name -> specs.MachineSetSpec.MachineClass - 99, // 24: specs.MachineSetSpec.bootstrap_spec:type_name -> specs.MachineSetSpec.BootstrapSpec - 7, // 25: specs.MachineSetSpec.delete_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy - 101, // 26: specs.MachineSetSpec.update_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig - 101, // 27: specs.MachineSetSpec.delete_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig - 9, // 28: specs.TalosUpgradeStatusSpec.phase:type_name -> specs.TalosUpgradeStatusSpec.Phase - 1, // 29: specs.MachineSetStatusSpec.phase:type_name -> specs.MachineSetPhase - 37, // 30: specs.MachineSetStatusSpec.machines:type_name -> specs.Machines - 98, // 31: specs.MachineSetStatusSpec.machine_class:type_name -> specs.MachineSetSpec.MachineClass - 113, // 32: specs.MachineStatusSnapshotSpec.machine_status:type_name -> machine.MachineStatusEvent - 102, // 33: specs.ControlPlaneStatusSpec.conditions:type_name -> specs.ControlPlaneStatusSpec.Condition - 103, // 34: specs.KubernetesStatusSpec.nodes:type_name -> specs.KubernetesStatusSpec.NodeStatus - 105, // 35: specs.KubernetesStatusSpec.static_pods:type_name -> specs.KubernetesStatusSpec.NodeStaticPods - 12, // 36: specs.KubernetesUpgradeStatusSpec.phase:type_name -> specs.KubernetesUpgradeStatusSpec.Phase - 51, // 37: specs.OngoingTaskSpec.talos_upgrade:type_name -> specs.TalosUpgradeStatusSpec - 59, // 38: specs.OngoingTaskSpec.kubernetes_upgrade:type_name -> specs.KubernetesUpgradeStatusSpec - 61, // 39: specs.OngoingTaskSpec.destroy:type_name -> specs.DestroyStatusSpec - 66, // 40: specs.FeaturesConfigSpec.etcd_backup_settings:type_name -> specs.EtcdBackupSettings - 111, // 41: specs.EtcdBackupSettings.tick_interval:type_name -> google.protobuf.Duration - 111, // 42: specs.EtcdBackupSettings.min_interval:type_name -> google.protobuf.Duration - 111, // 43: specs.EtcdBackupSettings.max_interval:type_name -> google.protobuf.Duration - 106, // 44: specs.KubernetesUsageSpec.cpu:type_name -> specs.KubernetesUsageSpec.Quantity - 106, // 45: specs.KubernetesUsageSpec.mem:type_name -> specs.KubernetesUsageSpec.Quantity - 106, // 46: specs.KubernetesUsageSpec.storage:type_name -> specs.KubernetesUsageSpec.Quantity - 107, // 47: specs.KubernetesUsageSpec.pods:type_name -> specs.KubernetesUsageSpec.Pod - 108, // 48: specs.ImagePullRequestSpec.node_image_list:type_name -> specs.ImagePullRequestSpec.NodeImageList - 109, // 49: specs.TalosExtensionsSpec.items:type_name -> specs.TalosExtensionsSpec.Info - 13, // 50: specs.ExtensionsConfigurationStatusSpec.phase:type_name -> specs.ExtensionsConfigurationStatusSpec.Phase - 110, // 51: specs.MachineExtensionsStatusSpec.extensions:type_name -> specs.MachineExtensionsStatusSpec.Item - 91, // 52: specs.MachineStatusSpec.HardwareStatus.processors:type_name -> specs.MachineStatusSpec.HardwareStatus.Processor - 92, // 53: specs.MachineStatusSpec.HardwareStatus.memory_modules:type_name -> specs.MachineStatusSpec.HardwareStatus.MemoryModule - 93, // 54: specs.MachineStatusSpec.HardwareStatus.blockdevices:type_name -> specs.MachineStatusSpec.HardwareStatus.BlockDevice - 94, // 55: specs.MachineStatusSpec.NetworkStatus.network_links:type_name -> specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus - 95, // 56: specs.MachineStatusSpec.Schematic.overlay:type_name -> specs.MachineStatusSpec.Schematic.Overlay - 96, // 57: specs.MachineStatusSpec.Schematic.meta_values:type_name -> specs.MachineStatusSpec.Schematic.MetaValue - 113, // 58: specs.MachineStatusSpec.TalosMachineStatus.status:type_name -> machine.MachineStatusEvent - 112, // 59: specs.MachineStatusSpec.TalosMachineStatus.updated_at:type_name -> google.protobuf.Timestamp - 8, // 60: specs.MachineSetSpec.MachineClass.allocation_type:type_name -> specs.MachineSetSpec.MachineClass.AllocationType - 100, // 61: specs.MachineSetSpec.UpdateStrategyConfig.rolling:type_name -> specs.MachineSetSpec.RollingUpdateStrategyConfig - 2, // 62: specs.ControlPlaneStatusSpec.Condition.type:type_name -> specs.ConditionType - 10, // 63: specs.ControlPlaneStatusSpec.Condition.status:type_name -> specs.ControlPlaneStatusSpec.Condition.Status - 11, // 64: specs.ControlPlaneStatusSpec.Condition.severity:type_name -> specs.ControlPlaneStatusSpec.Condition.Severity - 104, // 65: specs.KubernetesStatusSpec.NodeStaticPods.static_pods:type_name -> specs.KubernetesStatusSpec.StaticPodStatus - 14, // 66: specs.MachineExtensionsStatusSpec.Item.phase:type_name -> specs.MachineExtensionsStatusSpec.Item.Phase - 67, // [67:67] is the sub-list for method output_type - 67, // [67:67] is the sub-list for method input_type - 67, // [67:67] is the sub-list for extension type_name - 67, // [67:67] is the sub-list for extension extendee - 0, // [0:67] is the sub-list for field type_name + 88, // 6: specs.MachineStatusSpec.secure_boot_status:type_name -> specs.MachineStatusSpec.SecureBootStatus + 96, // 7: specs.ClusterSpec.features:type_name -> specs.ClusterSpec.Features + 19, // 8: specs.ClusterSpec.backup_configuration:type_name -> specs.EtcdBackupConf + 110, // 9: specs.EtcdBackupConf.interval:type_name -> google.protobuf.Duration + 111, // 10: specs.EtcdBackupSpec.created_at:type_name -> google.protobuf.Timestamp + 110, // 11: specs.BackupDataSpec.interval:type_name -> google.protobuf.Duration + 4, // 12: specs.EtcdBackupStatusSpec.status:type_name -> specs.EtcdBackupStatusSpec.Status + 111, // 13: specs.EtcdBackupStatusSpec.last_backup_time:type_name -> google.protobuf.Timestamp + 111, // 14: specs.EtcdBackupStatusSpec.last_backup_attempt:type_name -> google.protobuf.Timestamp + 111, // 15: specs.EtcdManualBackupSpec.backup_at:type_name -> google.protobuf.Timestamp + 25, // 16: specs.EtcdBackupOverallStatusSpec.last_backup_status:type_name -> specs.EtcdBackupStatusSpec + 5, // 17: specs.ClusterMachineStatusSpec.stage:type_name -> specs.ClusterMachineStatusSpec.Stage + 0, // 18: specs.ClusterMachineStatusSpec.config_apply_status:type_name -> specs.ConfigApplyStatus + 37, // 19: specs.ClusterStatusSpec.machines:type_name -> specs.Machines + 6, // 20: specs.ClusterStatusSpec.phase:type_name -> specs.ClusterStatusSpec.Phase + 7, // 21: specs.MachineSetSpec.update_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy + 97, // 22: specs.MachineSetSpec.machine_class:type_name -> specs.MachineSetSpec.MachineClass + 98, // 23: specs.MachineSetSpec.bootstrap_spec:type_name -> specs.MachineSetSpec.BootstrapSpec + 7, // 24: specs.MachineSetSpec.delete_strategy:type_name -> specs.MachineSetSpec.UpdateStrategy + 100, // 25: specs.MachineSetSpec.update_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig + 100, // 26: specs.MachineSetSpec.delete_strategy_config:type_name -> specs.MachineSetSpec.UpdateStrategyConfig + 9, // 27: specs.TalosUpgradeStatusSpec.phase:type_name -> specs.TalosUpgradeStatusSpec.Phase + 1, // 28: specs.MachineSetStatusSpec.phase:type_name -> specs.MachineSetPhase + 37, // 29: specs.MachineSetStatusSpec.machines:type_name -> specs.Machines + 97, // 30: specs.MachineSetStatusSpec.machine_class:type_name -> specs.MachineSetSpec.MachineClass + 112, // 31: specs.MachineStatusSnapshotSpec.machine_status:type_name -> machine.MachineStatusEvent + 101, // 32: specs.ControlPlaneStatusSpec.conditions:type_name -> specs.ControlPlaneStatusSpec.Condition + 102, // 33: specs.KubernetesStatusSpec.nodes:type_name -> specs.KubernetesStatusSpec.NodeStatus + 104, // 34: specs.KubernetesStatusSpec.static_pods:type_name -> specs.KubernetesStatusSpec.NodeStaticPods + 12, // 35: specs.KubernetesUpgradeStatusSpec.phase:type_name -> specs.KubernetesUpgradeStatusSpec.Phase + 51, // 36: specs.OngoingTaskSpec.talos_upgrade:type_name -> specs.TalosUpgradeStatusSpec + 59, // 37: specs.OngoingTaskSpec.kubernetes_upgrade:type_name -> specs.KubernetesUpgradeStatusSpec + 61, // 38: specs.OngoingTaskSpec.destroy:type_name -> specs.DestroyStatusSpec + 66, // 39: specs.FeaturesConfigSpec.etcd_backup_settings:type_name -> specs.EtcdBackupSettings + 110, // 40: specs.EtcdBackupSettings.tick_interval:type_name -> google.protobuf.Duration + 110, // 41: specs.EtcdBackupSettings.min_interval:type_name -> google.protobuf.Duration + 110, // 42: specs.EtcdBackupSettings.max_interval:type_name -> google.protobuf.Duration + 105, // 43: specs.KubernetesUsageSpec.cpu:type_name -> specs.KubernetesUsageSpec.Quantity + 105, // 44: specs.KubernetesUsageSpec.mem:type_name -> specs.KubernetesUsageSpec.Quantity + 105, // 45: specs.KubernetesUsageSpec.storage:type_name -> specs.KubernetesUsageSpec.Quantity + 106, // 46: specs.KubernetesUsageSpec.pods:type_name -> specs.KubernetesUsageSpec.Pod + 107, // 47: specs.ImagePullRequestSpec.node_image_list:type_name -> specs.ImagePullRequestSpec.NodeImageList + 108, // 48: specs.TalosExtensionsSpec.items:type_name -> specs.TalosExtensionsSpec.Info + 13, // 49: specs.ExtensionsConfigurationStatusSpec.phase:type_name -> specs.ExtensionsConfigurationStatusSpec.Phase + 109, // 50: specs.MachineExtensionsStatusSpec.extensions:type_name -> specs.MachineExtensionsStatusSpec.Item + 90, // 51: specs.MachineStatusSpec.HardwareStatus.processors:type_name -> specs.MachineStatusSpec.HardwareStatus.Processor + 91, // 52: specs.MachineStatusSpec.HardwareStatus.memory_modules:type_name -> specs.MachineStatusSpec.HardwareStatus.MemoryModule + 92, // 53: specs.MachineStatusSpec.HardwareStatus.blockdevices:type_name -> specs.MachineStatusSpec.HardwareStatus.BlockDevice + 93, // 54: specs.MachineStatusSpec.NetworkStatus.network_links:type_name -> specs.MachineStatusSpec.NetworkStatus.NetworkLinkStatus + 94, // 55: specs.MachineStatusSpec.Schematic.overlay:type_name -> specs.MachineStatusSpec.Schematic.Overlay + 95, // 56: specs.MachineStatusSpec.Schematic.meta_values:type_name -> specs.MachineStatusSpec.Schematic.MetaValue + 8, // 57: specs.MachineSetSpec.MachineClass.allocation_type:type_name -> specs.MachineSetSpec.MachineClass.AllocationType + 99, // 58: specs.MachineSetSpec.UpdateStrategyConfig.rolling:type_name -> specs.MachineSetSpec.RollingUpdateStrategyConfig + 2, // 59: specs.ControlPlaneStatusSpec.Condition.type:type_name -> specs.ConditionType + 10, // 60: specs.ControlPlaneStatusSpec.Condition.status:type_name -> specs.ControlPlaneStatusSpec.Condition.Status + 11, // 61: specs.ControlPlaneStatusSpec.Condition.severity:type_name -> specs.ControlPlaneStatusSpec.Condition.Severity + 103, // 62: specs.KubernetesStatusSpec.NodeStaticPods.static_pods:type_name -> specs.KubernetesStatusSpec.StaticPodStatus + 14, // 63: specs.MachineExtensionsStatusSpec.Item.phase:type_name -> specs.MachineExtensionsStatusSpec.Item.Phase + 64, // [64:64] is the sub-list for method output_type + 64, // [64:64] is the sub-list for method input_type + 64, // [64:64] is the sub-list for extension type_name + 64, // [64:64] is the sub-list for extension extendee + 0, // [0:64] is the sub-list for field type_name } func init() { file_omni_specs_omni_proto_init() } @@ -9160,19 +9079,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MachineStatusSpec_TalosMachineStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_omni_specs_omni_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_HardwareStatus_Processor); i { case 0: return &v.state @@ -9184,7 +9091,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_HardwareStatus_MemoryModule); i { case 0: return &v.state @@ -9196,7 +9103,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_HardwareStatus_BlockDevice); i { case 0: return &v.state @@ -9208,7 +9115,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_NetworkStatus_NetworkLinkStatus); i { case 0: return &v.state @@ -9220,7 +9127,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_Schematic_Overlay); i { case 0: return &v.state @@ -9232,7 +9139,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineStatusSpec_Schematic_MetaValue); i { case 0: return &v.state @@ -9244,7 +9151,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClusterSpec_Features); i { case 0: return &v.state @@ -9256,7 +9163,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineSetSpec_MachineClass); i { case 0: return &v.state @@ -9268,7 +9175,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineSetSpec_BootstrapSpec); i { case 0: return &v.state @@ -9280,7 +9187,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineSetSpec_RollingUpdateStrategyConfig); i { case 0: return &v.state @@ -9292,7 +9199,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineSetSpec_UpdateStrategyConfig); i { case 0: return &v.state @@ -9304,7 +9211,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ControlPlaneStatusSpec_Condition); i { case 0: return &v.state @@ -9316,7 +9223,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KubernetesStatusSpec_NodeStatus); i { case 0: return &v.state @@ -9328,7 +9235,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KubernetesStatusSpec_StaticPodStatus); i { case 0: return &v.state @@ -9340,7 +9247,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KubernetesStatusSpec_NodeStaticPods); i { case 0: return &v.state @@ -9352,7 +9259,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KubernetesUsageSpec_Quantity); i { case 0: return &v.state @@ -9364,7 +9271,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KubernetesUsageSpec_Pod); i { case 0: return &v.state @@ -9376,7 +9283,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ImagePullRequestSpec_NodeImageList); i { case 0: return &v.state @@ -9388,7 +9295,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TalosExtensionsSpec_Info); i { case 0: return &v.state @@ -9400,7 +9307,7 @@ func file_omni_specs_omni_proto_init() { return nil } } - file_omni_specs_omni_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { + file_omni_specs_omni_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MachineExtensionsStatusSpec_Item); i { case 0: return &v.state @@ -9424,7 +9331,7 @@ func file_omni_specs_omni_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_omni_specs_omni_proto_rawDesc, NumEnums: 15, - NumMessages: 96, + NumMessages: 95, NumExtensions: 0, NumServices: 0, }, diff --git a/client/api/omni/specs/omni.proto b/client/api/omni/specs/omni.proto index 6532d372..9f1de299 100644 --- a/client/api/omni/specs/omni.proto +++ b/client/api/omni/specs/omni.proto @@ -177,11 +177,6 @@ message MachineStatusSpec { bool enabled = 1; } - message TalosMachineStatus { - machine.MachineStatusEvent status = 1; - google.protobuf.Timestamp updated_at = 2; - } - // Talos version. string talos_version = 1; @@ -231,7 +226,7 @@ message MachineStatusSpec { // InitialTalosVersion is set only once when the machine first joined Omni. string initial_talos_version = 16; - TalosMachineStatus talos_machine_status = 17; + reserved 17; SecureBootStatus secure_boot_status = 18; } diff --git a/client/api/omni/specs/omni_vtproto.pb.go b/client/api/omni/specs/omni_vtproto.pb.go index d6d4cd75..f6fff372 100644 --- a/client/api/omni/specs/omni_vtproto.pb.go +++ b/client/api/omni/specs/omni_vtproto.pb.go @@ -319,32 +319,6 @@ func (m *MachineStatusSpec_SecureBootStatus) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *MachineStatusSpec_TalosMachineStatus) CloneVT() *MachineStatusSpec_TalosMachineStatus { - if m == nil { - return (*MachineStatusSpec_TalosMachineStatus)(nil) - } - r := new(MachineStatusSpec_TalosMachineStatus) - r.UpdatedAt = (*timestamppb.Timestamp)((*timestamppb1.Timestamp)(m.UpdatedAt).CloneVT()) - if rhs := m.Status; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface { - CloneVT() *machine.MachineStatusEvent - }); ok { - r.Status = vtpb.CloneVT() - } else { - r.Status = proto.Clone(rhs).(*machine.MachineStatusEvent) - } - } - if len(m.unknownFields) > 0 { - r.unknownFields = make([]byte, len(m.unknownFields)) - copy(r.unknownFields, m.unknownFields) - } - return r -} - -func (m *MachineStatusSpec_TalosMachineStatus) CloneMessageVT() proto.Message { - return m.CloneVT() -} - func (m *MachineStatusSpec) CloneVT() *MachineStatusSpec { if m == nil { return (*MachineStatusSpec)(nil) @@ -362,7 +336,6 @@ func (m *MachineStatusSpec) CloneVT() *MachineStatusSpec { r.PlatformMetadata = m.PlatformMetadata.CloneVT() r.Schematic = m.Schematic.CloneVT() r.InitialTalosVersion = m.InitialTalosVersion - r.TalosMachineStatus = m.TalosMachineStatus.CloneVT() r.SecureBootStatus = m.SecureBootStatus.CloneVT() if rhs := m.ImageLabels; rhs != nil { tmpContainer := make(map[string]string, len(rhs)) @@ -2502,34 +2475,6 @@ func (this *MachineStatusSpec_SecureBootStatus) EqualMessageVT(thatMsg proto.Mes } return this.EqualVT(that) } -func (this *MachineStatusSpec_TalosMachineStatus) EqualVT(that *MachineStatusSpec_TalosMachineStatus) bool { - if this == that { - return true - } else if this == nil || that == nil { - return false - } - if equal, ok := interface{}(this.Status).(interface { - EqualVT(*machine.MachineStatusEvent) bool - }); ok { - if !equal.EqualVT(that.Status) { - return false - } - } else if !proto.Equal(this.Status, that.Status) { - return false - } - if !(*timestamppb1.Timestamp)(this.UpdatedAt).EqualVT((*timestamppb1.Timestamp)(that.UpdatedAt)) { - return false - } - return string(this.unknownFields) == string(that.unknownFields) -} - -func (this *MachineStatusSpec_TalosMachineStatus) EqualMessageVT(thatMsg proto.Message) bool { - that, ok := thatMsg.(*MachineStatusSpec_TalosMachineStatus) - if !ok { - return false - } - return this.EqualVT(that) -} func (this *MachineStatusSpec) EqualVT(that *MachineStatusSpec) bool { if this == that { return true @@ -2584,9 +2529,6 @@ func (this *MachineStatusSpec) EqualVT(that *MachineStatusSpec) bool { if this.InitialTalosVersion != that.InitialTalosVersion { return false } - if !this.TalosMachineStatus.EqualVT(that.TalosMachineStatus) { - return false - } if !this.SecureBootStatus.EqualVT(that.SecureBootStatus) { return false } @@ -5621,71 +5563,6 @@ func (m *MachineStatusSpec_SecureBootStatus) MarshalToSizedBufferVT(dAtA []byte) return len(dAtA) - i, nil } -func (m *MachineStatusSpec_TalosMachineStatus) 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 *MachineStatusSpec_TalosMachineStatus) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *MachineStatusSpec_TalosMachineStatus) 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.UpdatedAt != nil { - size, err := (*timestamppb1.Timestamp)(m.UpdatedAt).MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - if m.Status != nil { - if vtmsg, ok := interface{}(m.Status).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Status) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *MachineStatusSpec) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -5728,18 +5605,6 @@ func (m *MachineStatusSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x92 } - if m.TalosMachineStatus != nil { - size, err := m.TalosMachineStatus.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x8a - } if len(m.InitialTalosVersion) > 0 { i -= len(m.InitialTalosVersion) copy(dAtA[i:], m.InitialTalosVersion) @@ -10574,30 +10439,6 @@ func (m *MachineStatusSpec_SecureBootStatus) SizeVT() (n int) { return n } -func (m *MachineStatusSpec_TalosMachineStatus) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Status != nil { - if size, ok := interface{}(m.Status).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Status) - } - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - if m.UpdatedAt != nil { - l = (*timestamppb1.Timestamp)(m.UpdatedAt).SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - n += len(m.unknownFields) - return n -} - func (m *MachineStatusSpec) SizeVT() (n int) { if m == nil { return 0 @@ -10657,10 +10498,6 @@ func (m *MachineStatusSpec) SizeVT() (n int) { if l > 0 { n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.TalosMachineStatus != nil { - l = m.TalosMachineStatus.SizeVT() - n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) - } if m.SecureBootStatus != nil { l = m.SecureBootStatus.SizeVT() n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -14543,137 +14380,6 @@ func (m *MachineStatusSpec_SecureBootStatus) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *MachineStatusSpec_TalosMachineStatus) 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: MachineStatusSpec_TalosMachineStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MachineStatusSpec_TalosMachineStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &machine.MachineStatusEvent{} - } - if unmarshal, ok := interface{}(m.Status).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Status); err != nil { - return err - } - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UpdatedAt == nil { - m.UpdatedAt = ×tamppb.Timestamp{} - } - if err := (*timestamppb1.Timestamp)(m.UpdatedAt).UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - 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 *MachineStatusSpec) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -15193,42 +14899,6 @@ func (m *MachineStatusSpec) UnmarshalVT(dAtA []byte) error { } m.InitialTalosVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 17: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TalosMachineStatus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TalosMachineStatus == nil { - m.TalosMachineStatus = &MachineStatusSpec_TalosMachineStatus{} - } - if err := m.TalosMachineStatus.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 18: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecureBootStatus", wireType) diff --git a/cmd/omni/main.go b/cmd/omni/main.go index eb902529..3c29f1e2 100644 --- a/cmd/omni/main.go +++ b/cmd/omni/main.go @@ -28,6 +28,7 @@ import ( "github.com/siderolabs/omni/client/pkg/constants" authres "github.com/siderolabs/omni/client/pkg/omni/resources/auth" + omnires "github.com/siderolabs/omni/client/pkg/omni/resources/omni" "github.com/siderolabs/omni/internal/backend" "github.com/siderolabs/omni/internal/backend/discovery" "github.com/siderolabs/omni/internal/backend/dns" @@ -171,6 +172,7 @@ func runWithState(logger *zap.Logger) func(context.Context, state.State, *virtua } linkCounterDeltaCh := make(chan siderolink.LinkCounterDeltas) + siderolinkEventsCh := make(chan *omnires.MachineStatusSnapshot) discoveryClient, err := discovery.NewClient(ctx) if err != nil { @@ -184,7 +186,7 @@ func runWithState(logger *zap.Logger) func(context.Context, state.State, *virtua }() omniRuntime, err := omni.New(talosClientFactory, dnsService, workloadProxyServiceRegistry, resourceLogger, - imageFactoryClient, linkCounterDeltaCh, resourceState, virtualState, + imageFactoryClient, linkCounterDeltaCh, siderolinkEventsCh, resourceState, virtualState, prometheus.DefaultRegisterer, discoveryClient, logger.With(logging.Component("omni_runtime"))) if err != nil { return fmt.Errorf("failed to set up the controller runtime: %w", err) @@ -230,6 +232,7 @@ func runWithState(logger *zap.Logger) func(context.Context, state.State, *virtua workloadProxyServiceRegistry, imageFactoryClient, linkCounterDeltaCh, + siderolinkEventsCh, omniRuntime, talosRuntime, logHandler, diff --git a/frontend/src/api/omni/specs/omni.pb.ts b/frontend/src/api/omni/specs/omni.pb.ts index 3ae89962..5fe110b1 100644 --- a/frontend/src/api/omni/specs/omni.pb.ts +++ b/frontend/src/api/omni/specs/omni.pb.ts @@ -214,11 +214,6 @@ export type MachineStatusSpecSecureBootStatus = { enabled?: boolean } -export type MachineStatusSpecTalosMachineStatus = { - status?: MachineMachine.MachineStatusEvent - updated_at?: GoogleProtobufTimestamp.Timestamp -} - export type MachineStatusSpec = { talos_version?: string hardware?: MachineStatusSpecHardwareStatus @@ -233,7 +228,6 @@ export type MachineStatusSpec = { image_labels?: {[key: string]: string} schematic?: MachineStatusSpecSchematic initial_talos_version?: string - talos_machine_status?: MachineStatusSpecTalosMachineStatus secure_boot_status?: MachineStatusSpecSecureBootStatus } diff --git a/internal/backend/dns/service_test.go b/internal/backend/dns/service_test.go index 76dcb930..11bb436c 100644 --- a/internal/backend/dns/service_test.go +++ b/internal/backend/dns/service_test.go @@ -158,5 +158,7 @@ func (suite *ServiceSuite) assertResolve(node string, expected dns.Info) { } func TestServiceSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ServiceSuite)) } diff --git a/internal/backend/grpc/grpc_test.go b/internal/backend/grpc/grpc_test.go index 8b563d56..a586719c 100644 --- a/internal/backend/grpc/grpc_test.go +++ b/internal/backend/grpc/grpc_test.go @@ -94,7 +94,7 @@ func (suite *GrpcSuite) SetupTest() { suite.Require().NoError(err) suite.runtime, err = omniruntime.New(clientFactory, dnsService, workloadProxyServiceRegistry, nil, - imageFactoryClient, nil, suite.state, nil, prometheus.NewRegistry(), discoveryServiceClientMock, logger) + imageFactoryClient, nil, nil, suite.state, nil, prometheus.NewRegistry(), discoveryServiceClientMock, logger) suite.Require().NoError(err) runtime.Install(omniruntime.Name, suite.runtime) @@ -324,5 +324,7 @@ func (d *discoveryClientMock) AffiliateDelete(context.Context, string, string) e } func TestGrpcSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(GrpcSuite)) } diff --git a/internal/backend/runtime/omni/controllers/helpers/helpers.go b/internal/backend/runtime/omni/controllers/helpers/helpers.go index 0e0dbc13..7ddeb8ff 100644 --- a/internal/backend/runtime/omni/controllers/helpers/helpers.go +++ b/internal/backend/runtime/omni/controllers/helpers/helpers.go @@ -7,13 +7,18 @@ package helpers import ( + "context" "crypto/sha256" "encoding/hex" "fmt" "strings" + "github.com/cosi-project/runtime/pkg/controller" + "github.com/cosi-project/runtime/pkg/controller/generic" "github.com/cosi-project/runtime/pkg/resource" "github.com/cosi-project/runtime/pkg/resource/kvutils" + "github.com/cosi-project/runtime/pkg/safe" + "github.com/cosi-project/runtime/pkg/state" "github.com/siderolabs/gen/xslices" "github.com/siderolabs/omni/client/pkg/omni/resources/omni" @@ -127,3 +132,57 @@ func ClearUserLabels(res resource.Resource) { } }) } + +// HandleInputOptions optional args for HandleInput. +type HandleInputOptions struct { + id string +} + +// HandleInputOption optional arg for HandleInput. +type HandleInputOption func(*HandleInputOptions) + +// WithID maps the resource using another id. +func WithID(id string) HandleInputOption { + return func(hio *HandleInputOptions) { + hio.id = id + } +} + +// HandleInput reads the additional input resource and automatically manages finalizers. +// By default maps the resource using same id. +func HandleInput[T generic.ResourceWithRD, S generic.ResourceWithRD](ctx context.Context, r controller.QRuntime, finalizer string, main S, opts ...HandleInputOption) (T, error) { + var zero T + + options := HandleInputOptions{ + id: main.Metadata().ID(), + } + + for _, o := range opts { + o(&options) + } + + res, err := safe.ReaderGetByID[T](ctx, r, options.id) + if err != nil { + if state.IsNotFoundError(err) { + return zero, nil + } + + return zero, err + } + + if res.Metadata().Phase() == resource.PhaseTearingDown || main.Metadata().Phase() == resource.PhaseTearingDown { + if err := r.RemoveFinalizer(ctx, res.Metadata(), finalizer); err != nil && !state.IsNotFoundError(err) { + return zero, err + } + + return zero, nil + } + + if !res.Metadata().Finalizers().Has(finalizer) { + if err := r.AddFinalizer(ctx, res.Metadata(), finalizer); err != nil { + return zero, err + } + } + + return res, nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/cert_refresh_tick_test.go b/internal/backend/runtime/omni/controllers/omni/cert_refresh_tick_test.go index 3e0901b8..787b92be 100644 --- a/internal/backend/runtime/omni/controllers/omni/cert_refresh_tick_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cert_refresh_tick_test.go @@ -50,5 +50,7 @@ func (suite *CertRefreshTickSuite) TestReconcile() { } func TestCertRefreshTickSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(CertRefreshTickSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_bootstrap_status_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_bootstrap_status_test.go index 44f85bea..09d91d0b 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_bootstrap_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_bootstrap_status_test.go @@ -177,5 +177,7 @@ func (suite *ClusterBootstrapStatusSuite) testRecoverControlPlaneFromEtcdBackup( } func TestClusterBootstrapStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterBootstrapStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_endpoint_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_endpoint_test.go index 8199e143..28e8ec64 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_endpoint_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_endpoint_test.go @@ -49,5 +49,7 @@ func (suite *ClusterEndpointSuite) TestReconcile() { } func TestClusterEndpointSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterEndpointSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_kubernetes_nodes_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_kubernetes_nodes_test.go index cb6dfa90..c7023103 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_kubernetes_nodes_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_kubernetes_nodes_test.go @@ -66,5 +66,7 @@ func (suite *ClusterKubernetesNodesSuite) TestReconcile() { } func TestClusterKubernetesNodesSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterKubernetesNodesSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_loadbalancer_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_loadbalancer_test.go index 5c1c5236..5ed2f5b2 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_loadbalancer_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_loadbalancer_test.go @@ -110,5 +110,7 @@ func (suite *ClusterLoadBalancerSuite) TestReconcile() { } func TestClusterLoadbalancerSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterLoadBalancerSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status_test.go index aa7f827a..4141a514 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_status_test.go @@ -696,5 +696,7 @@ func (suite *ClusterMachineConfigStatusSuite) TestGenerationErrorPropagation() { } func TestClusterMachineConfigStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterMachineConfigStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_test.go index 6ce37d02..43ce3996 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_machine_config_test.go @@ -179,5 +179,7 @@ func (suite *ClusterMachineConfigSuite) TestGenerationError() { } func TestClusterMachineConfigSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterMachineConfigSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_machine_status_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_machine_status_test.go index 34a6078d..cf13619b 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_machine_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_machine_status_test.go @@ -219,5 +219,7 @@ func (suite *ClusterMachineStatusSuite) TestApidAvailable() { } func TestClusterMachineStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterMachineStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_status_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_status_test.go index a720769c..29f838f4 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_status_test.go @@ -222,5 +222,7 @@ func (suite *ClusterStatusSuite) TestReconcile() { } func TestClusterStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/cluster_test.go b/internal/backend/runtime/omni/controllers/omni/cluster_test.go index 8b12793e..47268b5b 100644 --- a/internal/backend/runtime/omni/controllers/omni/cluster_test.go +++ b/internal/backend/runtime/omni/controllers/omni/cluster_test.go @@ -82,5 +82,7 @@ func (suite *ClusterSuite) TestReconcile() { } func TestClusterSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/etcd_backup_test.go b/internal/backend/runtime/omni/controllers/omni/etcd_backup_test.go index 2d12c435..96a85990 100644 --- a/internal/backend/runtime/omni/controllers/omni/etcd_backup_test.go +++ b/internal/backend/runtime/omni/controllers/omni/etcd_backup_test.go @@ -50,6 +50,8 @@ import ( ) func TestEtcdBackupControllerSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(EtcdBackupControllerSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/image_pull_status_test.go b/internal/backend/runtime/omni/controllers/omni/image_pull_status_test.go index 30302353..c8073800 100644 --- a/internal/backend/runtime/omni/controllers/omni/image_pull_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/image_pull_status_test.go @@ -68,6 +68,8 @@ func (m *mockImageClient) PullImageToNode(_ context.Context, cluster, node, imag } func TestImagePullStatusControllerSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ImagePullStatusControllerSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/helpers.go b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/helpers.go index 192fa8fc..d0166829 100644 --- a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/helpers.go +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/helpers.go @@ -7,9 +7,12 @@ package machine import ( "context" + "fmt" "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/resource/meta" "github.com/cosi-project/runtime/pkg/safe" + "github.com/cosi-project/runtime/pkg/state" "github.com/siderolabs/talos/pkg/machinery/client" ) @@ -35,3 +38,20 @@ func forEachResource[T resource.Resource]( return nil } + +// QueryRegisteredTypes gets all registered types from the meta namespace. +func QueryRegisteredTypes(ctx context.Context, st state.State) (map[resource.Type]struct{}, error) { + // query all resources to start watching only resources that are defined for running version of talos + resources, err := safe.StateList[*meta.ResourceDefinition](ctx, st, resource.NewMetadata(meta.NamespaceName, meta.ResourceDefinitionType, "", resource.VersionUndefined)) + if err != nil { + return nil, fmt.Errorf("failed to list resource definitions: %w", err) + } + + registeredTypes := map[resource.Type]struct{}{} + + resources.ForEach(func(rd *meta.ResourceDefinition) { + registeredTypes[rd.TypedSpec().Type] = struct{}{} + }) + + return registeredTypes, nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/machine.go b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/machine.go index 6eec3c13..57269c91 100644 --- a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/machine.go +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/machine.go @@ -15,8 +15,6 @@ import ( "time" "github.com/cosi-project/runtime/pkg/resource" - "github.com/cosi-project/runtime/pkg/resource/meta" - "github.com/cosi-project/runtime/pkg/safe" "github.com/cosi-project/runtime/pkg/state" "github.com/siderolabs/gen/channel" "github.com/siderolabs/gen/maps" @@ -50,9 +48,8 @@ type Info struct { //nolint:govet MemoryModules []*specs.MachineStatusSpec_HardwareStatus_MemoryModule Blockdevices []*specs.MachineStatusSpec_HardwareStatus_BlockDevice - TalosMachineStatus *specs.MachineStatusSpec_TalosMachineStatus - PlatformMetadata *specs.MachineStatusSpec_PlatformMetadata - Schematic *specs.MachineStatusSpec_Schematic + PlatformMetadata *specs.MachineStatusSpec_PlatformMetadata + Schematic *specs.MachineStatusSpec_Schematic LastError error MachineID string @@ -193,8 +190,7 @@ func (spec CollectTaskSpec) RunTask(ctx context.Context, logger *zap.Logger, not watchCh := make(chan state.Event) - // query all resources to start watching only resources that are defined for running version of talos - resources, err := safe.StateList[*meta.ResourceDefinition](ctx, c.COSI, resource.NewMetadata(meta.NamespaceName, meta.ResourceDefinitionType, "", resource.VersionUndefined)) + registeredTypes, err := QueryRegisteredTypes(ctx, c.COSI) if err != nil { // this is the first request to the Talos API // if it fails we handle it and update the machine status with the request error @@ -202,15 +198,9 @@ func (spec CollectTaskSpec) RunTask(ctx context.Context, logger *zap.Logger, not return nil } - return fmt.Errorf("failed to list resource definitions: %w", err) + return err } - registeredTypes := map[resource.Type]struct{}{} - - resources.ForEach(func(rd *meta.ResourceDefinition) { - registeredTypes[rd.TypedSpec().Type] = struct{}{} - }) - // as Talos < 1.3.0 doesn't support Bootstrapped event, we use a mixed approach: // watch is used to trigger polling on changes to the resources watchers := map[resource.Type]struct { diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/poll.go b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/poll.go index 16ae3ddc..ef8cee6f 100644 --- a/internal/backend/runtime/omni/controllers/omni/internal/task/machine/poll.go +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/machine/poll.go @@ -21,7 +21,6 @@ import ( "github.com/siderolabs/go-pointer" "github.com/siderolabs/go-procfs/procfs" "github.com/siderolabs/image-factory/pkg/schematic" - "github.com/siderolabs/talos/pkg/machinery/api/machine" "github.com/siderolabs/talos/pkg/machinery/client" "github.com/siderolabs/talos/pkg/machinery/constants" "github.com/siderolabs/talos/pkg/machinery/nethelpers" @@ -31,7 +30,6 @@ import ( "github.com/siderolabs/talos/pkg/machinery/resources/runtime" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "google.golang.org/protobuf/types/known/timestamppb" "github.com/siderolabs/omni/client/api/omni/specs" omnimeta "github.com/siderolabs/omni/client/pkg/meta" @@ -51,7 +49,6 @@ var resourcePollers = map[string]machinePollFunction{ runtime.PlatformMetadataType: pollPlatformMetadata, runtime.MetaKeyType: pollMeta, runtime.ExtensionStatusType: pollExtensions, - runtime.MachineStatusType: pollTalosMachineStatus, } var machinePollers = map[string]machinePollFunction{ @@ -279,74 +276,6 @@ func pollPlatformMetadata(ctx context.Context, c *client.Client, info *Info) err }) } -func pollTalosMachineStatus(ctx context.Context, c *client.Client, info *Info) error { - convertStage := func(stage runtime.MachineStage) (machine.MachineStatusEvent_MachineStage, error) { - switch stage { - case runtime.MachineStageUnknown: - return machine.MachineStatusEvent_UNKNOWN, nil - case runtime.MachineStageBooting: - return machine.MachineStatusEvent_BOOTING, nil - case runtime.MachineStageInstalling: - return machine.MachineStatusEvent_INSTALLING, nil - case runtime.MachineStageMaintenance: - return machine.MachineStatusEvent_MAINTENANCE, nil - case runtime.MachineStageRunning: - return machine.MachineStatusEvent_RUNNING, nil - case runtime.MachineStageRebooting: - return machine.MachineStatusEvent_REBOOTING, nil - case runtime.MachineStageShuttingDown: - return machine.MachineStatusEvent_SHUTTING_DOWN, nil - case runtime.MachineStageResetting: - return machine.MachineStatusEvent_RESETTING, nil - case runtime.MachineStageUpgrading: - return machine.MachineStatusEvent_UPGRADING, nil - default: - return machine.MachineStatusEvent_UNKNOWN, fmt.Errorf("unknown stage: %d", stage) - } - } - - convertStatus := func(r *runtime.MachineStatus) (*specs.MachineStatusSpec_TalosMachineStatus, error) { - spec := r.TypedSpec() - - statusEventMachineStage, err := convertStage(spec.Stage) - if err != nil { - return nil, err - } - - return &specs.MachineStatusSpec_TalosMachineStatus{ - UpdatedAt: timestamppb.New(r.Metadata().Updated()), - Status: &machine.MachineStatusEvent{ - Stage: statusEventMachineStage, - Status: &machine.MachineStatusEvent_MachineStatus{ - Ready: spec.Status.Ready, - UnmetConditions: xslices.Map(spec.Status.UnmetConditions, func(t runtime.UnmetCondition) *machine.MachineStatusEvent_MachineStatus_UnmetCondition { - return &machine.MachineStatusEvent_MachineStatus_UnmetCondition{ - Name: t.Name, - Reason: t.Reason, - } - }), - }, - }, - }, nil - } - - return forEachResource( - ctx, - c, - runtime.NamespaceName, - runtime.MachineStatusType, - func(r *runtime.MachineStatus) error { - machineStatusEvent, err := convertStatus(r) - if err != nil { - return err - } - - info.TalosMachineStatus = machineStatusEvent - - return nil - }) -} - func pollSecureBootStatus(ctx context.Context, c *client.Client, info *Info) error { isSecureBootEnabled := func() (bool, error) { _, err := safe.StateGetByID[*meta.ResourceDefinition](ctx, c.COSI, strings.ToLower(runtime.SecurityStateType)) diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/runner.go b/internal/backend/runtime/omni/controllers/omni/internal/task/runner.go index d5e857a1..cc91ac90 100644 --- a/internal/backend/runtime/omni/controllers/omni/internal/task/runner.go +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/runner.go @@ -7,6 +7,7 @@ package task import ( "context" + "sync" "go.uber.org/zap" ) @@ -18,6 +19,7 @@ type EqualityFunc[T any] func(x, y T) bool type Runner[T any, S Spec[T]] struct { running map[ID]*Task[T, S] equalityFunc EqualityFunc[S] + mu sync.Mutex } // NewRunner creates a new task runner. @@ -44,8 +46,37 @@ func (runner *Runner[T, S]) Stop() { } } +// StartTask starts a new task. +func (runner *Runner[T, S]) StartTask(ctx context.Context, logger *zap.Logger, id string, spec S, task T) { + runner.mu.Lock() + defer runner.mu.Unlock() + + runner.running[id] = New(logger, spec, task) + + logger.Debug("starting task", zap.String("task", id)) + runner.running[id].Start(ctx) +} + +// StopTask stop the running task. +func (runner *Runner[T, S]) StopTask(logger *zap.Logger, id string) { + runner.mu.Lock() + defer runner.mu.Unlock() + + if _, ok := runner.running[id]; !ok { + return + } + + logger.Debug("stopping task", zap.String("task", id)) + + runner.running[id].Stop() + delete(runner.running, id) +} + // Reconcile running tasks. func (runner *Runner[T, S]) Reconcile(ctx context.Context, logger *zap.Logger, shouldRun map[ID]S, in T) { + runner.mu.Lock() + defer runner.mu.Unlock() + // stop running tasks which shouldn't run for id := range runner.running { if _, exists := shouldRun[id]; !exists { diff --git a/internal/backend/runtime/omni/controllers/omni/internal/task/snapshot/snapshot.go b/internal/backend/runtime/omni/controllers/omni/internal/task/snapshot/snapshot.go new file mode 100644 index 00000000..2dc6375b --- /dev/null +++ b/internal/backend/runtime/omni/controllers/omni/internal/task/snapshot/snapshot.go @@ -0,0 +1,217 @@ +// Copyright (c) 2024 Sidero Labs, Inc. +// +// Use of this software is governed by the Business Source License +// included in the LICENSE file. + +// Package snapshot implements a task which collects MachineStatus resource from a Machine. +package snapshot + +import ( + "context" + "crypto/tls" + "fmt" + + "github.com/cosi-project/runtime/pkg/resource" + "github.com/cosi-project/runtime/pkg/state" + "github.com/siderolabs/gen/channel" + "github.com/siderolabs/gen/xslices" + "github.com/siderolabs/talos/pkg/machinery/api/machine" + "github.com/siderolabs/talos/pkg/machinery/client" + "github.com/siderolabs/talos/pkg/machinery/resources/runtime" + "go.uber.org/zap" + + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + machinetask "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/internal/task/machine" + "github.com/siderolabs/omni/internal/backend/runtime/talos" +) + +// InfoChan is a channel for sending machine info from tasks back to the controller. +type InfoChan chan<- *omni.MachineStatusSnapshot + +// CollectTaskSpec describes a task to collect machine information. +type CollectTaskSpec struct { + _ [0]func() // make uncomparable + + TalosConfig *omni.TalosConfig + Endpoint string + MachineID string +} + +func resourceEqual[T any, S interface { + resource.Resource + *T +}](a, b S) bool { + if a == nil && b == nil { + return true + } + + if a == nil || b == nil { + return false + } + + return resource.Equal(a, b) +} + +// Equal compares two task specs for the same machine. +// +// If the task spec changes, the task will be restarted. +func (spec CollectTaskSpec) Equal(other CollectTaskSpec) bool { + if spec.Endpoint != other.Endpoint { + return false + } + + if !resourceEqual(spec.TalosConfig, other.TalosConfig) { + return false + } + + return true +} + +// ID returns the task ID. +func (spec CollectTaskSpec) ID() string { + return spec.MachineID +} + +func (spec CollectTaskSpec) sendInfo(ctx context.Context, info *omni.MachineStatusSnapshot, notifyCh InfoChan) bool { + return channel.SendWithContext(ctx, notifyCh, info) +} + +// RunTask runs the machine status collector. +func (spec CollectTaskSpec) RunTask(ctx context.Context, _ *zap.Logger, notifyCh InfoChan) error { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + + client, err := spec.getClient(ctx) + if err != nil { + return err + } + + defer client.Close() //nolint:errcheck + + registeredTypes, err := machinetask.QueryRegisteredTypes(ctx, client.COSI) + if err != nil { + return err + } + + if _, registered := registeredTypes[runtime.MachineStatusType]; !registered { + return nil + } + + watchCh := make(chan state.Event) + + if err = client.COSI.Watch(ctx, runtime.NewMachineStatus().Metadata(), watchCh); err != nil { + return err + } + + for { + var event state.Event + + select { + case <-ctx.Done(): + return nil + case event = <-watchCh: + } + + switch event.Type { + case state.Errored: + return fmt.Errorf("error watching COSI resource: %w", event.Error) + case state.Bootstrapped, state.Destroyed: + // ignore + case state.Created, state.Updated: + snapshot := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, spec.MachineID) + + machineStatusSpec := event.Resource.Spec().(*runtime.MachineStatusSpec) //nolint:forcetypeassert,errcheck + + ev, err := convertStatus(machineStatusSpec) + if err != nil { + return err + } + + snapshot.TypedSpec().Value.MachineStatus = ev + + if !spec.sendInfo(ctx, snapshot, notifyCh) { + return nil + } + } + } +} + +func (spec CollectTaskSpec) getClient(ctx context.Context) (*client.Client, error) { + opts := talos.GetSocketOptions(spec.Endpoint) + + talosConfig := spec.TalosConfig + +retry: + if talosConfig == nil { + opts = append(opts, client.WithTLSConfig(&tls.Config{ + InsecureSkipVerify: true, + }), client.WithEndpoints(spec.Endpoint)) + + return client.New(ctx, opts...) + } + + config := omni.NewTalosClientConfig(spec.TalosConfig, spec.Endpoint) + + opts = append(opts, client.WithConfig(config)) + + c, err := client.New(ctx, opts...) + if err != nil { + return nil, fmt.Errorf("error building Talos API client: %w", err) + } + + // if the request failed retry once again with the insecure client + _, err = c.Version(ctx) + if err != nil { + talosConfig = nil + + goto retry + } + + return c, nil +} + +func convertStage(stage runtime.MachineStage) (machine.MachineStatusEvent_MachineStage, error) { + switch stage { + case runtime.MachineStageUnknown: + return machine.MachineStatusEvent_UNKNOWN, nil + case runtime.MachineStageBooting: + return machine.MachineStatusEvent_BOOTING, nil + case runtime.MachineStageInstalling: + return machine.MachineStatusEvent_INSTALLING, nil + case runtime.MachineStageMaintenance: + return machine.MachineStatusEvent_MAINTENANCE, nil + case runtime.MachineStageRunning: + return machine.MachineStatusEvent_RUNNING, nil + case runtime.MachineStageRebooting: + return machine.MachineStatusEvent_REBOOTING, nil + case runtime.MachineStageShuttingDown: + return machine.MachineStatusEvent_SHUTTING_DOWN, nil + case runtime.MachineStageResetting: + return machine.MachineStatusEvent_RESETTING, nil + case runtime.MachineStageUpgrading: + return machine.MachineStatusEvent_UPGRADING, nil + default: + return machine.MachineStatusEvent_UNKNOWN, fmt.Errorf("unknown stage: %d", stage) + } +} + +func convertStatus(spec *runtime.MachineStatusSpec) (*machine.MachineStatusEvent, error) { + statusEventMachineStage, err := convertStage(spec.Stage) + if err != nil { + return nil, err + } + + return &machine.MachineStatusEvent{ + Stage: statusEventMachineStage, + Status: &machine.MachineStatusEvent_MachineStatus{ + Ready: spec.Status.Ready, + UnmetConditions: xslices.Map(spec.Status.UnmetConditions, func(t runtime.UnmetCondition) *machine.MachineStatusEvent_MachineStatus_UnmetCondition { + return &machine.MachineStatusEvent_MachineStatus_UnmetCondition{ + Name: t.Name, + Reason: t.Reason, + } + }), + }, + }, nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/key_pruner_test.go b/internal/backend/runtime/omni/controllers/omni/key_pruner_test.go index 7736412e..90308e8d 100644 --- a/internal/backend/runtime/omni/controllers/omni/key_pruner_test.go +++ b/internal/backend/runtime/omni/controllers/omni/key_pruner_test.go @@ -22,6 +22,8 @@ import ( ) func TestKeyPrunerSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(KeyPrunerSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/kubeconfig_test.go b/internal/backend/runtime/omni/controllers/omni/kubeconfig_test.go index c9ac8b68..b6ef86df 100644 --- a/internal/backend/runtime/omni/controllers/omni/kubeconfig_test.go +++ b/internal/backend/runtime/omni/controllers/omni/kubeconfig_test.go @@ -90,5 +90,7 @@ func (suite *KubeconfigSuite) TestReconcile() { } func TestKubeconfigSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(KubeconfigSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/kubernetes_node_audit_test.go b/internal/backend/runtime/omni/controllers/omni/kubernetes_node_audit_test.go index 0dfb0851..6d23a908 100644 --- a/internal/backend/runtime/omni/controllers/omni/kubernetes_node_audit_test.go +++ b/internal/backend/runtime/omni/controllers/omni/kubernetes_node_audit_test.go @@ -131,5 +131,7 @@ func (k *kubernetesClientMock) DeleteNode(_ context.Context, node string) error } func TestKubernetesNodeAuditSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(KubernetesNodeAuditSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/loadbalancer_test.go b/internal/backend/runtime/omni/controllers/omni/loadbalancer_test.go index 954162f6..194eb4f0 100644 --- a/internal/backend/runtime/omni/controllers/omni/loadbalancer_test.go +++ b/internal/backend/runtime/omni/controllers/omni/loadbalancer_test.go @@ -95,6 +95,8 @@ type LoadBalancerSuite struct { } func TestLoadBalancerSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(LoadBalancerSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_cleanup_test.go b/internal/backend/runtime/omni/controllers/omni/machine_cleanup_test.go index ef33864a..e9951417 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_cleanup_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_cleanup_test.go @@ -89,5 +89,7 @@ func (suite *MachineCleanupSuite) TestSkipMachineSetNodeWithOwner() { } func TestMachineCleanupSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineCleanupSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_extensions_test.go b/internal/backend/runtime/omni/controllers/omni/machine_extensions_test.go index d0f6894d..dbb876e7 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_extensions_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_extensions_test.go @@ -130,5 +130,7 @@ func (suite *ExtensionsConfigurationStatusSuite) TestReconcile() { } func TestExtensionsConfigurationStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ExtensionsConfigurationStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_labels_test.go b/internal/backend/runtime/omni/controllers/omni/machine_labels_test.go index 2033e427..a048da7e 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_labels_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_labels_test.go @@ -69,5 +69,7 @@ func (suite *MachineLabelsSuite) TestLabelsReconcile() { } func TestMachineLabelsSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineLabelsSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_set_etcd_audit_test.go b/internal/backend/runtime/omni/controllers/omni/machine_set_etcd_audit_test.go index 597000f6..5135cd2b 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_set_etcd_audit_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_set_etcd_audit_test.go @@ -530,5 +530,7 @@ func (suite *MachineSetEtcdAuditSuite) cleanupResources() { } func TestMachineSetEtcdAuditSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineSetEtcdAuditSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_set_status_test.go b/internal/backend/runtime/omni/controllers/omni/machine_set_status_test.go index 97791a38..d51783b9 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_set_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_set_status_test.go @@ -923,6 +923,8 @@ func (suite *MachineSetStatusSuite) assertMachineSetPhase(machineSet *omni.Machi } func TestMachineSetStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineSetStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status.go b/internal/backend/runtime/omni/controllers/omni/machine_status.go index 9d539919..b9510c44 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_status.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_status.go @@ -417,10 +417,6 @@ func (ctrl *MachineStatusController) handleNotification(ctx context.Context, r c spec.PlatformMetadata = event.PlatformMetadata } - if event.TalosMachineStatus != nil { - spec.TalosMachineStatus = event.TalosMachineStatus - } - if event.ImageLabels != nil { spec.ImageLabels = event.ImageLabels diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status_link_test.go b/internal/backend/runtime/omni/controllers/omni/machine_status_link_test.go index 731f2aab..91237eec 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_status_link_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_status_link_test.go @@ -208,5 +208,7 @@ func makeMD[T generic.ResourceWithRD](id resource.ID) resource.Metadata { } func TestMachineStatusLinkSuiteSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineStatusLinkSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot.go b/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot.go new file mode 100644 index 00000000..136323eb --- /dev/null +++ b/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot.go @@ -0,0 +1,241 @@ +// 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" + + "github.com/cosi-project/runtime/pkg/controller" + "github.com/cosi-project/runtime/pkg/controller/generic" + "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/optional" + "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/backend/runtime/omni/controllers/helpers" + "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/internal/task" + "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni/internal/task/snapshot" +) + +// MachineStatusSnapshotControllerName is the name of the MachineStatusSnapshotController. +const MachineStatusSnapshotControllerName = "MachineStatusSnapshotController" + +// MachineStatusSnapshotController manages omni.MachineStatuses based on information from Talos API. +type MachineStatusSnapshotController struct { + runner *task.Runner[snapshot.InfoChan, snapshot.CollectTaskSpec] + notifyCh chan *omni.MachineStatusSnapshot + siderolinkCh <-chan *omni.MachineStatusSnapshot + generic.NamedController +} + +// NewMachineStatusSnapshotController initializes MachineStatusSnapshotController. +func NewMachineStatusSnapshotController(siderolinkEventsCh <-chan *omni.MachineStatusSnapshot) *MachineStatusSnapshotController { + return &MachineStatusSnapshotController{ + NamedController: generic.NamedController{ + ControllerName: MachineStatusSnapshotControllerName, + }, + notifyCh: make(chan *omni.MachineStatusSnapshot), + siderolinkCh: siderolinkEventsCh, + runner: task.NewEqualRunner[snapshot.CollectTaskSpec](), + } +} + +// Settings implements controller.QController interface. +func (ctrl *MachineStatusSnapshotController) Settings() controller.QSettings { + return controller.QSettings{ + Inputs: []controller.Input{ + { + Namespace: resources.DefaultNamespace, + Type: omni.MachineType, + Kind: controller.InputQPrimary, + }, + { + Namespace: resources.DefaultNamespace, + Type: omni.TalosConfigType, + Kind: controller.InputQMapped, + }, + { + Namespace: resources.DefaultNamespace, + Type: omni.ClusterMachineType, + Kind: controller.InputQMapped, + }, + }, + Outputs: []controller.Output{ + { + Kind: controller.OutputExclusive, + Type: omni.MachineStatusSnapshotType, + }, + }, + Concurrency: optional.Some[uint](4), + RunHook: func(ctx context.Context, _ *zap.Logger, r controller.QRuntime) error { + for { + select { + case <-ctx.Done(): + return nil + case resource := <-ctrl.siderolinkCh: + if err := ctrl.reconcileSnapshot(ctx, r, resource); err != nil { + return err + } + case resource := <-ctrl.notifyCh: + if err := ctrl.reconcileSnapshot(ctx, r, resource); err != nil { + return err + } + } + } + }, + ShutdownHook: func() { + ctrl.runner.Stop() + }, + } +} + +// MapInput implements controller.QController interface. +func (ctrl *MachineStatusSnapshotController) MapInput(ctx context.Context, _ *zap.Logger, + r controller.QRuntime, ptr resource.Pointer, +) ([]resource.Pointer, error) { + _, err := r.Get(ctx, ptr) + if err != nil { + if state.IsNotFoundError(err) { + return nil, nil + } + } + + switch ptr.Type() { + case omni.ClusterMachineType: + fallthrough + case omni.MachineType: + return []resource.Pointer{ + omni.NewMachineStatusSnapshot(resources.DefaultNamespace, ptr.ID()).Metadata(), + }, nil + case omni.TalosConfigType: + machines, err := safe.ReaderListAll[*omni.ClusterMachineStatus](ctx, r, state.WithLabelQuery(resource.LabelEqual(omni.LabelCluster, ptr.ID()))) + if err != nil { + return nil, err + } + + res := make([]resource.Pointer, 0, machines.Len()) + + machines.ForEach(func(r *omni.ClusterMachineStatus) { + res = append(res, omni.NewMachineStatusSnapshot(resources.DefaultNamespace, r.Metadata().ID()).Metadata()) + }) + + return res, nil + } + + return nil, fmt.Errorf("unexpected resource type %q", ptr.Type()) +} + +// Reconcile implements controller.QController interface. +func (ctrl *MachineStatusSnapshotController) Reconcile(ctx context.Context, + logger *zap.Logger, r controller.QRuntime, ptr resource.Pointer, +) error { + machine, err := safe.ReaderGetByID[*omni.Machine](ctx, r, ptr.ID()) + if err != nil { + if state.IsNotFoundError(err) { + return nil + } + + return err + } + + if machine.Metadata().Phase() == resource.PhaseTearingDown { + return ctrl.reconcileTearingDown(ctx, r, logger, machine) + } + + return ctrl.reconcileRunning(ctx, r, logger, machine) +} + +func (ctrl *MachineStatusSnapshotController) reconcileRunning(ctx context.Context, r controller.QRuntime, logger *zap.Logger, machine *omni.Machine) error { + if !machine.Metadata().Finalizers().Has(ctrl.Name()) { + if err := r.AddFinalizer(ctx, machine.Metadata(), ctrl.Name()); err != nil { + return err + } + } + + ctrl.runner.StopTask(logger, machine.Metadata().ID()) + + clusterMachine, err := helpers.HandleInput[*omni.ClusterMachine](ctx, r, ctrl.Name(), machine) + if err != nil { + return err + } + + var talosConfig *omni.TalosConfig + + if clusterMachine != nil { + clusterName, ok := clusterMachine.Metadata().Labels().Get(omni.LabelCluster) + if ok { + talosConfig, err = safe.ReaderGetByID[*omni.TalosConfig](ctx, r, clusterName) + if err != nil && !state.IsNotFoundError(err) { + return err + } + } + } + + if machine.TypedSpec().Value.Connected { + ctrl.runner.StartTask(ctx, logger, machine.Metadata().ID(), snapshot.CollectTaskSpec{ + Endpoint: machine.TypedSpec().Value.ManagementAddress, + TalosConfig: talosConfig, + MachineID: machine.Metadata().ID(), + }, ctrl.notifyCh) + } + + return nil +} + +func (ctrl *MachineStatusSnapshotController) reconcileTearingDown(ctx context.Context, r controller.QRuntime, logger *zap.Logger, machine *omni.Machine) error { + ctrl.runner.StopTask(logger, machine.Metadata().ID()) + + _, err := helpers.HandleInput[*omni.ClusterMachine](ctx, r, ctrl.Name(), machine) + if err != nil { + return err + } + + md := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, machine.Metadata().ID()).Metadata() + + ready, err := r.Teardown(ctx, md) + if err != nil { + return err + } + + if !ready { + return nil + } + + if err = r.Destroy(ctx, md); err != nil { + return err + } + + return r.RemoveFinalizer(ctx, machine.Metadata(), ctrl.Name()) +} + +func (ctrl *MachineStatusSnapshotController) reconcileSnapshot(ctx context.Context, r controller.QRuntime, snapshot *omni.MachineStatusSnapshot) error { + machine, err := safe.ReaderGetByID[*omni.Machine](ctx, r, snapshot.Metadata().ID()) + if err != nil { + if state.IsNotFoundError(err) { + return nil + } + + return err + } + + if machine.Metadata().Phase() == resource.PhaseTearingDown { + return nil + } + + if err := safe.WriterModify(ctx, r, omni.NewMachineStatusSnapshot(resources.DefaultNamespace, snapshot.Metadata().ID()), func(m *omni.MachineStatusSnapshot) error { + m.TypedSpec().Value = snapshot.TypedSpec().Value + + return nil + }); err != nil && !state.IsPhaseConflictError(err) { + return fmt.Errorf("error modifying resource: %w", err) + } + + return nil +} diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot_test.go b/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot_test.go new file mode 100644 index 00000000..8b51dc0f --- /dev/null +++ b/internal/backend/runtime/omni/controllers/omni/machine_status_snapshot_test.go @@ -0,0 +1,106 @@ +// 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 ( + "context" + "testing" + "time" + + "github.com/cosi-project/runtime/pkg/resource/rtestutils" + "github.com/siderolabs/gen/channel" + "github.com/siderolabs/talos/pkg/machinery/api/machine" + "github.com/siderolabs/talos/pkg/machinery/resources/runtime" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" + + "github.com/siderolabs/omni/client/pkg/omni/resources" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" + omnictrl "github.com/siderolabs/omni/internal/backend/runtime/omni/controllers/omni" +) + +type MachineStatusSnapshotControllerSuite struct { + OmniSuite +} + +func (suite *MachineStatusSnapshotControllerSuite) TestReconcile() { + ctx, cancel := context.WithTimeout(suite.ctx, time.Second*5) + defer cancel() + + require := suite.Require() + + suite.startRuntime() + + siderolinkEventsCh := make(chan *omni.MachineStatusSnapshot) + + suite.Require().NoError(suite.runtime.RegisterQController(omnictrl.NewMachineStatusSnapshotController(siderolinkEventsCh))) + + m := omni.NewMachine(resources.DefaultNamespace, "1") + m.TypedSpec().Value.Connected = true + m.TypedSpec().Value.ManagementAddress = suite.socketConnectionString + + require.NoError(suite.state.Create(suite.ctx, m)) + + snapshot := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, m.Metadata().ID()) + + snapshot.TypedSpec().Value.MachineStatus = &machine.MachineStatusEvent{ + Stage: machine.MachineStatusEvent_BOOTING, + Status: &machine.MachineStatusEvent_MachineStatus{ + Ready: false, + UnmetConditions: []*machine.MachineStatusEvent_MachineStatus_UnmetCondition{ + { + Name: "name", + Reason: "nope", + }, + }, + }, + } + + // handle siderolink + suite.Require().True(channel.SendWithContext(ctx, siderolinkEventsCh, snapshot)) + + rtestutils.AssertResources(ctx, suite.T(), suite.state, []string{m.Metadata().ID()}, func(r *omni.MachineStatusSnapshot, assertion *assert.Assertions) { + assertion.EqualValues(snapshot.TypedSpec().Value, r.TypedSpec().Value) + }) + + snapshot = omni.NewMachineStatusSnapshot(resources.DefaultNamespace, "not exists") + + // ignore events for machines that do not exist + suite.Require().True(channel.SendWithContext(ctx, siderolinkEventsCh, snapshot)) + + rtestutils.AssertNoResource[*omni.MachineStatusSnapshot](ctx, suite.T(), suite.state, snapshot.Metadata().ID()) + + ms := runtime.NewMachineStatus() + ms.TypedSpec().Stage = runtime.MachineStageInstalling + ms.TypedSpec().Status = runtime.MachineStatusStatus{ + Ready: false, + UnmetConditions: []runtime.UnmetCondition{ + { + Name: "you", + Reason: "failed", + }, + }, + } + + suite.Require().NoError(suite.machineService.state.Create(ctx, ms)) + + rtestutils.AssertResources(ctx, suite.T(), suite.state, []string{m.Metadata().ID()}, func(r *omni.MachineStatusSnapshot, assertion *assert.Assertions) { + assertion.EqualValues(machine.MachineStatusEvent_INSTALLING, r.TypedSpec().Value.MachineStatus.Stage) + assertion.EqualValues(false, r.TypedSpec().Value.MachineStatus.Status.Ready) + assertion.EqualValues("you", r.TypedSpec().Value.MachineStatus.Status.UnmetConditions[0].Name) + assertion.EqualValues("failed", r.TypedSpec().Value.MachineStatus.Status.UnmetConditions[0].Reason) + }) + + rtestutils.DestroyAll[*omni.Machine](ctx, suite.T(), suite.state) + + rtestutils.AssertNoResource[*omni.MachineStatusSnapshot](ctx, suite.T(), suite.state, m.Metadata().ID()) +} + +func TestMachineStatusSnapshotControllerSuite(t *testing.T) { + t.Parallel() + + suite.Run(t, new(MachineStatusSnapshotControllerSuite)) +} diff --git a/internal/backend/runtime/omni/controllers/omni/machine_status_test.go b/internal/backend/runtime/omni/controllers/omni/machine_status_test.go index d23d0872..47cb0afb 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_status_test.go @@ -390,5 +390,7 @@ func (suite *MachineStatusSuite) TestMachineSchematic() { } func TestMachineStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/machine_test.go b/internal/backend/runtime/omni/controllers/omni/machine_test.go index dc6eab4e..d72e453c 100644 --- a/internal/backend/runtime/omni/controllers/omni/machine_test.go +++ b/internal/backend/runtime/omni/controllers/omni/machine_test.go @@ -62,5 +62,7 @@ func (suite *MachineSuite) TestReconcile() { } func TestMachineSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MachineSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/maintenance_config_patch_test.go b/internal/backend/runtime/omni/controllers/omni/maintenance_config_patch_test.go index df4655e8..9a412b3b 100644 --- a/internal/backend/runtime/omni/controllers/omni/maintenance_config_patch_test.go +++ b/internal/backend/runtime/omni/controllers/omni/maintenance_config_patch_test.go @@ -85,5 +85,7 @@ url: tcp://[fdae:41e4:649b:9303::1]:8092 } func TestMaintenanceConfigPatchSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MaintenanceConfigPatchSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/omni_test.go b/internal/backend/runtime/omni/controllers/omni/omni_test.go index 88fb13e7..3393e130 100644 --- a/internal/backend/runtime/omni/controllers/omni/omni_test.go +++ b/internal/backend/runtime/omni/controllers/omni/omni_test.go @@ -347,7 +347,7 @@ func (suite *OmniSuite) newServer(suffix string, opts ...grpc.ServerOption) (*ma } func (suite *OmniSuite) SetupTest() { - suite.ctx, suite.ctxCancel = context.WithTimeout(context.Background(), 60*time.Second) + suite.ctx, suite.ctxCancel = context.WithTimeout(context.Background(), 20*time.Second) suite.stateBuilder = dynamicStateBuilder{m: map[resource.Namespace]state.CoreState{}} diff --git a/internal/backend/runtime/omni/controllers/omni/redacted_cluster_machine_config_test.go b/internal/backend/runtime/omni/controllers/omni/redacted_cluster_machine_config_test.go index 09795e46..6ddd9915 100644 --- a/internal/backend/runtime/omni/controllers/omni/redacted_cluster_machine_config_test.go +++ b/internal/backend/runtime/omni/controllers/omni/redacted_cluster_machine_config_test.go @@ -69,5 +69,7 @@ func (suite *RedactedClusterMachineConfigSuite) generateConfig() []byte { } func TestRedactedClusterMachineConfigSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(RedactedClusterMachineConfigSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/schematic_configuration_test.go b/internal/backend/runtime/omni/controllers/omni/schematic_configuration_test.go index 756633fa..71261c9a 100644 --- a/internal/backend/runtime/omni/controllers/omni/schematic_configuration_test.go +++ b/internal/backend/runtime/omni/controllers/omni/schematic_configuration_test.go @@ -232,5 +232,7 @@ func (suite *SchematicConfigurationSuite) TestReconcile() { } func TestSchematicConfigurationSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(SchematicConfigurationSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/secrets_test.go b/internal/backend/runtime/omni/controllers/omni/secrets_test.go index 9cc7677d..32742869 100644 --- a/internal/backend/runtime/omni/controllers/omni/secrets_test.go +++ b/internal/backend/runtime/omni/controllers/omni/secrets_test.go @@ -154,5 +154,7 @@ func (suite *ClusterSecretsSuite) TestSecretsFromBackup() { } func TestClusterSecretsSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(ClusterSecretsSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/talos_extensions_test.go b/internal/backend/runtime/omni/controllers/omni/talos_extensions_test.go index 76c45ac2..0ebfe48b 100644 --- a/internal/backend/runtime/omni/controllers/omni/talos_extensions_test.go +++ b/internal/backend/runtime/omni/controllers/omni/talos_extensions_test.go @@ -266,5 +266,7 @@ func (suite *TalosExtensionsSuite) TestReconcile() { } func TestTalosExtensionsSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(TalosExtensionsSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/talos_upgrade_status_test.go b/internal/backend/runtime/omni/controllers/omni/talos_upgrade_status_test.go index fc849b39..7200174b 100644 --- a/internal/backend/runtime/omni/controllers/omni/talos_upgrade_status_test.go +++ b/internal/backend/runtime/omni/controllers/omni/talos_upgrade_status_test.go @@ -312,5 +312,7 @@ func (suite *TalosUpgradeStatusSuite) TestReconcileLocked() { } func TestTalosUpgradeStatusSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(TalosUpgradeStatusSuite)) } diff --git a/internal/backend/runtime/omni/controllers/omni/talosconfig_test.go b/internal/backend/runtime/omni/controllers/omni/talosconfig_test.go index 14e2f436..0ccd151e 100644 --- a/internal/backend/runtime/omni/controllers/omni/talosconfig_test.go +++ b/internal/backend/runtime/omni/controllers/omni/talosconfig_test.go @@ -96,5 +96,7 @@ func (suite *TalosConfigSuite) TestReconcile() { } func TestTalosConfigSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(TalosConfigSuite)) } diff --git a/internal/backend/runtime/omni/migration/manager.go b/internal/backend/runtime/omni/migration/manager.go index 8fc4f095..226c5498 100644 --- a/internal/backend/runtime/omni/migration/manager.go +++ b/internal/backend/runtime/omni/migration/manager.go @@ -156,6 +156,10 @@ func NewManager(state state.State, logger *zap.Logger) *Manager { callback: generateAllMaintenanceConfigs, name: "generateAllMaintenanceConfigs", }, + { + callback: setMachineStatusSnapshotOwner, + name: "setMachineStatusSnapshotOwner", + }, }, } } diff --git a/internal/backend/runtime/omni/migration/migration_test.go b/internal/backend/runtime/omni/migration/migration_test.go index 03759368..073a6473 100644 --- a/internal/backend/runtime/omni/migration/migration_test.go +++ b/internal/backend/runtime/omni/migration/migration_test.go @@ -1452,6 +1452,51 @@ func (suite *MigrationSuite) TestGenerateAllMaintenanceConfigs() { suite.Require().Equal(oldVer, config.Metadata().Version()) } +func (suite *MigrationSuite) TestSetMachineStatusSnapshotOwner() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + items := []*omni.MachineStatusSnapshot{ + omni.NewMachineStatusSnapshot(resources.DefaultNamespace, "test1"), + omni.NewMachineStatusSnapshot(resources.DefaultNamespace, "test2"), + omni.NewMachineStatusSnapshot(resources.DefaultNamespace, "test3"), + } + + for _, item := range items[:2] { + suite.Require().NoError(suite.state.Create(ctx, item)) + } + + for _, item := range items[2:] { + suite.Require().NoError(suite.state.Create( + ctx, + item, + state.WithCreateOwner(omnictrl.NewMachineStatusSnapshotController(nil).Name())), + ) + } + + // test migration in isolation + suite.Require().NoError(suite.manager.Run(ctx, migration.WithFilter(func(name string) bool { + return name == "setMachineStatusSnapshotOwner" + }))) + + check := func(item *omni.MachineStatusSnapshot, expectedVersion int) { + result, err := safe.StateGet[*omni.MachineStatusSnapshot](ctx, suite.state, item.Metadata()) + suite.Require().NoError(err) + suite.Require().Equal(omnictrl.NewMachineStatusSnapshotController(nil).Name(), result.Metadata().Owner()) + suite.Require().EqualValues(result.Metadata().Version().Value(), expectedVersion) + } + + for _, item := range items[:2] { + check(item, 2) + } + + for _, item := range items[2:] { + check(item, 1) + } +} + func TestMigrationSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(MigrationSuite)) } diff --git a/internal/backend/runtime/omni/migration/migrations.go b/internal/backend/runtime/omni/migration/migrations.go index 6c1a5f51..6fd38da4 100644 --- a/internal/backend/runtime/omni/migration/migrations.go +++ b/internal/backend/runtime/omni/migration/migrations.go @@ -1211,3 +1211,30 @@ func generateAllMaintenanceConfigs(ctx context.Context, st state.State, _ *zap.L return reconcileConfigInputs(ctx, st, item, true) }) } + +// setMachineStatusSnapshotOwner reconciles maintenance configs for all machines and update the inputs to avoid triggering config updates for each machine. +func setMachineStatusSnapshotOwner(ctx context.Context, st state.State, logger *zap.Logger) error { + list, err := safe.StateListAll[*omni.MachineStatusSnapshot](ctx, st) + if err != nil { + return err + } + + for iter := list.Iterator(); iter.Next(); { + item := iter.Value() + + if item.Metadata().Owner() != "" { + continue + } + + logger.Info("updating machine status snapshot with empty owner", zap.String("id", item.Metadata().String())) + + _, err = safe.StateUpdateWithConflicts(ctx, st, item.Metadata(), func(res *omni.MachineStatusSnapshot) error { + return res.Metadata().SetOwner(omnictrl.NewMachineStatusSnapshotController(nil).Name()) + }, state.WithExpectedPhaseAny(), state.WithUpdateOwner(item.Metadata().Owner())) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/backend/runtime/omni/omni.go b/internal/backend/runtime/omni/omni.go index 0fc4c129..e9a1a5a1 100644 --- a/internal/backend/runtime/omni/omni.go +++ b/internal/backend/runtime/omni/omni.go @@ -74,8 +74,9 @@ type Runtime struct { // //nolint:maintidx func New(talosClientFactory *talos.ClientFactory, dnsService *dns.Service, workloadProxyServiceRegistry *workloadproxy.ServiceRegistry, - resourceLogger *resourcelogger.Logger, imageFactoryClient *imagefactory.Client, linkCounterDeltaCh <-chan siderolink.LinkCounterDeltas, resourceState state.State, - virtualState *virtual.State, metricsRegistry prometheus.Registerer, discoveryClient omnictrl.DiscoveryClient, logger *zap.Logger, + resourceLogger *resourcelogger.Logger, imageFactoryClient *imagefactory.Client, linkCounterDeltaCh <-chan siderolink.LinkCounterDeltas, + siderolinkEventsCh <-chan *omni.MachineStatusSnapshot, resourceState state.State, virtualState *virtual.State, metricsRegistry prometheus.Registerer, + discoveryClient omnictrl.DiscoveryClient, logger *zap.Logger, ) (*Runtime, error) { var opts []options.Option @@ -220,6 +221,7 @@ func New(talosClientFactory *talos.ClientFactory, dnsService *dns.Service, workl omnictrl.NewTalosConfigController(constants.CertificateValidityTime), omnictrl.NewTalosExtensionsController(imageFactoryClient), omnictrl.NewTalosUpgradeStatusController(), + omnictrl.NewMachineStatusSnapshotController(siderolinkEventsCh), } if config.Config.Auth.SAML.Enabled { diff --git a/internal/backend/runtime/omni/omni_test.go b/internal/backend/runtime/omni/omni_test.go index 10b98678..e9690cca 100644 --- a/internal/backend/runtime/omni/omni_test.go +++ b/internal/backend/runtime/omni/omni_test.go @@ -84,7 +84,7 @@ func (suite *OmniRuntimeSuite) SetupTest() { workloadProxyServiceRegistry, err := workloadproxy.NewServiceRegistry(resourceState, logger) suite.Require().NoError(err) - suite.runtime, err = omniruntime.New(clientFactory, dnsService, workloadProxyServiceRegistry, nil, nil, nil, + suite.runtime, err = omniruntime.New(clientFactory, dnsService, workloadProxyServiceRegistry, nil, nil, nil, nil, resourceState, nil, prometheus.NewRegistry(), discoveryServiceClient, logger) suite.Require().NoError(err) diff --git a/internal/backend/runtime/talos/clients_test.go b/internal/backend/runtime/talos/clients_test.go index cb7d7f48..ab8eeb47 100644 --- a/internal/backend/runtime/talos/clients_test.go +++ b/internal/backend/runtime/talos/clients_test.go @@ -118,5 +118,7 @@ func (suite *ClientsSuite) TearDownTest() { } func TestClients(t *testing.T) { + t.Parallel() + suite.Run(t, &ClientsSuite{}) } diff --git a/internal/backend/server.go b/internal/backend/server.go index 0c57dbb7..61798200 100644 --- a/internal/backend/server.go +++ b/internal/backend/server.go @@ -99,6 +99,7 @@ type Server struct { imageFactoryClient *imagefactory.Client linkCounterDeltaCh chan<- siderolink.LinkCounterDeltas + siderolinkEventsCh chan<- *omnires.MachineStatusSnapshot proxyServer Proxy bindAddress string @@ -116,6 +117,7 @@ func NewServer( workloadProxyServiceRegistry *workloadproxy.ServiceRegistry, imageFactoryClient *imagefactory.Client, linkCounterDeltaCh chan<- siderolink.LinkCounterDeltas, + siderolinkEventsCh chan<- *omnires.MachineStatusSnapshot, omniRuntime *omni.Runtime, talosRuntime *talos.Runtime, logHandler *siderolink.LogHandler, @@ -133,6 +135,7 @@ func NewServer( workloadProxyServiceRegistry: workloadProxyServiceRegistry, imageFactoryClient: imageFactoryClient, linkCounterDeltaCh: linkCounterDeltaCh, + siderolinkEventsCh: siderolinkEventsCh, proxyServer: proxyServer, bindAddress: bindAddress, metricsBindAddress: metricsBindAddress, @@ -463,7 +466,7 @@ func (s *Server) runMachineAPI(ctx context.Context) error { } omniState := s.omniRuntime.State() - machineStatusHandler := machinestatus.NewHandler(omniState, s.logger) + machineStatusHandler := machinestatus.NewHandler(omniState, s.logger, s.siderolinkEventsCh) slink, err := siderolink.NewManager( ctx, @@ -505,10 +508,6 @@ func (s *Server) runMachineAPI(ctx context.Context) error { slink.Register(server) kms.Register(server) - eg.Go(func() error { - return machineStatusHandler.Start(groupCtx) - }) - eg.Go(func() error { return slink.Run(groupCtx, "", diff --git a/internal/pkg/auth/interceptor/signature_test.go b/internal/pkg/auth/interceptor/signature_test.go index e244c57a..cd667ee4 100644 --- a/internal/pkg/auth/interceptor/signature_test.go +++ b/internal/pkg/auth/interceptor/signature_test.go @@ -171,5 +171,7 @@ func (suite *SignatureTestSuite) TestValidSignature() { } func TestSignatureTestSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(SignatureTestSuite)) } diff --git a/internal/pkg/machinestatus/handler.go b/internal/pkg/machinestatus/handler.go index 9340146b..4c209d44 100644 --- a/internal/pkg/machinestatus/handler.go +++ b/internal/pkg/machinestatus/handler.go @@ -9,12 +9,11 @@ import ( "context" "fmt" "net/netip" - "sync" - "time" "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" @@ -24,110 +23,22 @@ import ( "github.com/siderolabs/omni/internal/pkg/auth/actor" ) -// Clock is here to be able to mock time.Now() in the tests. -type Clock interface { - Now() time.Time -} - -type clock struct{} - -func (c *clock) Now() time.Time { - return time.Now() -} - -type eventInfo struct { - timestamp time.Time - fromSideroLink bool -} - // Handler is a machine status handler. type Handler struct { - logger *zap.Logger - state state.State - Clock Clock - - machineToLastEventInfo map[resource.ID]eventInfo - - lock sync.Mutex + 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) *Handler { +func NewHandler(state state.State, logger *zap.Logger, notifyCh chan<- *omni.MachineStatusSnapshot) *Handler { return &Handler{ - state: state, - logger: logger, - machineToLastEventInfo: make(map[resource.ID]eventInfo), - Clock: &clock{}, + state: state, + logger: logger, + notifyCh: notifyCh, } } -// Start starts the machine status handler. -func (handler *Handler) Start(ctx context.Context) error { - eventCh := make(chan state.Event) - - machineKind := omni.NewMachine(resources.DefaultNamespace, "").Metadata() - machineStatusKind := omni.NewMachineStatus(resources.DefaultNamespace, "").Metadata() - - if err := handler.state.WatchKind(ctx, machineStatusKind, eventCh); err != nil { - return fmt.Errorf("error watching machine statuses: %w", err) - } - - if err := handler.state.WatchKind(ctx, machineKind, eventCh); err != nil { - return fmt.Errorf("error watching machines: %w", err) - } - - for { - var event state.Event - - select { - case <-ctx.Done(): - return nil - case event = <-eventCh: - switch event.Type { - case state.Errored: - return fmt.Errorf("error watching resources: %w", event.Error) - case state.Bootstrapped: // ignore - case state.Created, state.Updated: - if machineStatus, ok := event.Resource.(*omni.MachineStatus); ok { - handler.handleMachineStatusResourceUpdate(ctx, machineStatus) - } - case state.Destroyed: - if machine, ok := event.Resource.(*omni.Machine); ok { - handler.handleMachineDestroy(ctx, machine) - } - } - } - } -} - -func (handler *Handler) handleMachineStatusResourceUpdate(ctx context.Context, machineStatus *omni.MachineStatus) { - machineStatusSpec := machineStatus.TypedSpec().Value - - talosMachineStatus := machineStatusSpec.GetTalosMachineStatus() - if talosMachineStatus == nil { - return - } - - if err := handler.handleMachineStatusEvent(ctx, talosMachineStatus.Status, machineStatus.Metadata().ID(), - handler.Clock.Now(), false); err != nil { - handler.logger.Error("error handling machine status machineStatus", zap.Error(err)) - } -} - -func (handler *Handler) handleMachineDestroy(ctx context.Context, machine *omni.Machine) { - id := machine.Metadata().ID() - - if err := handler.state.Destroy(ctx, resource.NewMetadata(resources.DefaultNamespace, omni.MachineStatusSnapshotType, id, resource.VersionUndefined)); err != nil { - if !state.IsNotFoundError(err) { - handler.logger.Error("error destroying machine status snapshot", zap.Error(err)) - } - } - - handler.lock.Lock() - delete(handler.machineToLastEventInfo, id) - handler.lock.Unlock() -} - // 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) @@ -154,80 +65,25 @@ func (handler *Handler) HandleEvent(ctx context.Context, event events.Event) err switch event := event.Payload.(type) { case *machineapi.MachineStatusEvent: - return handler.handleMachineStatusEvent(ctx, event, machines.Get(0).Metadata().ID(), handler.Clock.Now(), true) + 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, timestamp time.Time, isFromSiderolink bool) error { - accept := handler.acceptEvent(machineID, timestamp, isFromSiderolink) - +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), - zap.Time("timestamp", timestamp), - zap.Bool("from_siderolink", isFromSiderolink), - zap.Bool("accept", accept)) - - if !accept { - return nil - } + ) snapshot := omni.NewMachineStatusSnapshot(resources.DefaultNamespace, machineID) - if _, err := safe.StateUpdateWithConflicts( - ctx, - handler.state, - snapshot.Metadata(), - func(status *omni.MachineStatusSnapshot) error { - status.TypedSpec().Value.MachineStatus = event + snapshot.TypedSpec().Value.MachineStatus = event - return nil - }, - ); err != nil { - if !state.IsNotFoundError(err) { - return err - } - - snapshot.TypedSpec().Value.MachineStatus = event - - return handler.state.Create(ctx, snapshot) - } + channel.SendWithContext(ctx, handler.notifyCh, snapshot) return nil } - -func (handler *Handler) acceptEvent(machineID resource.ID, timestamp time.Time, isFromSiderolink bool) bool { - handler.lock.Lock() - defer handler.lock.Unlock() - - currentEventInfo := eventInfo{ - timestamp: timestamp, - fromSideroLink: isFromSiderolink, - } - - lastEventInfo, ok := handler.machineToLastEventInfo[machineID] - - accept := false - - switch { - // The last event is zero, i.e., current event is the first event - case !ok: - accept = true - // Both the source of the current event and the last one are from SideroLink - case lastEventInfo.fromSideroLink && currentEventInfo.fromSideroLink: - accept = true - // if the current event is newer than the last one, we accept the current one - case currentEventInfo.timestamp.After(lastEventInfo.timestamp): - accept = true - } - - if accept { - handler.machineToLastEventInfo[machineID] = currentEventInfo - } - - return accept -} diff --git a/internal/pkg/machinestatus/handler_test.go b/internal/pkg/machinestatus/handler_test.go deleted file mode 100644 index 85da7f1b..00000000 --- a/internal/pkg/machinestatus/handler_test.go +++ /dev/null @@ -1,168 +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_test - -import ( - "context" - "testing" - "time" - - "github.com/cosi-project/runtime/pkg/resource/rtestutils" - "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/cosi-project/runtime/pkg/state/registry" - "github.com/jonboulle/clockwork" - "github.com/rs/xid" - "github.com/siderolabs/siderolink/pkg/events" - machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "go.uber.org/zap/zaptest" - "golang.org/x/sync/errgroup" - "google.golang.org/protobuf/types/known/timestamppb" - - "github.com/siderolabs/omni/client/api/omni/specs" - "github.com/siderolabs/omni/client/pkg/omni/resources" - "github.com/siderolabs/omni/client/pkg/omni/resources/omni" - "github.com/siderolabs/omni/internal/pkg/machinestatus" -) - -const ( - machineID = "machine-status-handler-test" - machineIP = "127.0.0.42" - machinePort = "1234" - machineIPPort = machineIP + ":" + machinePort -) - -func TestHandler(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - t.Cleanup(cancel) - - st := state.WrapCore(namespaced.NewState(inmem.Build)) - resourceRegistry := registry.NewResourceRegistry(st) - - require.NoError(t, resourceRegistry.Register(ctx, omni.NewMachineStatus(resources.DefaultNamespace, ""))) - require.NoError(t, resourceRegistry.Register(ctx, omni.NewMachine(resources.DefaultNamespace, ""))) - - handler := machinestatus.NewHandler(st, zaptest.NewLogger(t)) - - // send an event without corresponding machine - assert that it is ignored - require.ErrorContains(t, handler.HandleEvent(ctx, events.Event{ - Payload: &machineapi.MachineStatusEvent{ - Stage: machineapi.MachineStatusEvent_BOOTING, - }, - ID: xid.NewWithTime(time.Now()).String(), - Node: machineIPPort, - }), "no machines found for address "+machineIP) - - rtestutils.AssertLength[*omni.MachineStatusSnapshot](ctx, t, st, 0) - - // create a machine - - machine := omni.NewMachine(resources.DefaultNamespace, machineID) - - machine.Metadata().Labels().Set(omni.MachineAddressLabel, machineIP) - - require.NoError(t, st.Create(ctx, machine)) - - var eg errgroup.Group - - eg.Go(func() error { - return handler.Start(ctx) - }) - - // send an event over siderolink & assert that it is stored - timestamp := handler.Clock.Now() - - sendEvent(ctx, t, handler, machineapi.MachineStatusEvent_BOOTING, timestamp) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_BOOTING) - - // send another event over siderolink in the past - it should be stored despite being in the past, as the previous status was also received over siderolink - sendEvent(ctx, t, handler, machineapi.MachineStatusEvent_INSTALLING, timestamp) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_INSTALLING) - - // send a machine status in the past - it should be ignored - sendMachineStatus(ctx, t, handler, st, machineapi.MachineStatusEvent_BOOTING, timestamp.Add(-time.Second)) - time.Sleep(100 * time.Millisecond) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_INSTALLING) - - // send a machine status in the future - it should be stored - sendMachineStatus(ctx, t, handler, st, machineapi.MachineStatusEvent_REBOOTING, timestamp.Add(time.Second)) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_REBOOTING) - - // send an event in the past - it should be ignored - sendEvent(ctx, t, handler, machineapi.MachineStatusEvent_INSTALLING, timestamp.Add(-time.Second)) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_REBOOTING) - - // send an event in the future - it should be stored - sendEvent(ctx, t, handler, machineapi.MachineStatusEvent_MAINTENANCE, timestamp.Add(time.Second*2)) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_MAINTENANCE) - - // destroy and recreate the machine - require.NoError(t, st.Destroy(ctx, machine.Metadata())) - require.NoError(t, st.Create(ctx, machine)) - - time.Sleep(100 * time.Millisecond) - - // send a machine status in the past - it should be stored despite being in the past, as the state should be cleared on machine destroy - sendMachineStatus(ctx, t, handler, st, machineapi.MachineStatusEvent_RESETTING, timestamp.Add(-time.Second)) - assertStage(ctx, t, st, machineapi.MachineStatusEvent_RESETTING) - - cancel() - - require.NoError(t, eg.Wait()) -} - -func sendMachineStatus(ctx context.Context, t *testing.T, handler *machinestatus.Handler, st state.State, stage machineapi.MachineStatusEvent_MachineStage, timestamp time.Time) { - handler.Clock = clockwork.NewFakeClockAt(timestamp) - - machineStatus := omni.NewMachineStatus(resources.DefaultNamespace, machineID) - - status := &specs.MachineStatusSpec_TalosMachineStatus{ - Status: &machineapi.MachineStatusEvent{ - Stage: stage, - }, - UpdatedAt: timestamppb.New(timestamp), - } - - _, err := safe.StateUpdateWithConflicts[*omni.MachineStatus](ctx, st, machineStatus.Metadata(), func(r *omni.MachineStatus) error { - r.TypedSpec().Value.TalosMachineStatus = status - - return nil - }) - if err == nil { - return - } - - if !state.IsNotFoundError(err) { - require.NoError(t, err) - } - - machineStatus.TypedSpec().Value.TalosMachineStatus = status - - require.NoError(t, st.Create(ctx, machineStatus)) -} - -func sendEvent(ctx context.Context, t *testing.T, handler *machinestatus.Handler, stage machineapi.MachineStatusEvent_MachineStage, timestamp time.Time) { - handler.Clock = clockwork.NewFakeClockAt(timestamp) - - err := handler.HandleEvent(ctx, events.Event{ - Payload: &machineapi.MachineStatusEvent{ - Stage: stage, - }, - ID: xid.NewWithTime(timestamp).String(), - Node: machineIPPort, - }) - require.NoError(t, err) -} - -func assertStage(ctx context.Context, t *testing.T, st state.State, stage machineapi.MachineStatusEvent_MachineStage) { - rtestutils.AssertResource[*omni.MachineStatusSnapshot](ctx, t, st, machineID, func(r *omni.MachineStatusSnapshot, assertion *assert.Assertions) { - assertion.Equal(stage, r.TypedSpec().Value.GetMachineStatus().GetStage()) - }) -} diff --git a/internal/pkg/siderolink/logstorage_test.go b/internal/pkg/siderolink/logstorage_test.go index c896b575..99b07515 100644 --- a/internal/pkg/siderolink/logstorage_test.go +++ b/internal/pkg/siderolink/logstorage_test.go @@ -94,5 +94,7 @@ func sha256Hex(data []byte) string { } func TestLogStorageSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(LogStorageSuite)) } diff --git a/internal/pkg/siderolink/siderolink_test.go b/internal/pkg/siderolink/siderolink_test.go index dbf569fe..e69ba602 100644 --- a/internal/pkg/siderolink/siderolink_test.go +++ b/internal/pkg/siderolink/siderolink_test.go @@ -33,6 +33,7 @@ import ( "google.golang.org/protobuf/proto" "github.com/siderolabs/omni/client/api/omni/specs" + "github.com/siderolabs/omni/client/pkg/omni/resources/omni" "github.com/siderolabs/omni/client/pkg/omni/resources/siderolink" "github.com/siderolabs/omni/internal/pkg/config" "github.com/siderolabs/omni/internal/pkg/errgroup" @@ -110,15 +111,7 @@ func (suite *SiderolinkSuite) SetupTest() { var err error - machineStatusHandler := machinestatus.NewHandler(suite.state, zaptest.NewLogger(suite.T())) - - suite.wg.Add(1) - - go func() { - defer suite.wg.Done() - - suite.Require().NoError(machineStatusHandler.Start(suite.ctx)) - }() + machineStatusHandler := machinestatus.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.Require().NoError(err) @@ -388,6 +381,8 @@ func (suite *SiderolinkSuite) TearDownTest() { } func TestSiderolinkSuite(t *testing.T) { + t.Parallel() + suite.Run(t, new(SiderolinkSuite)) }