Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1828922: Fix to get the CSV icon for operator workloads #5218

Merged

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-2886

Analysis / Root cause:
Icon does not always exist on the CSV for the kind.

Solution Description:
Check the CSV for both the kind and the specific owner reference uid

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. labels Apr 28, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: This pull request references Bugzilla bug 1828922, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1828922: Fix to get the CSV icon for operator workloads

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console labels Apr 28, 2020
Comment on lines 63 to 65
const csvIcon =
_.get(operatorBackedServiceKindMap[nodeResourceKind], 'spec.icon.0') ||
_.get(operator, 'spec.icon.0');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const csvIcon =
_.get(operatorBackedServiceKindMap[nodeResourceKind], 'spec.icon.0') ||
_.get(operator, 'spec.icon.0');
const csvIcon = _.get(operator, 'spec.icon.0');

You can simply do this because if you see above there is a check for operator and if it is empty it is assigned to operatorBackedServiceKindMap[nodeResourceKind] so we can get the icon from operator itself in both the cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both could exist. We don't attempt to look at operatorBackedServiceKindMap[nodeResourceKind] if we found the operator via the ownerUid. This will consider both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you mean to say if we get the operator via the ownerUid then also for the icon we will give precedence to operatorBackedServiceKindMap[nodeResourceKind] and only if we dont get the icon from there then we will try to get it from operator that we got via the ownerUid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could reverse the order to change the precedence. I left it this way thinking the original author may have purposefully chosen to use the icon from the kind map.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I think this order should be fine since we should show the icon for the particular operator backed service and if there is none then use the operator icon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that we move away from using lodash get everywhere and use optional chaining instead.

@divyanshiGupta
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2020
@christianvogt
Copy link
Contributor

@jeff-phillips-18 did you confirm this change with @serenamarie125 and @sspeiche ? The jira doesn't have a conclusive answer since the operator icon is already shown in the group label.

@serenamarie125
Copy link
Contributor

@christianvogt FYI, the design documentation explains that the icon of each of the workloads inside of the operator backed service should follow this order: runtime, operator backed service, OLM/lightning bolt.

We should be good! Just requested some screenies of before/after though!

@jeff-phillips-18
Copy link
Member Author

jeff-phillips-18 commented Apr 30, 2020

We are looking for the runtime builder image first, then for the operator image (now in both places) then fallback to default operator icon.

I believe this matches what has been said in the Jira ticket, there just are not runtime builder images specified for these workloads.

For the runtime image, we look at both labels:
app.openshift.io/runtime and app.kubernetes.io/name

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2020
@andrewballantyne
Copy link
Contributor

@serenamarie125

Before
Screen Shot 2020-05-01 at 3 26 46 PM

After
Screen Shot 2020-05-01 at 3 26 39 PM

@andrewballantyne
Copy link
Contributor

/approve
/lgtm
/hold Waiting on UX approval.

cc @christianvogt is there anything following up you want discussed here?

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2020
@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 1, 2020
@christianvogt
Copy link
Contributor

Nope i think we're good now

Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Approved by UX! Thanks @jeff-phillips-18

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, divyanshiGupta, jeff-phillips-18, serenamarie125

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@christianvogt
Copy link
Contributor

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2020
@openshift-merge-robot openshift-merge-robot merged commit 37878ad into openshift:master May 2, 2020
@openshift-ci-robot
Copy link
Contributor

@jeff-phillips-18: All pull requests linked via external trackers have merged: openshift/console#5218. Bugzilla bug 1828922 has been moved to the MODIFIED state.

In response to this:

Bug 1828922: Fix to get the CSV icon for operator workloads

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot
Copy link
Contributor

This PR was merged in the time period when ci-operator was mistakenly reporting failed tests as passing.

If this repository has ci-operator jobs, please inspect their test results even if passing, and consider the need for fixing or even reverting.

@spadgett spadgett added this to the v4.5 milestone May 5, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the operator-icons branch December 2, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-unspecified Referenced Bugzilla bug's severity is unspecified for the PR. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants