diff --git a/pkg/apis/dra/v1alpha4/api.pb.go b/pkg/apis/dra/v1alpha4/api.pb.go index 5c96e3ed..581c708b 100644 --- a/pkg/apis/dra/v1alpha4/api.pb.go +++ b/pkg/apis/dra/v1alpha4/api.pb.go @@ -145,9 +145,10 @@ func (m *NodePrepareResourcesResponse) GetClaims() map[string]*NodePrepareResour type NodePrepareResourceResponse struct { // These are the additional devices that kubelet must - // make available via the container runtime. A resource + // make available via the container runtime. A claim + // may have zero or more requests and each request // may have zero or more devices. - CDIDevices []string `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` + Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` // If non-empty, preparing the ResourceClaim failed. // cdi_devices is ignored in that case. Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` @@ -187,9 +188,9 @@ func (m *NodePrepareResourceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_NodePrepareResourceResponse proto.InternalMessageInfo -func (m *NodePrepareResourceResponse) GetCDIDevices() []string { +func (m *NodePrepareResourceResponse) GetDevices() []*Device { if m != nil { - return m.CDIDevices + return m.Devices } return nil } @@ -201,6 +202,81 @@ func (m *NodePrepareResourceResponse) GetError() string { return "" } +type Device struct { + // The requests in the claim that this device is associated with. + // Optional. If empty, the device is associated with all requests. + RequestNames []string `protobuf:"bytes,1,rep,name=request_names,json=requestNames,proto3" json:"request_names,omitempty"` + // The pool which contains the device. Required. + PoolName string `protobuf:"bytes,2,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` + // The device itself. Required. + DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` + // A single device instance may map to several CDI device IDs. + // None is also valid. + CDIDeviceIDs []string `protobuf:"bytes,4,rep,name=cdi_device_ids,json=cdiDeviceIds,proto3" json:"cdi_device_ids,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Device) Reset() { *m = Device{} } +func (*Device) ProtoMessage() {} +func (*Device) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{3} +} +func (m *Device) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Device.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Device) XXX_Merge(src proto.Message) { + xxx_messageInfo_Device.Merge(m, src) +} +func (m *Device) XXX_Size() int { + return m.Size() +} +func (m *Device) XXX_DiscardUnknown() { + xxx_messageInfo_Device.DiscardUnknown(m) +} + +var xxx_messageInfo_Device proto.InternalMessageInfo + +func (m *Device) GetRequestNames() []string { + if m != nil { + return m.RequestNames + } + return nil +} + +func (m *Device) GetPoolName() string { + if m != nil { + return m.PoolName + } + return "" +} + +func (m *Device) GetDeviceName() string { + if m != nil { + return m.DeviceName + } + return "" +} + +func (m *Device) GetCDIDeviceIDs() []string { + if m != nil { + return m.CDIDeviceIDs + } + return nil +} + type NodeUnprepareResourcesRequest struct { // The list of ResourceClaims that are to be unprepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` @@ -211,7 +287,7 @@ type NodeUnprepareResourcesRequest struct { func (m *NodeUnprepareResourcesRequest) Reset() { *m = NodeUnprepareResourcesRequest{} } func (*NodeUnprepareResourcesRequest) ProtoMessage() {} func (*NodeUnprepareResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} + return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *NodeUnprepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -259,7 +335,7 @@ type NodeUnprepareResourcesResponse struct { func (m *NodeUnprepareResourcesResponse) Reset() { *m = NodeUnprepareResourcesResponse{} } func (*NodeUnprepareResourcesResponse) ProtoMessage() {} func (*NodeUnprepareResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} + return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NodeUnprepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +381,7 @@ type NodeUnprepareResourceResponse struct { func (m *NodeUnprepareResourceResponse) Reset() { *m = NodeUnprepareResourceResponse{} } func (*NodeUnprepareResourceResponse) ProtoMessage() {} func (*NodeUnprepareResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} + return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *NodeUnprepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -347,7 +423,7 @@ type Claim struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + UID string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` @@ -358,7 +434,7 @@ type Claim struct { func (m *Claim) Reset() { *m = Claim{} } func (*Claim) ProtoMessage() {} func (*Claim) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} + return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *Claim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -394,9 +470,9 @@ func (m *Claim) GetNamespace() string { return "" } -func (m *Claim) GetUid() string { +func (m *Claim) GetUID() string { if m != nil { - return m.Uid + return m.UID } return "" } @@ -413,6 +489,7 @@ func init() { proto.RegisterType((*NodePrepareResourcesResponse)(nil), "v1alpha3.NodePrepareResourcesResponse") proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourcesResponse.ClaimsEntry") proto.RegisterType((*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourceResponse") + proto.RegisterType((*Device)(nil), "v1alpha3.Device") proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "v1alpha3.NodeUnprepareResourcesRequest") proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse") proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse.ClaimsEntry") @@ -423,38 +500,43 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0x36, 0x4d, 0x85, 0x27, 0x12, 0xa0, 0x55, 0x85, 0xa2, 0x50, 0x4c, 0x64, 0x51, 0x92, - 0x0b, 0xb6, 0x48, 0x8b, 0x54, 0x81, 0xb8, 0xa4, 0x05, 0xf1, 0x25, 0x84, 0x2c, 0x71, 0xe1, 0x02, - 0x6b, 0x7b, 0x70, 0x57, 0xf9, 0xd8, 0x65, 0xd7, 0x8e, 0xd4, 0x1b, 0x3f, 0x81, 0x9f, 0xd5, 0x03, - 0x07, 0xc4, 0x89, 0x53, 0x45, 0xcd, 0x1f, 0x41, 0x5e, 0x3b, 0xe9, 0x87, 0x9c, 0x26, 0x52, 0x6f, - 0x33, 0xe3, 0x9d, 0x79, 0x6f, 0xde, 0x1b, 0x19, 0x2c, 0x26, 0xb9, 0x2b, 0x95, 0x48, 0x04, 0xbd, - 0x31, 0x7d, 0xcc, 0x46, 0xf2, 0x90, 0xed, 0xb4, 0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x1f, 0x00, 0x00, 0xff, 0xff, 0x65, 0xc5, 0xc2, 0x0e, 0x91, 0x04, 0x00, - 0x00, + // 566 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0xce, 0x34, 0x97, 0xd6, 0x27, 0xf9, 0x7f, 0xa2, 0x51, 0x85, 0x42, 0x5a, 0x9c, 0xc8, 0x50, + 0x12, 0x21, 0x11, 0x8b, 0xb4, 0xa0, 0x0a, 0xc4, 0x26, 0x0d, 0x88, 0x20, 0x54, 0x21, 0x8b, 0x6e, + 0xd8, 0x04, 0xc7, 0x1e, 0x52, 0x2b, 0x97, 0x19, 0x66, 0xe2, 0x48, 0xdd, 0xf1, 0x08, 0xbc, 0x03, + 0x2f, 0xd3, 0x05, 0x0b, 0xc4, 0x8a, 0x55, 0x44, 0xcd, 0x8b, 0x20, 0xcf, 0xd8, 0x49, 0x5a, 0x39, + 0x4d, 0x25, 0x76, 0x73, 0xbe, 0x73, 0xf9, 0xce, 0x9c, 0xef, 0xcc, 0x80, 0x66, 0x33, 0xaf, 0xc1, + 0x38, 0x9d, 0x50, 0xbc, 0x35, 0x7d, 0x6c, 0x0f, 0xd9, 0xa9, 0xbd, 0x5f, 0x7e, 0xd4, 0xf7, 0x26, + 0xa7, 0x7e, 0xaf, 0xe1, 0xd0, 0x91, 0xd9, 0xa7, 0x7d, 0x6a, 0xca, 0x80, 0x9e, 0xff, 0x49, 0x5a, + 0xd2, 0x90, 0x27, 0x95, 0x68, 0xbc, 0x82, 0x9d, 0x63, 0xea, 0x92, 0x77, 0x9c, 0x30, 0x9b, 0x13, + 0x8b, 0x08, 0xea, 0x73, 0x87, 0x08, 0x8b, 0x7c, 0xf6, 0x89, 0x98, 0xe0, 0x1a, 0xe4, 0x9c, 0xa1, + 0xed, 0x8d, 0x44, 0x09, 0x55, 0xd3, 0xf5,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1e, 0x19, 0x92, 0x89, 0xc9, 0x06, 0x7d, 0xd3, 0x66, 0x9e, 0x30, 0x5d, 0x6e, 0x9b, + 0x11, 0xc9, 0x41, 0x2f, 0x27, 0x7f, 0xbd, 0xfd, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x91, 0xf3, + 0x7a, 0xa9, 0x3b, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -698,11 +780,71 @@ func (m *NodePrepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 } - if len(m.CDIDevices) > 0 { - for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CDIDevices[iNdEx]) - copy(dAtA[i:], m.CDIDevices[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDevices[iNdEx]))) + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Device) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Device) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CDIDeviceIDs) > 0 { + for iNdEx := len(m.CDIDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CDIDeviceIDs[iNdEx]) + copy(dAtA[i:], m.CDIDeviceIDs[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDeviceIDs[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.DeviceName) > 0 { + i -= len(m.DeviceName) + copy(dAtA[i:], m.DeviceName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) + i-- + dAtA[i] = 0x1a + } + if len(m.PoolName) > 0 { + i -= len(m.PoolName) + copy(dAtA[i:], m.PoolName) + i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) + i-- + dAtA[i] = 0x12 + } + if len(m.RequestNames) > 0 { + for iNdEx := len(m.RequestNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RequestNames[iNdEx]) + copy(dAtA[i:], m.RequestNames[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.RequestNames[iNdEx]))) i-- dAtA[i] = 0xa } @@ -853,10 +995,10 @@ func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Uid) > 0 { - i -= len(m.Uid) - copy(dAtA[i:], m.Uid) - i = encodeVarintApi(dAtA, i, uint64(len(m.Uid))) + if len(m.UID) > 0 { + i -= len(m.UID) + copy(dAtA[i:], m.UID) + i = encodeVarintApi(dAtA, i, uint64(len(m.UID))) i-- dAtA[i] = 0x12 } @@ -924,9 +1066,9 @@ func (m *NodePrepareResourceResponse) Size() (n int) { } var l int _ = l - if len(m.CDIDevices) > 0 { - for _, s := range m.CDIDevices { - l = len(s) + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.Size() n += 1 + l + sovApi(uint64(l)) } } @@ -937,6 +1079,35 @@ func (m *NodePrepareResourceResponse) Size() (n int) { return n } +func (m *Device) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RequestNames) > 0 { + for _, s := range m.RequestNames { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + l = len(m.PoolName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.DeviceName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if len(m.CDIDeviceIDs) > 0 { + for _, s := range m.CDIDeviceIDs { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + return n +} + func (m *NodeUnprepareResourcesRequest) Size() (n int) { if m == nil { return 0 @@ -997,7 +1168,7 @@ func (m *Claim) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.Uid) + l = len(m.UID) if l > 0 { n += 1 + l + sovApi(uint64(l)) } @@ -1053,13 +1224,31 @@ func (this *NodePrepareResourceResponse) String() string { if this == nil { return "nil" } + repeatedStringForDevices := "[]*Device{" + for _, f := range this.Devices { + repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," + } + repeatedStringForDevices += "}" s := strings.Join([]string{`&NodePrepareResourceResponse{`, - `CDIDevices:` + fmt.Sprintf("%v", this.CDIDevices) + `,`, + `Devices:` + repeatedStringForDevices + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } +func (this *Device) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Device{`, + `RequestNames:` + fmt.Sprintf("%v", this.RequestNames) + `,`, + `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, + `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, + `CDIDeviceIDs:` + fmt.Sprintf("%v", this.CDIDeviceIDs) + `,`, + `}`, + }, "") + return s +} func (this *NodeUnprepareResourcesRequest) String() string { if this == nil { return "nil" @@ -1111,7 +1300,7 @@ func (this *Claim) String() string { } s := strings.Join([]string{`&Claim{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, + `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") @@ -1419,7 +1608,41 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &Device{}) + if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1447,11 +1670,93 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CDIDevices = append(m.CDIDevices, string(dAtA[iNdEx:postIndex])) + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Device) Unmarshal(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 ErrIntOverflowApi + } + 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: Device: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestNames = append(m.RequestNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1479,7 +1784,71 @@ func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Error = string(dAtA[iNdEx:postIndex]) + m.PoolName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CDIDeviceIDs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CDIDeviceIDs = append(m.CDIDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -1910,7 +2279,7 @@ func (m *Claim) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1938,7 +2307,7 @@ func (m *Claim) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Uid = string(dAtA[iNdEx:postIndex]) + m.UID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { diff --git a/pkg/apis/dra/v1alpha4/api.proto b/pkg/apis/dra/v1alpha4/api.proto index 04a37453..ddc33490 100644 --- a/pkg/apis/dra/v1alpha4/api.proto +++ b/pkg/apis/dra/v1alpha4/api.proto @@ -62,14 +62,31 @@ message NodePrepareResourcesResponse { message NodePrepareResourceResponse { // These are the additional devices that kubelet must - // make available via the container runtime. A resource + // make available via the container runtime. A claim + // may have zero or more requests and each request // may have zero or more devices. - repeated string cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; + repeated Device devices = 1; // If non-empty, preparing the ResourceClaim failed. // cdi_devices is ignored in that case. string error = 2; } +message Device { + // The requests in the claim that this device is associated with. + // Optional. If empty, the device is associated with all requests. + repeated string request_names = 1; + + // The pool which contains the device. Required. + string pool_name = 2; + + // The device itself. Required. + string device_name = 3; + + // A single device instance may map to several CDI device IDs. + // None is also valid. + repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"]; +} + message NodeUnprepareResourcesRequest { // The list of ResourceClaims that are to be unprepared. repeated Claim claims = 1; @@ -93,7 +110,7 @@ message Claim { string namespace = 1; // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. - string uid = 2; + string uid = 2 [(gogoproto.customname) = "UID"]; // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. string name = 3; diff --git a/pkg/apis/podresources/v1/api.pb.go b/pkg/apis/podresources/v1/api.pb.go index 5ca45458..a67c289a 100644 --- a/pkg/apis/podresources/v1/api.pb.go +++ b/pkg/apis/podresources/v1/api.pb.go @@ -586,7 +586,8 @@ func (m *NUMANode) GetID() int64 { // DynamicResource contains information about the devices assigned to a container by DRA type DynamicResource struct { - ClassName string `protobuf:"bytes,1,opt,name=class_name,json=className,proto3" json:"class_name,omitempty"` + // tombstone: removed in 1.31 because claims are no longer associated with one class + // string class_name = 1; ClaimName string `protobuf:"bytes,2,opt,name=claim_name,json=claimName,proto3" json:"claim_name,omitempty"` ClaimNamespace string `protobuf:"bytes,3,opt,name=claim_namespace,json=claimNamespace,proto3" json:"claim_namespace,omitempty"` ClaimResources []*ClaimResource `protobuf:"bytes,4,rep,name=claim_resources,json=claimResources,proto3" json:"claim_resources,omitempty"` @@ -626,13 +627,6 @@ func (m *DynamicResource) XXX_DiscardUnknown() { var xxx_messageInfo_DynamicResource proto.InternalMessageInfo -func (m *DynamicResource) GetClassName() string { - if m != nil { - return m.ClassName - } - return "" -} - func (m *DynamicResource) GetClaimName() string { if m != nil { return m.ClaimName @@ -654,9 +648,15 @@ func (m *DynamicResource) GetClaimResources() []*ClaimResource { return nil } -// ClaimResource contains per plugin resource information +// ClaimResource contains resource information. The driver name/pool name/device name +// triplet uniquely identifies the device. Should DRA get extended to other kinds +// of resources, then device_name will be empty and other fields will get added. +// Each device at the DRA API level may map to zero or more CDI devices. type ClaimResource struct { CDIDevices []*CDIDevice `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` + DriverName string `protobuf:"bytes,2,opt,name=driver_name,json=driverName,proto3" json:"driver_name,omitempty"` + PoolName string `protobuf:"bytes,3,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` + DeviceName string `protobuf:"bytes,4,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -700,6 +700,27 @@ func (m *ClaimResource) GetCDIDevices() []*CDIDevice { return nil } +func (m *ClaimResource) GetDriverName() string { + if m != nil { + return m.DriverName + } + return "" +} + +func (m *ClaimResource) GetPoolName() string { + if m != nil { + return m.PoolName + } + return "" +} + +func (m *ClaimResource) GetDeviceName() string { + if m != nil { + return m.DeviceName + } + return "" +} + // CDIDevice specifies a CDI device information type CDIDevice struct { // Fully qualified CDI device name @@ -871,55 +892,57 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 760 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x5d, 0x6f, 0x12, 0x4d, - 0x14, 0xee, 0xb0, 0xf4, 0x83, 0x53, 0xe8, 0xc7, 0xbc, 0x6f, 0x5a, 0x4a, 0x5b, 0x20, 0xdb, 0x8b, - 0x36, 0x51, 0x21, 0xad, 0xd1, 0x18, 0x2f, 0x4c, 0x3f, 0x30, 0x0d, 0x89, 0xad, 0x75, 0x53, 0x13, - 0xe3, 0x85, 0x64, 0xd9, 0x9d, 0xe2, 0xa4, 0xc0, 0x8c, 0xcc, 0x42,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xf9, 0x45, 0x54, 0x42, 0xfa, 0x26, 0x7d, 0xe3, 0xa9, 0xd4, 0x79, 0x13, - 0x40, 0x4b, 0x18, 0xcc, 0x70, 0xc2, 0x4a, 0x68, 0x8b, 0x54, 0xef, 0x6e, 0x69, 0xec, 0x41, 0x32, - 0x8c, 0x60, 0x13, 0xa6, 0x9b, 0xcc, 0x0d, 0x06, 0x33, 0x29, 0x5d, 0x4f, 0x5f, 0x9f, 0x1c, 0x9c, - 0x32, 0x97, 0x58, 0x1a, 0x32, 0x33, 0x30, 0xe7, 0x9b, 0xf0, 0x02, 0xc4, 0xca, 0x25, 0x95, 0xa6, - 0x61, 0xc5, 0xca, 0x25, 0xf3, 0x3b, 0x82, 0xc5, 0x11, 0xc9, 0x65, 0xc2, 0x4e, 0xdd, 0x16, 0x22, - 0x5c, 0x52, 0x42, 0x59, 0xfc, 0x7a, 0x9c, 0xba, 0x4d, 0x1b, 0x1a, 0x8e, 0x05, 0x30, 0x6d, 0x28, - 0x78, 0x1b, 0x16, 0x07, 0xb0, 0x9e, 0x6e, 0x43, 0x71, 0x16, 0x02, 0x8e, 0x1e, 0xf1, 0xa7, 0x3e, - 0x71, 0x30, 0x07, 0x7a, 0x7e, 0x96, 0xd5, 0xfc, 0x48, 0x28, 0x98, 0x02, 0xed, 0x3b, 0x98, 0x81, - 0x97, 0x90, 0x1a, 0x22, 0xe0, 0x67, 0x30, 0xef, 0xb8, 0xb4, 0x32, 0xbc, 0x59, 0x52, 0x2a, 0x50, - 0xa9, 0xac, 0xdb, 0x75, 0xb8, 0xd0, 0xfb, 0x95, 0x83, 0xe0, 0x2a, 0xdf, 0x8d, 0x4b, 0xfb, 0x67, - 0x33, 0x07, 0x89, 0x00, 0x89, 0x7a, 0x2d, 0xe6, 0x1b, 0x58, 0x39, 0x26, 0x51, 0xfb, 0x03, 0xaf, - 0xc1, 0x9c, 0xdc, 0x11, 0x21, 0x8f, 0x59, 0xce, 0x5c, 0xa5, 0xc5, 0x96, 0x5e, 0x1f, 0xa3, 0xef, - 0x3c, 0xd9, 0xc7, 0x95, 0xcd, 0x3c, 0x83, 0xd5, 0xb1, 0xc8, 0x93, 0xd7, 0x0f, 0xba, 0x7d, 0xfd, - 0xec, 0xfd, 0x41, 0x80, 0xc3, 0xb0, 0x5c, 0x6f, 0xa4, 0x85, 0x8f, 0x20, 0x2e, 0x4f, 0x78, 0x5d, - 0xba, 0x4f, 0xd8, 0x86, 0x99, 0x8d, 0x68, 0x50, 0x27, 0x64, 0x4e, 0xe1, 0x77, 0x2a, 0xdb, 0xa8, - 0x0d, 0x8f, 0x73, 0xd2, 0xf5, 0x1f, 0xdf, 0x86, 0x4c, 0x7e, 0x32, 0x21, 0x88, 0xbf, 0x0f, 0xc6, - 0x31, 0xf1, 0x70, 0x46, 0x52, 0xa3, 0x05, 0xcf, 0xac, 0x47, 0x62, 0x7e, 0x84, 0xc3, 0xe7, 0x57, - 0x37, 0x59, 0xf4, 0xf3, 0x26, 0x3b, 0xf5, 0xb9, 0x97, 0x45, 0x57, 0xbd, 0x2c, 0xfa, 0xd1, 0xcb, - 0xa2, 0xeb, 0x5e, 0x16, 0x7d, 0xfd, 0x9d, 0x9d, 0x7a, 0xbb, 0x7d, 0xf9, 0x44, 0x14, 0x28, 0x2b, - 0x5e, 0xb6, 0xab, 0xa4, 0x4e, 0xbc, 0x22, 0xbf, 0xac, 0x15, 0x6d, 0x4e, 0x45, 0x91, 0x33, 0x37, - 0xd0, 0xb9, 0xd8, 0xd9, 0xad, 0xce, 0xa8, 0xcf, 0xdd, 0xc3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x49, 0xac, 0x87, 0x00, 0x2e, 0x07, 0x00, 0x00, + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6f, 0xda, 0x48, + 0x18, 0xce, 0x60, 0x92, 0xc0, 0x0b, 0xe4, 0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xbc, 0x1a, 0xbb, 0x69, 0xd7, 0x4c, 0xe6, 0xf0, 0x1a, 0xa3, 0x76, 0x58, 0xe7, 0xda, + 0xe0, 0xa0, 0xb5, 0x24, 0xbf, 0x97, 0xbf, 0x7f, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x1b, 0x18, + 0xf9, 0x6f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1580,13 +1603,6 @@ func (m *DynamicResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ClassName) > 0 { - i -= len(m.ClassName) - copy(dAtA[i:], m.ClassName) - i = encodeVarintApi(dAtA, i, uint64(len(m.ClassName))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -1610,6 +1626,27 @@ func (m *ClaimResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DeviceName) > 0 { + i -= len(m.DeviceName) + copy(dAtA[i:], m.DeviceName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) + i-- + dAtA[i] = 0x22 + } + if len(m.PoolName) > 0 { + i -= len(m.PoolName) + copy(dAtA[i:], m.PoolName) + i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) + i-- + dAtA[i] = 0x1a + } + if len(m.DriverName) > 0 { + i -= len(m.DriverName) + copy(dAtA[i:], m.DriverName) + i = encodeVarintApi(dAtA, i, uint64(len(m.DriverName))) + i-- + dAtA[i] = 0x12 + } if len(m.CDIDevices) > 0 { for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { { @@ -1938,10 +1975,6 @@ func (m *DynamicResource) Size() (n int) { } var l int _ = l - l = len(m.ClassName) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } l = len(m.ClaimName) if l > 0 { n += 1 + l + sovApi(uint64(l)) @@ -1971,6 +2004,18 @@ func (m *ClaimResource) Size() (n int) { n += 1 + l + sovApi(uint64(l)) } } + l = len(m.DriverName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.PoolName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.DeviceName) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } @@ -2183,7 +2228,6 @@ func (this *DynamicResource) String() string { } repeatedStringForClaimResources += "}" s := strings.Join([]string{`&DynamicResource{`, - `ClassName:` + fmt.Sprintf("%v", this.ClassName) + `,`, `ClaimName:` + fmt.Sprintf("%v", this.ClaimName) + `,`, `ClaimNamespace:` + fmt.Sprintf("%v", this.ClaimNamespace) + `,`, `ClaimResources:` + repeatedStringForClaimResources + `,`, @@ -2202,6 +2246,9 @@ func (this *ClaimResource) String() string { repeatedStringForCDIDevices += "}" s := strings.Join([]string{`&ClaimResource{`, `CDIDevices:` + repeatedStringForCDIDevices + `,`, + `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, + `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, + `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, `}`, }, "") return s @@ -3500,38 +3547,6 @@ func (m *DynamicResource) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: DynamicResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClassName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClassName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimName", wireType) @@ -3714,6 +3729,102 @@ func (m *ClaimResource) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DriverName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PoolName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/pkg/apis/podresources/v1/api.proto b/pkg/apis/podresources/v1/api.proto index 9e6022ac..93ab0185 100644 --- a/pkg/apis/podresources/v1/api.proto +++ b/pkg/apis/podresources/v1/api.proto @@ -82,15 +82,22 @@ message NUMANode { // DynamicResource contains information about the devices assigned to a container by DRA message DynamicResource { - string class_name = 1; + // tombstone: removed in 1.31 because claims are no longer associated with one class + // string class_name = 1; string claim_name = 2; string claim_namespace = 3; repeated ClaimResource claim_resources = 4; } -// ClaimResource contains per plugin resource information +// ClaimResource contains resource information. The driver name/pool name/device name +// triplet uniquely identifies the device. Should DRA get extended to other kinds +// of resources, then device_name will be empty and other fields will get added. +// Each device at the DRA API level may map to zero or more CDI devices. message ClaimResource { repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; + string driver_name = 2; + string pool_name = 3; + string device_name = 4; } // CDIDevice specifies a CDI device information