Skip to content

Commit

Permalink
Bug fixes for ISV CR issues. (#615)
Browse files Browse the repository at this point in the history
* ISV Fixes for Issue #616

Fixes the ISV CR issues found during testing.

* Fixed linting errors.
  • Loading branch information
dlabaj authored Oct 5, 2022
1 parent 51c1959 commit 63747b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions backend/src/utils/resourceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const fetchInstalledKfdefs = async (fastify: KubeFastifyInstance): Promise<KfDef
const fetchQuickStarts = async (fastify: KubeFastifyInstance): Promise<QuickStart[]> => {
const fetchAll = async (): Promise<QuickStart[]> => {
const installedQuickStarts: QuickStart[] = [];
const appDefs = await fetchApplicationDefs(fastify);
let _continue: string = undefined;
let remainingItemCount = 1;
const featureFlags = getComponentFeatureFlags();
Expand Down Expand Up @@ -199,7 +200,16 @@ const fetchQuickStarts = async (fastify: KubeFastifyInstance): Promise<QuickStar
} else if (qStart.spec.appName === 'jupyter' && !isJupyterEnabled) {
qStart.spec.appName = 'jupyterhub';
}
if (!qStart.spec.featureFlag || featureFlags[qStart.spec.featureFlag]) {
if (qStart.spec.featureFlag) {
if (
featureFlags[qStart.spec.featureFlag] &&
appDefs.find((def) => def.metadata.name === qStart.spec.appName)
) {
installedQuickStarts.push(qStart);
}
return;
}
if (appDefs.find((def) => def.metadata.name === qStart.spec.appName)) {
installedQuickStarts.push(qStart);
}
});
Expand Down Expand Up @@ -342,12 +352,15 @@ const fetchDocs = async (fastify: KubeFastifyInstance): Promise<OdhDocument[]> =
doc.spec.appName = 'jupyter';
}
if (doc.spec.featureFlag) {
if (featureFlags[doc.spec.featureFlag]) {
if (
featureFlags[doc.spec.featureFlag] &&
appDefs.find((def) => def.metadata.name === doc.spec.appName)
) {
docs.push(doc);
}
return;
}
if (!doc.spec.appName || appDefs.find((def) => def.metadata.name === doc.spec.appName)) {
if (appDefs.find((def) => def.metadata.name === doc.spec.appName)) {
docs.push(doc);
}
});
Expand Down
File renamed without changes.

0 comments on commit 63747b6

Please sign in to comment.