Skip to content

Conversation

@akashshinde
Copy link
Contributor

@akashshinde akashshinde commented Oct 28, 2020

  • This PR enables support to filter charts based on the kubernetes version.
  • onlyCompatible flag is provided to /api/helm/charts/index.yaml API which drops the unsupported charts from the response.

Ref: https://issues.redhat.com/browse/HELM-12

@openshift-ci-robot openshift-ci-robot added component/backend Related to backend approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 28, 2020
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

PR is not implemented according to https://issues.redhat.com/browse/HELM-12 acceptance criteria.

@akashshinde
Copy link
Contributor Author

/test backend

@akashshinde
Copy link
Contributor Author

/retest

@openshift-ci-robot openshift-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 5, 2020
@akashshinde
Copy link
Contributor Author

/retest

Comment on lines 269 to 270
Copy link
Contributor

Choose a reason for hiding this comment

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

@pedjak
Copy link
Contributor

pedjak commented Nov 5, 2020

pkg/helm/chartproxy/testdata/emptyRepoIndex.yaml is empty and not used anywhere..

@rohitkrai03
Copy link
Contributor

@akashshinde @pedjak I would prefer if we make it default that all chart are filtered based on compatibility as this is the direction that we are looking at for Helm catalog by default. It also removes the need to change the UI for this. We can have an option to send all charts unfiltered that UI can use when required but there is no need for fetching unfiltered charts right now so it would be great if we can consider that.

@pedjak
Copy link
Contributor

pedjak commented Nov 5, 2020

@rohitkrai03 thanks for the feedback.. we can revert the default behaviour...

Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

please look at the existing comments, there are still some unaddressed.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2020
@pedjak
Copy link
Contributor

pedjak commented Nov 6, 2020

/retitle Bug 1891314: Return helm charts based on the installed kubernetes version

@openshift-ci-robot openshift-ci-robot changed the title Return helm charts based on the installed kubernetes version. Bug 1891314: Return helm charts based on the installed kubernetes version Nov 6, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Nov 6, 2020
@openshift-ci-robot
Copy link
Contributor

@akashshinde: This pull request references Bugzilla bug 1891314, 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.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1891314: Return helm charts based on the installed kubernetes version

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.

@pedjak
Copy link
Contributor

pedjak commented Nov 6, 2020

/cherry-pick release-4.6

@openshift-cherrypick-robot

@pedjak: once the present PR merges, I will cherry-pick it on top of release-4.6 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.6

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 component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/dashboard Related to dashboard labels Nov 9, 2020
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually a helm chart that support pre-release versions specifies kubeVersion range with a -0 at the end. Below is a helm chart metadata from our catalog that support pre-release version -

- apiVersion: v2
    appVersion: 10.0.0
    created: "2020-11-03T14:58:13.7979+05:30"
    dependencies:
    - alias: sch
      name: ibm-sch
      repository: '@sch'
      version: 1.2.15
    description: |-
      IBM Order management Software Enterprise Edition v10 provides cross-channel order orchestration capabilities to enable intelligent brokering of orders across many disparate systems. It also provides a global view of inventory across the supply chain and enables business users to make changes to order process.
      Documentation
      For additional details regarding install parameters check http://ibm.biz/oms-helm-readme.
      License
      By installing this product you accept the license terms http://ibm.biz/oms-license and http://ibm.biz/oms-apps-license.
    digest: 47f7bae2c23ceec955c497ddd3f1d2adeea08238363a849c3ffc0ebefb9125ff
    home: http://ibm.biz/oms-home
    icon: https://raw.githubusercontent.com/IBM/charts/master/logo/ibm-oms-logo.png
    keywords:
    - oms
    - sterling
    - yantra
    - order
    - fulfillment
    - om
    - amd64
    - ppc64le
    - framework
    - Commercial
    - RHOCP
    - Other
    kubeVersion: '>=1.16.0-0'
    maintainers:
    - name: IBM
    name: ibm-oms-ent-prod
    type: application
    urls:
    - https://redhat-developer.github.com/redhat-helm-charts/charts/ibm-oms-ent-prod-5.1.0.tgz
    version: 5.1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 81e25d7
cc: @rohitkrai03

@rohitkrai03
Copy link
Contributor

/assign

@rohitkrai03
Copy link
Contributor

rohitkrai03 commented Nov 17, 2020

@akashshinde I created a 4.6.0-0.nightly-2020-09-03-191144 cluster to test this PR. It's the same cluster that the bug was reported.

