Skip to content

Commit

Permalink
labels
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Richerson <[email protected]>
  • Loading branch information
matthew-richerson committed Jan 28, 2025
1 parent 5124646 commit 8708952
Show file tree
Hide file tree
Showing 15 changed files with 352 additions and 98 deletions.
16 changes: 16 additions & 0 deletions api/v1alpha2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ func (src *NnfNodeStorage) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.LustreStorage.LustreComponents.MGTMDTs = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.MGTMDTs...)
dst.Spec.LustreStorage.LustreComponents.OSTs = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.OSTs...)
dst.Spec.LustreStorage.LustreComponents.NNFNodes = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.NNFNodes...)
dst.Spec.CommandVariables = make([]nnfv1alpha4.CommandVariablesSpec, len(restored.Spec.CommandVariables))
copy(dst.Spec.CommandVariables, restored.Spec.CommandVariables)
}

return nil
Expand Down Expand Up @@ -429,6 +431,10 @@ func (src *NnfStorage) ConvertTo(dstRaw conversion.Hub) error {
dst.Status.LustreComponents.MGTMDTs = append([]string(nil), restored.Status.LustreComponents.MGTMDTs...)
dst.Status.LustreComponents.OSTs = append([]string(nil), restored.Status.LustreComponents.OSTs...)
dst.Status.LustreComponents.NNFNodes = append([]string(nil), restored.Status.LustreComponents.NNFNodes...)
for i := range restored.Spec.AllocationSets {
dst.Spec.AllocationSets[i].CommandVariables = make([]nnfv1alpha4.CommandVariablesSpec, len(restored.Spec.AllocationSets[i].CommandVariables))
copy(dst.Spec.AllocationSets[i].CommandVariables, restored.Spec.AllocationSets[i].CommandVariables)
}
}

return nil
Expand Down Expand Up @@ -696,3 +702,13 @@ func Convert_v1alpha4_LustreStorageSpec_To_v1alpha2_LustreStorageSpec(in *nnfv1a
func Convert_v1alpha4_NnfStorageLustreStatus_To_v1alpha2_NnfStorageLustreStatus(in *nnfv1alpha4.NnfStorageLustreStatus, out *NnfStorageLustreStatus, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfStorageLustreStatus_To_v1alpha2_NnfStorageLustreStatus(in, out, s)
}

// Convert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha2_NnfStorageAllocationSetSpec is an autogenerated conversion function.
func Convert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha2_NnfStorageAllocationSetSpec(in *nnfv1alpha4.NnfStorageAllocationSetSpec, out *NnfStorageAllocationSetSpec, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha2_NnfStorageAllocationSetSpec(in, out, s)
}

// Convert_v1alpha4_NnfNodeStorageSpec_To_v1alpha2_NnfNodeStorageSpec is an autogenerated conversion function.
func Convert_v1alpha4_NnfNodeStorageSpec_To_v1alpha2_NnfNodeStorageSpec(in *nnfv1alpha4.NnfNodeStorageSpec, out *NnfNodeStorageSpec, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfNodeStorageSpec_To_v1alpha2_NnfNodeStorageSpec(in, out, s)
}
56 changes: 34 additions & 22 deletions api/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions api/v1alpha3/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ func (src *NnfNodeStorage) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.LustreStorage.LustreComponents.MGTMDTs = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.MGTMDTs...)
dst.Spec.LustreStorage.LustreComponents.OSTs = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.OSTs...)
dst.Spec.LustreStorage.LustreComponents.NNFNodes = append([]string(nil), restored.Spec.LustreStorage.LustreComponents.NNFNodes...)
dst.Spec.CommandVariables = make([]nnfv1alpha4.CommandVariablesSpec, len(restored.Spec.CommandVariables))
copy(dst.Spec.CommandVariables, restored.Spec.CommandVariables)
}

