Bug 2039679

Summary: Topology shows unrelated BuildConfigs (decorator and in the sidebar) when app is created with oc new-app
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Jaivardhan Kumar <jakumar>
Status: CLOSED DUPLICATE QA Contact: spathak <spathak>
Severity: low Docs Contact:
Priority: medium    
Version: 4.10CC: aos-bugs, nmukherj
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-18 15:01:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
wrong-buildconfigs.png none

Description Christoph Jerolimov 2022-01-12 08:46:32 UTC
Description of problem:
When the user creates two applications with oc new-app the BuildConfigs are not match correctly to the DeploymentConfig.

The build decorator of app2 links to app1, the sidebar of both apps shows both BuildConfigs.

Version-Release number of selected component (if applicable):
4.10

(didn't test older versions yet)

How reproducible:
Always

Steps to Reproduce:
1. Create a new namespace and import two apps with oc new-app. For example:

oc new-app -n test2 https://github.com/jerolimov/nodeinfo --name app1
oc new-app -n test2 https://github.com/jerolimov/nodeinfo --name app2

2. Open the developer console, select the right namespace and navigate to the topology.

3. Inspect the build decorator (URL) and click on the DeploymentConfig to open the sidebar.

Actual results:
1. The build decorator shows for one of the two apps the wrong build config target URL.

2. The sidebar shows all BuildConfigs and Builds from both apps.

Expected results:
1. The build decorator should show and link the right build config.

2. The sidebar should show only the right BuildConfig and Builds.

Additional info:
DeploymentConfig and BuildConfig have much fewer labels than the developer console creates when importing an app.

DeploymentConfig labels:
- app=app1
- app.kubernetes.io/component=app1
- app.kubernetes.io/instance=app1

BuildConfig labels:
- app=app1
- app.kubernetes.io/component=app1
- app.kubernetes.io/instance=app1

Looks like that the console code in `packages/console-shared/src/utils/resource-utils.ts`
`getBuildConfigsForResource` checks only for `app.kubernetes.io/name`.

Comment 1 Christoph Jerolimov 2022-01-12 08:48:21 UTC
Created attachment 1850317 [details]
wrong-buildconfigs.png

Comment 2 Christoph Jerolimov 2022-01-18 15:01:37 UTC

*** This bug has been marked as a duplicate of bug 2038879 ***