operator-sdk: Init for chart with local dependencies is failing

Bug Report

What did you do?

  1. Clone the our git repository
  2. Set the current directory to root of HELM chart
  3. Running:

operator-sdk init --plugins helm --domain=run.ai --helm-chart=.

The Chart.yaml contains:

  - name: prometheus-pushgateway
    repository: "file://./subcharts/prometheus-pushgateway"
    version: 1.0.1
    condition: prometheus-pushgateway.enabled 

Note: subcharts/prometheus-pushgateway is valid HELM chart

What did you expect to see?

I expect the command to pass without errors.

What did you see instead? Under which circumstances?

I see the help message of init with helm plugin and the following error: FATA[0000] failed to initialize project with "": failed to fetch chart dependencies: directory /tmp/osdk-helm-chart946952279/runai-operator/subcharts/prometheus-pushgateway not found

Environment

Operator type: language helm version.BuildInfo{Version:“v3.5.3”, GitCommit:“041ce5a2c17a58be0fcd5f5e16fb3e7e95fea622”, GitTreeState:“dirty”, GoVersion:“go1.15.8”}

Kubernetes cluster type:

OpenShift

$ operator-sdk version

operator-sdk version: “v1.5.0”, commit: “98f30d59ade2d911a7a8c76f0169a7de0dec37a0”, kubernetes version: “1.19.4”, go version: “go1.15.5”, GOOS: “linux”, GOARCH: “amd64”

$ kubectl version

Client Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.1-5-g76a04fc”, GitCommit:“c66c03f3012a10f16eb86fdce6330433adf6c9ee”, GitTreeState:“clean”, BuildDate:“2021-03-01T03:35:08Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”} Server Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.0+5fbfd19”, GitCommit:“5fbfd197c16d3c5facbaa1d7b9f3ea58cf6b36e9”, GitTreeState:“clean”, BuildDate:“2021-02-17T15:21:33Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”}

Additional context

I am trying to create operator bundle.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (12 by maintainers)

Most upvoted comments

Update the workarounds for runai-operator-2.0.3.tgz (https://storage.googleapis.com/runai-charts/runai-operator-2.0.3.tgz):

Step 0). download and unpack runai-operator-2.0.3.tgz

Step 1). open runai-operator folder, and change the sub-folder name from charts to subcharts –> (to match the local repository path for dependencies in Chart.yaml)

Step 2). operator-sdk init --plugins helm --helm-chart ./runai-operator –> Successfully generated the projects with subcharts.

$ cd config/
$ tree
.
├── crd
│   ├── bases
│   │   └── charts.my.domain_runaioperators.yaml
│   └── kustomization.yaml
├── default
│   ├── kustomization.yaml
│   ├── manager_auth_proxy_patch.yaml
│   └── manager_config_patch.yaml
├── manager
│   ├── controller_manager_config.yaml
│   ├── kustomization.yaml
│   └── manager.yaml
├── manifests
│   └── kustomization.yaml
├── prometheus
│   ├── kustomization.yaml
│   └── monitor.yaml
├── rbac
│   ├── auth_proxy_client_clusterrole.yaml
│   ├── auth_proxy_role.yaml
│   ├── auth_proxy_role_binding.yaml
│   ├── auth_proxy_service.yaml
│   ├── kustomization.yaml
│   ├── leader_election_role.yaml
│   ├── leader_election_role_binding.yaml
│   ├── role.yaml
│   ├── role_binding.yaml
│   ├── runaioperator_editor_role.yaml
│   ├── runaioperator_viewer_role.yaml
│   └── service_account.yaml
├── samples
│   ├── charts_v1alpha1_runaioperator.yaml
│   └── kustomization.yaml
└── scorecard
    ├── bases
    │   └── config.yaml
    ├── kustomization.yaml
    └── patches
        ├── basic.config.yaml
        └── olm.config.yaml

11 directories, 29 files