Skip to content

Commit 77c48ae

Browse files
authored
Merge pull request #582 from rokkiter/make-sure-length
check length of vds
2 parents df00ef6 + 6c0e452 commit 77c48ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/kubeapiserver/discovery/group.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ func buildAPIGroups(groups sets.Set[string], groupversions map[schema.GroupVersi
166166
}
167167

168168
apiGroup.Versions = vds
169-
apiGroup.PreferredVersion = vds[0]
169+
if len(vds) != 0 {
170+
apiGroup.PreferredVersion = vds[0]
171+
}
170172

171173
apiGroups[apiGroup.Name] = apiGroup
172174
}

0 commit comments

Comments
 (0)