Skip to content

Commit 7367920

Browse files
authored
Fix crash when record field is empty (#24)
1 parent f00fab3 commit 7367920

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controllers/record_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ func (r *RecordReconciler) reconcileRecord(ctx context.Context, record *discov1.
144144
}
145145

146146
records := strings.FieldsFunc(rec, splitFunc)
147-
if rec := records; len(rec) > 0 {
148-
records = rec
147+
if len(records) == 0 {
148+
return fmt.Errorf("record %s/%s has no records", record.Namespace, record.Name)
149149
}
150150

151151
for _, host := range record.Spec.Hosts {

0 commit comments

Comments
 (0)