❯ oc version
Client Version: 4.5.5
Server Version: 4.6.0-0.nightly-2020-09-03-191144
Kubernetes Version: v4.6.0-202009031349.p0-dirty

Added below HelmChartRepository CR -

apiVersion: helm.openshift.io/v1beta1
kind: HelmChartRepository
metadata:
  name: ibm-sample-repo
spec:
  name: ibm-sample-repo
  connectionConfig:
    url: https://raw.githubusercontent.com/IBM/charts/master/repo/ibm-helm

The repo has in total 38 charts in it's index.yaml. Out of 38 only 5 specifies kubeVersion with -0 at the end which means only 5 support pre release kubeVersion.

Right now in the console i am getting all 38 Helm charts from the backend. So technically the above reported bug is fixed but I see the same number of charts in a cluster where no filtering is available so the filtering might not be working as expected. On a pre-release kubernetes cluster I would expect only those charts to show up which have -0 specified.

Not sure how the filtering it working at the moment but i think there might be some issue here with the filtering. If you want i can share the cluster with you.

@akashshinde
Copy link
Contributor Author

On a pre-release kubernetes cluster I would expect only those charts to show up which have -0 specified.

If kubernetes pre-release cluster version is v1.19.1-beta.3 then following charts can be listed.

  • kube >= v1.19.0
  • kube >= v1.19.1
  • kube >= v1.19.1-0
  • kube == v1.19.1-beta3

@rohitkrai03
Copy link
Contributor

After discussions with @akashshinde it seems the current filtering logic should work for all of our use cases. The above shared cluster has something wrong because it shows Kubernetes Version: v4.6.0-202009031349.p0-dirty which is not possible.

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

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

openshift-merge-robot commented Nov 17, 2020

@akashshinde: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/kubevirt-plugin 83cf92ef6db9f0b8d68d4e0560f8c62706bf1eca link /test kubevirt-plugin

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@pedjak
Copy link
Contributor

pedjak commented Nov 17, 2020

/approve

@pedjak
Copy link
Contributor

pedjak commented Nov 17, 2020

/assign @spadgett

@akashshinde
Copy link
Contributor Author

/retest

@akashshinde
Copy link
Contributor Author

@spadgett Can you take a look at this ? There are few changes in server.go which requires your attention.

@akashshinde
Copy link
Contributor Author

@christianvogt can you please take a look at this ?

Copy link
Member

Choose a reason for hiding this comment

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

We'll want to make sure this is logged by default. @jhadvig Do you know offhand?

Copy link
Member

Choose a reason for hiding this comment

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

We should fall back to the env var at least on failure.

Copy link
Member

Choose a reason for hiding this comment

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

I guess it's OK to check only once on startup since the API server is upgraded before the other cluster operators. There might be a small window during upgrades where we show charts for the previous version after the API servers are upgraded.

Copy link
Member

Choose a reason for hiding this comment

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

Note that I believe the kube version is available as an environment variable in the pod, so we could conceivably avoid needing to make this request (although not for off-cluster mode).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@spadgett Getting kube version from env var KUBE_GIT_VERSION in case api server failed to report. Done 739ad74

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akashshinde, pedjak, rohitkrai03, spadgett

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

The pull request process is described here

Details 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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 2, 2020
@openshift-merge-robot openshift-merge-robot merged commit 762a721 into openshift:master Dec 2, 2020
@openshift-ci-robot
Copy link
Contributor

@akashshinde: All pull requests linked via external trackers have merged:

Bugzilla bug 1891314 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1891314: Return helm charts based on the installed kubernetes version

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-cherrypick-robot

@pedjak: #7012 failed to apply on top of branch "release-4.6":

Applying: Filter out helm charts based on kubernetes version
Using index info to reconstruct a base tree...
M	pkg/helm/chartproxy/proxy.go
M	pkg/helm/handlers/handlers.go
M	pkg/server/server.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/server/server.go
CONFLICT (content): Merge conflict in pkg/server/server.go
Auto-merging pkg/helm/handlers/handlers.go
CONFLICT (content): Merge conflict in pkg/helm/handlers/handlers.go
Auto-merging pkg/helm/chartproxy/proxy.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Filter out helm charts based on kubernetes version
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Details

In response to this:

/cherry-pick release-4.6

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.

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-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/backend Related to backend component/ceph Related to ceph-storage-plugin component/core Related to console core functionality component/dashboard Related to dashboard component/dev-console Related to dev-console component/kubevirt Related to kubevirt-plugin component/noobaa Related to noobaa-storage-plugin component/olm Related to OLM component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants