Skip to content

Commit ab4c75d

Browse files
committed
Address review comments
1 parent df70ce4 commit ab4c75d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

broker/volumebroker/server/volume_create.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ func (s *Server) getIronCoreVolumeConfig(_ context.Context, volume *iri.Volume)
101101
Encryption: encryption,
102102
VolumeDataSource: storagev1alpha1.VolumeDataSource{
103103
VolumeSnapshotRef: volumeSnapshotRef,
104-
OSImage: getOSImageIfPresent(image),
104+
OSImage: func() *string {
105+
if image == "" {
106+
return nil
107+
}
108+
return &image
109+
}(),
105110
},
106111
},
107112
}
@@ -115,13 +120,6 @@ func (s *Server) getIronCoreVolumeConfig(_ context.Context, volume *iri.Volume)
115120
}, nil
116121
}
117122

118-
func getOSImageIfPresent(image string) *string {
119-
if image == "" {
120-
return nil
121-
}
122-
return &image
123-
}
124-
125123
func (s *Server) createIronCoreVolume(ctx context.Context, log logr.Logger, volume *AggregateIronCoreVolume) (retErr error) {
126124
c, cleanup := s.setupCleaner(ctx, log, &retErr)
127125
defer cleanup()

broker/volumebroker/server/volumesnapshot_delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414
)
1515

1616
func (s *Server) DeleteVolumeSnapshot(ctx context.Context, req *iri.DeleteVolumeSnapshotRequest) (*iri.DeleteVolumeSnapshotResponse, error) {
17-
volumeSnapshotID := req.VolumeSnapshotId
17+
volumeSnapshotID := req.GetVolumeSnapshotId()
1818
log := s.loggerFrom(ctx, "VolumeSnapshotID", volumeSnapshotID)
1919

20-
ironcoreVolumeSnapshot, err := s.getIronCoreVolumeSnapshot(ctx, req.VolumeSnapshotId)
20+
ironcoreVolumeSnapshot, err := s.getIronCoreVolumeSnapshot(ctx, volumeSnapshotID)
2121
if err != nil {
2222
return nil, err
2323
}

0 commit comments

Comments
 (0)