Skip to content

Commit 469d69c

Browse files
kvapsclaude
andcommitted
fix(store): slugify rdName in volume_definitions fetchRD lookup
The k8s metadata.Name for an RD is K8sName-slugified at write time, but volume_definitions.fetchRD used the raw rdName as the lookup key. csi-sanity creates an RD called "DeleteSnapshot-volume-1-..." (mixed case) and then immediately POSTs volume-definitions to the same name — the second call was 404 because the stored CRD lives under a slugified name. Apply the same slugifier on lookup. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent e5547c9 commit 469d69c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/store/k8s/volume_definitions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (s *volumeDefinitions) Delete(ctx context.Context, rdName string, volumeNum
162162
func (s *volumeDefinitions) fetchRD(ctx context.Context, rdName string) (*crdv1alpha1.ResourceDefinition, error) {
163163
var rd crdv1alpha1.ResourceDefinition
164164

165-
err := s.c.Get(ctx, types.NamespacedName{Name: rdName}, &rd)
165+
err := s.c.Get(ctx, types.NamespacedName{Name: Name(rdName)}, &rd)
166166
if err != nil {
167167
if apierrors.IsNotFound(err) {
168168
return nil, errors.Wrapf(store.ErrNotFound, "resource definition %q", rdName)

0 commit comments

Comments
 (0)