Fix crash when finding CRD's preferred version (#4332)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-11-15 11:16:37 -05:00
1 parent 4c83f5becf
commit e51ff5051f
4 files changed
+53 -9

No files matched your search

+1 -5
View File
@@ -153,11 +153,7 @@ export class CustomResourceDefinition extends KubeObject {
// Prefer the modern `versions` over the legacy `version`
if (this.spec.versions) {
for (const version of this.spec.versions) {
/**
* If the version is not served then 404 errors will occur
* We should also prefer the storage version
*/
if (version.served && version.storage) {
if (version.storage) {
return version;
}
}