Skip to content

Commit 2afe45c

Browse files
adding removed comments again
1 parent 32b64f4 commit 2afe45c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/lib/k8s/crd.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class CustomResourceDefinition extends KubeObject<KubeCRD> {
9797
let version = this.spec.version;
9898
const name = this.spec.names.plural as string;
9999

100+
// Assign the 1st storage version if no version is specified,
101+
// or the 1st served version if no storage version is specified.
100102
if (!version && this.spec.versions.length > 0) {
101103
for (const versionItem of this.spec.versions) {
102104
if (!!versionItem.storage) {
@@ -147,6 +149,7 @@ export interface CRClassArgs {
147149
customResourceDefinition: CustomResourceDefinition;
148150
}
149151

152+
/** @deprecated Use the version of the function that receives an object as its argument. */
150153
export function makeCustomResourceClass(
151154
args: [group: string, version: string, pluralName: string][],
152155
isNamespaced: boolean
@@ -164,6 +167,7 @@ export function makeCustomResourceClass(
164167
apiInfoArgs = args.apiInfo.map(info => [info.group, info.version, args.pluralName]);
165168
}
166169

170+
// Used for tests
167171
if (import.meta.env.UNDER_TEST || import.meta.env.STORYBOOK) {
168172
const knownClass = (ResourceClasses as Record<string, KubeObjectClass>)[apiInfoArgs[0][2]];
169173
if (!!knownClass) {

0 commit comments

Comments
 (0)