return nil
Expand Down Expand Up @@ -428,6 +430,10 @@ func (src *NnfStorage) ConvertTo(dstRaw conversion.Hub) error {
dst.Status.LustreComponents.MGTMDTs = append([]string(nil), restored.Status.LustreComponents.MGTMDTs...)
dst.Status.LustreComponents.OSTs = append([]string(nil), restored.Status.LustreComponents.OSTs...)
dst.Status.LustreComponents.NNFNodes = append([]string(nil), restored.Status.LustreComponents.NNFNodes...)
for i := range restored.Spec.AllocationSets {
dst.Spec.AllocationSets[i].CommandVariables = make([]nnfv1alpha4.CommandVariablesSpec, len(restored.Spec.AllocationSets[i].CommandVariables))
copy(dst.Spec.AllocationSets[i].CommandVariables, restored.Spec.AllocationSets[i].CommandVariables)
}
}

return nil
Expand Down Expand Up @@ -711,3 +717,13 @@ func Convert_v1alpha4_LustreStorageSpec_To_v1alpha3_LustreStorageSpec(in *nnfv1a
func Convert_v1alpha4_NnfStorageLustreStatus_To_v1alpha3_NnfStorageLustreStatus(in *nnfv1alpha4.NnfStorageLustreStatus, out *NnfStorageLustreStatus, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfStorageLustreStatus_To_v1alpha3_NnfStorageLustreStatus(in, out, s)
}

// Convert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha3_NnfStorageAllocationSetSpec is an autogenerated conversion function.
func Convert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha3_NnfStorageAllocationSetSpec(in *nnfv1alpha4.NnfStorageAllocationSetSpec, out *NnfStorageAllocationSetSpec, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfStorageAllocationSetSpec_To_v1alpha3_NnfStorageAllocationSetSpec(in, out, s)
}

// Convert_v1alpha4_NnfNodeStorageSpec_To_v1alpha3_NnfNodeStorageSpec is an autogenerated conversion function.
func Convert_v1alpha4_NnfNodeStorageSpec_To_v1alpha3_NnfNodeStorageSpec(in *nnfv1alpha4.NnfNodeStorageSpec, out *NnfNodeStorageSpec, s apiconversion.Scope) error {
return autoConvert_v1alpha4_NnfNodeStorageSpec_To_v1alpha3_NnfNodeStorageSpec(in, out, s)
}
56 changes: 34 additions & 22 deletions api/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/v1alpha4/nnfnodestorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ type NnfNodeStorageSpec struct {
// Group ID for file system
GroupID uint32 `json:"groupID"`

CommandVariables []CommandVariablesSpec `json:"commandVariables,omitempty"`

// FileSystemType defines the type of the desired filesystem, or raw
// block device.
// +kubebuilder:validation:Enum=raw;lvm;zfs;xfs;gfs2;lustre
Expand Down
18 changes: 18 additions & 0 deletions api/v1alpha4/nnfstorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ type NnfStorageLustreComponents struct {
NNFNodes []string `json:"nnfNodes,omitempty"`
}

type CommandVariablesSpec struct {
// Indexed determines whether to use the same value for each allocation, or to use
// a different value based on the index of the allocation.
Indexed bool `json:"indexed,omitempty"`

// Name of the variable
Name string `json:"name,omitempty"`

// Value for the variable
Value string `json:"value,omitempty"`

// IndexedValues is a list of strings values for the variable. The list length should
// be the same as the allocation count in the NnfNodeStorageSpec.
IndexedValues []string `json:"indexedValues,omitempty"`
}

// NnfStorageAllocationSetSpec defines the details for an allocation set
type NnfStorageAllocationSetSpec struct {
// Name is a human readable label for this set of allocations (e.g., xfs)
Expand All @@ -97,6 +113,8 @@ type NnfStorageAllocationSetSpec struct {
// (within the same workflow) on a Rabbit
SharedAllocation bool `json:"sharedAllocation"`

CommandVariables []CommandVariablesSpec `json:"commandVariables,omitempty"`

// Nodes is the list of Rabbit nodes to make allocations on
Nodes []NnfStorageAllocationNodes `json:"nodes"`
}
Expand Down
Loading

0 comments on commit 8708952

Please sign in to comment.