Skip to content

Commit

Permalink
Merge pull request openshift#14036 from rhamilto/OCPBUGS-34901
Browse files Browse the repository at this point in the history
OCPBUGS-34901: ensure correct API version for OperandDetails
  • Loading branch information
openshift-merge-bot[bot] authored Jul 11, 2024
2 parents 6e3d00f + be2ed7f commit d366423
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/packages/operator-lifecycle-manager/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const prefixedCapabilities = new Set([
]);

export const testConditionsDescriptor = {
path: 'testCondtions',
displayName: 'Test Condtions',
path: 'testConditions',
displayName: 'Test Conditions',
description: '',
'x-descriptors': [StatusCapability.conditions],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ describe(OperandDetails.displayName, () => {

beforeEach(() => {
resourceDefinition = {
plural: testCRD.metadata.name.split('.')[0],
plural: testModel.plural,
annotations: testCRD.metadata.annotations,
apiVersion: testModel.apiVersion,
};
wrapper = shallow(
<OperandDetails.WrappedComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ export const OperandDetails = connectToModel(({ crd, csv, kindObj, obj }: Operan
[
...(csv?.spec?.customresourcedefinitions?.owned ?? []),
...(csv?.spec?.customresourcedefinitions?.required ?? []),
].find((def) => def.name === crd?.metadata?.name) ?? {};
].find((def) => {
return def.name === crd?.metadata?.name && def.version === kindObj?.apiVersion;
}) ?? {};

const schema =
crd?.spec?.versions?.find((v) => v.name === version)?.schema?.openAPIV3Schema ??
Expand Down

0 comments on commit d366423

Please sign in to comment.