Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const appResources: AppResources = {
'app.kubernetes.io/instance': 'nationalparks-py',
'app.kubernetes.io/name': 'python',
'app.openshift.io/runtime': 'python',
'app.openshift.io/runtime-icon': 'python',
'app.openshift.io/runtime-version': '3.6',
'app.openshift.io/runtime-namespace': 'div',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ClusterBuildStrategy } from '@console/shipwright-plugin/src/types';
import { UNASSIGNED_KEY } from '@console/topology/src/const';
import {
RUNTIME_LABEL,
RUNTIME_ICON_LABEL,
CUSTOM_ICON_ANNOTATION,
PIPELINE_RUNTIME_LABEL,
PIPELINE_RUNTIME_VERSION_LABEL,
Expand Down Expand Up @@ -202,6 +203,7 @@ export const getDefaultLabels = () => {
'app',
'app.kubernetes.io/instance',
'app.openshift.io/runtime',
'app.openshift.io/runtime-icon',
'app.kubernetes.io/part-of',
'app.openshift.io/runtime-version',
'app.openshift.io/runtime-namespace',
Expand Down Expand Up @@ -485,8 +487,10 @@ export const getIconInitialValues = (
editAppResource: K8sResourceKind,
overrideKnative?: boolean,
) => {
const runtimeLabel = editAppResource?.metadata?.labels?.[RUNTIME_LABEL];
const runtimeIcon = runtimeLabel && hasIcon(runtimeLabel) ? runtimeLabel : null;
const runtimeIconLabel =
editAppResource?.metadata?.labels?.[RUNTIME_ICON_LABEL] ??
editAppResource?.metadata?.labels?.[RUNTIME_LABEL];
const runtimeIcon = runtimeIconLabel && hasIcon(runtimeIconLabel) ? runtimeIconLabel : null;

const isKnative =
overrideKnative ?? getResourcesType(editAppResource) === Resources.KnativeService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ import { safeYAMLToJS } from '@console/shared/src/utils/yaml';
import { BUILD_OUTPUT_IMAGESTREAM_URL } from '@console/shipwright-plugin/src/const';
import { BuildModel as ShipwrightBuildModel } from '@console/shipwright-plugin/src/models';
import { CREATE_APPLICATION_KEY } from '@console/topology/src/const';
import { CUSTOM_ICON_ANNOTATION, PIPELINE_SERVICE_ACCOUNT, RUNTIME_LABEL } from '../../const';
import {
CUSTOM_ICON_ANNOTATION,
PIPELINE_SERVICE_ACCOUNT,
RUNTIME_LABEL,
RUNTIME_ICON_LABEL,
} from '../../const';
import { PipelineKind } from '../../types/pipeline';
import {
getAppLabels,
Expand Down Expand Up @@ -435,7 +440,10 @@ export const createOrUpdateDeployment = (
} = formData;

const imageStreamName = imageStream && imageStream.metadata.name;
const runtimeIcon = imageStream && imageStream.metadata.labels?.[RUNTIME_LABEL];
const runtimeIcon =
imageStream &&
(imageStream.metadata.labels?.[RUNTIME_ICON_LABEL] ??
imageStream.metadata.labels?.[RUNTIME_LABEL]);
const defaultLabels = getAppLabels({
name,
applicationName,
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/dev-console/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const LAST_BUILD_PAGE_TAB_STORAGE_KEY = `devconsole.last.build-page-tab`;
export const NAME_LABEL = 'app.kubernetes.io/name';
export const INSTANCE_LABEL = 'app.kubernetes.io/instance';
export const RUNTIME_LABEL = 'app.openshift.io/runtime';
export const RUNTIME_ICON_LABEL = 'app.openshift.io/runtime-icon';
export const FLAG_DEVELOPER_CATALOG = 'DEVELOPER_CATALOG';
export const FLAG_OPERATOR_BACKED_SERVICE_CATALOG_TYPE = 'OPERATOR_BACKED_SERVICE_CATALOG_TYPE';
export const FLAG_SAMPLE_CATALOG_TYPE = 'SAMPLE_CATALOG_TYPE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getAppLabels = ({
};

if (runtimeIcon) {
labels['app.openshift.io/runtime'] = runtimeIcon;
labels['app.openshift.io/runtime-icon'] = runtimeIcon;
}
if (applicationName && applicationName.trim().length > 0) {
labels['app.kubernetes.io/part-of'] = applicationName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Model, NodeModel } from '@patternfly/react-topology';
import i18next from 'i18next';
import * as _ from 'lodash';
import { CUSTOM_ICON_ANNOTATION, RUNTIME_LABEL, NAME_LABEL } from '@console/dev-console/src/const';
import {
CUSTOM_ICON_ANNOTATION,
NAME_LABEL,
RUNTIME_ICON_LABEL,
RUNTIME_LABEL,
} from '@console/dev-console/src/const';
import {
WatchK8sResources,
WatchK8sResults,
Expand Down Expand Up @@ -116,6 +121,7 @@ export const createTopologyNodeData = (
const contextDir = getContextDirByName(resources, deploymentsName);
const builderImageIcon =
returnIfValidURL(deploymentsAnnotations[CUSTOM_ICON_ANNOTATION]) ??
getImageForIconClass(`icon-${deploymentsLabels[RUNTIME_ICON_LABEL]}`) ??
getImageForIconClass(`icon-${deploymentsLabels[RUNTIME_LABEL]}`) ??
getImageForIconClass(`icon-${deploymentsLabels[NAME_LABEL]}`);
return {
Expand Down