From 8957e0a54a7fc765e565d5af5e32bc0e863bb65b Mon Sep 17 00:00:00 2001 From: Marques Johansson Date: Wed, 12 Jan 2022 12:42:49 -0500 Subject: [PATCH 1/2] add VendorData to HardwareSpec Signed-off-by: Marques Johansson --- config/crd/bases/tinkerbell.org_hardware.yaml | 5 +++++ pkg/apis/core/v1alpha1/hardware_types.go | 5 +++++ pkg/apis/core/v1alpha1/zz_generated.deepcopy.go | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/config/crd/bases/tinkerbell.org_hardware.yaml b/config/crd/bases/tinkerbell.org_hardware.yaml index c52f13bb7..444444f15 100644 --- a/config/crd/bases/tinkerbell.org_hardware.yaml +++ b/config/crd/bases/tinkerbell.org_hardware.yaml @@ -361,6 +361,11 @@ spec: UserData is the user data to configure in the hardware's metadata type: string + vendorData: + description: + VendorData is the vendor data to configure in the hardware's + metadata + type: string type: object status: description: HardwareStatus defines the observed state of Hardware. diff --git a/pkg/apis/core/v1alpha1/hardware_types.go b/pkg/apis/core/v1alpha1/hardware_types.go index cdcc6e61d..4dc7ec770 100644 --- a/pkg/apis/core/v1alpha1/hardware_types.go +++ b/pkg/apis/core/v1alpha1/hardware_types.go @@ -74,6 +74,11 @@ type HardwareSpec struct { // metadata //+optional UserData *string `json:"userData,omitempty"` + + // VendorData is the vendor data to configure in the hardware's + // metadata + //+optional + VendorData *string `json:"vendorData,omitempty"` } // Interface represents a network interface configuration for Hardware. diff --git a/pkg/apis/core/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/core/v1alpha1/zz_generated.deepcopy.go index c4ae18542..c4ebda388 100644 --- a/pkg/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -239,6 +239,11 @@ func (in *HardwareSpec) DeepCopyInto(out *HardwareSpec) { *out = new(string) **out = **in } + if in.VendorData != nil { + in, out := &in.VendorData, &out.VendorData + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HardwareSpec. From 5ed656b9f64be44d9e16a7d38ab512948173fdf6 Mon Sep 17 00:00:00 2001 From: Marques Johansson Date: Wed, 12 Jan 2022 13:09:50 -0500 Subject: [PATCH 2/2] add vendordata to packet.proto Signed-off-by: Marques Johansson --- protos/packet/packet.pb.go | 16 +++++++++++++--- protos/packet/packet.proto | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/protos/packet/packet.pb.go b/protos/packet/packet.pb.go index ba7eddedf..d7da3143b 100644 --- a/protos/packet/packet.pb.go +++ b/protos/packet/packet.pb.go @@ -183,6 +183,7 @@ type Metadata_Instance struct { Storage *Metadata_Instance_Storage `protobuf:"bytes,13,opt,name=storage,proto3" json:"storage,omitempty"` SshKeys []string `protobuf:"bytes,14,rep,name=ssh_keys,json=sshKeys,proto3" json:"ssh_keys,omitempty"` NetworkReady bool `protobuf:"varint,15,opt,name=network_ready,json=networkReady,proto3" json:"network_ready,omitempty"` + Vendordata string `protobuf:"bytes,16,opt,name=vendordata,proto3" json:"vendordata,omitempty"` } func (x *Metadata_Instance) Reset() { @@ -322,6 +323,13 @@ func (x *Metadata_Instance) GetNetworkReady() bool { return false } +func (x *Metadata_Instance) GetVendordata() string { + if x != nil { + return x.Vendordata + } + return "" +} + type Metadata_Custom struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1149,7 +1157,7 @@ var file_protos_packet_packet_proto_rawDesc = []byte{ 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x62, 0x65, 0x6c, 0x6c, 0x2e, 0x74, 0x69, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x9b, 0x18, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x22, 0xbb, 0x18, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, @@ -1179,7 +1187,7 @@ var file_protos_packet_packet_proto_rawDesc = []byte{ 0x63, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x1a, 0x32, 0x0a, 0x0c, 0x4d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x1a, 0xe8, 0x11, 0x0a, 0x08, 0x49, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x1a, 0x88, 0x12, 0x0a, 0x08, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, @@ -1221,7 +1229,9 @@ var file_protos_packet_packet_proto_rawDesc = []byte{ 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x73, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x61, - 0x64, 0x79, 0x1a, 0x8d, 0x01, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, + 0x64, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x64, 0x61, + 0x74, 0x61, 0x1a, 0x8d, 0x01, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x73, 0x74, 0x72, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x73, 0x74, diff --git a/protos/packet/packet.proto b/protos/packet/packet.proto index 69d92fb2e..0488b2869 100644 --- a/protos/packet/packet.proto +++ b/protos/packet/packet.proto @@ -95,6 +95,7 @@ message Metadata { Storage storage = 13; repeated string ssh_keys = 14; bool network_ready = 15; + string vendordata = 16; } message Custom { Instance.OperatingSystem preinstalled_operating_system_version = 1;