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

remove usage of digest from helm catalog item uid #9364

Merged
merged 1 commit into from Jul 2, 2021

Conversation

debsmita1
Copy link
Contributor

@debsmita1 debsmita1 commented Jun 28, 2021

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

Root analysis:

  • digest is an optional property and the uid of helm chart depends on the digest's value. As a result, charts with no digest property will have the uid as <provider-name>--undefined so all the charts that belong to the same provider will have the same uid and the last one in the lot is considered.

Solution description:

  • using the chart name and version as the value of uid.

Screenshots:

Before
Screenshot from 2021-06-29 00-05-15

After
Screenshot from 2021-06-29 00-05-46

Test setup:

apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository
metadata:
  name: sample-repo
spec:
  connectionConfig:
    url:  https://raw.githubusercontent.com/debsmita1/charts/remove-digest/repo/community/index.yaml

@openshift-ci openshift-ci bot added the component/helm Related to helm-plugin label Jun 28, 2021
@debsmita1
Copy link
Contributor Author

/kind bug
/assign @rohitkrai03

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 28, 2021
@@ -107,7 +98,7 @@ export const normalizeHelmCharts = (
];

const helmChart = {
uid: `${chartRepoName}--${digest}`,
uid: `${name}--${version}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This will not be unique when same chart is coming from two different chart repositories. I think we need to use chart URLs to make it always unique. Check #tmp-odc-helm channel on slack for related conversation around this.

@@ -107,7 +98,7 @@ export const normalizeHelmCharts = (
];

const helmChart = {
uid: `${chartRepoName}--${digest}`,
uid: `${chartURL}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This might clash again since the same chart can come from multiple chart repositories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about if we go with name + randomString ?

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be good enough.

Suggested change
uid: `${chartURL}`,
uid: `${chartRepoName}--${chartURL}`,

@@ -107,7 +98,7 @@ export const normalizeHelmCharts = (
];

const helmChart = {
uid: `${chartRepoName}--${digest}`,
uid: `${chartURL}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be good enough.

Suggested change
uid: `${chartURL}`,
uid: `${chartRepoName}--${chartURL}`,

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 2, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: debsmita1, rohitkrai03

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2021
@openshift-merge-robot openshift-merge-robot merged commit 04078da into openshift:master Jul 2, 2021
@spadgett spadgett added this to the v4.9 milestone Jul 14, 2021
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. component/helm Related to helm-plugin 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

4 participants