Skip to content

Commit 6c0e452

Browse files
committed
check length of vds
Signed-off-by: rokkiter <yongen.pan@daocloud.io>
1 parent e788be4 commit 6c0e452

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)