Skip to content

Commit 77d53e7

Browse files
kvapsclaude
andcommitted
fix(rest): accept override_props on ResourceGroup create + spawn
golinstor reuses GenericPropsModify body fields (override_props, delete_props, delete_namespaces) on the RG create and spawn calls. DisallowUnknownFields decoders rejected those payloads even though Java LINSTOR would have ignored them on a no-op modify. Add the fields to ResourceGroup and ResourceGroupSpawn so csi-sanity's CreateVolume path stops failing on the strict decoder. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 8433fcb commit 77d53e7

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

pkg/api/v1/resource_group.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ type ResourceGroup struct {
2727
VolumeGroups []VolumeGroup `json:"volume_groups,omitempty"`
2828
UUID string `json:"uuid,omitempty"`
2929
PeerSlots int32 `json:"peer_slots,omitempty"`
30+
31+
// OverrideProps / DeleteProps / DeleteNamespace mirror
32+
// GenericPropsModify. golinstor sends them on RG create/modify
33+
// through a shared body type, so DisallowUnknownFields decoders
34+
// must accept them even though we treat the call idempotently.
35+
OverrideProps map[string]string `json:"override_props,omitempty"`
36+
DeleteProps []string `json:"delete_props,omitempty"`
37+
DeleteNamespace []string `json:"delete_namespaces,omitempty"`
3038
}
3139

3240
// VolumeGroup mirrors upstream `VolumeGroup`. It is a per-volume template
@@ -59,10 +67,16 @@ type AutoSelectFilter struct {
5967

6068
// ResourceGroupSpawn is the payload for POST /resource-groups/{rg}/spawn —
6169
// the call linstor-csi uses to actually create a Resource from a group.
70+
// Upstream LINSTOR reuses GenericPropsModify here too, so we accept the
71+
// override_props / delete_props fields even though we don't consume them.
6272
type ResourceGroupSpawn struct {
63-
ResourceDefinitionName string `json:"resource_definition_name,omitempty"`
64-
ResourceDefinitionExternal string `json:"resource_definition_external_name,omitempty"`
65-
VolumeSizes []int64 `json:"volume_sizes,omitempty"`
66-
PartialFlag bool `json:"partial,omitempty"`
67-
DefinitionsOnly bool `json:"definitions_only,omitempty"`
73+
ResourceDefinitionName string `json:"resource_definition_name,omitempty"`
74+
ResourceDefinitionExternal string `json:"resource_definition_external_name,omitempty"`
75+
VolumeSizes []int64 `json:"volume_sizes,omitempty"`
76+
PartialFlag bool `json:"partial,omitempty"`
77+
DefinitionsOnly bool `json:"definitions_only,omitempty"`
78+
SelectFilter AutoSelectFilter `json:"select_filter,omitzero"`
79+
OverrideProps map[string]string `json:"override_props,omitempty"`
80+
DeleteProps []string `json:"delete_props,omitempty"`
81+
DeleteNamespace []string `json:"delete_namespaces,omitempty"`
6882
}

0 commit comments

Comments
 (0)