Skip to content

Error on repo update when defining a custom OCI registry

Describe the bug

I have the following environment variable set:

HELM_REPOS: 'example@oci://registry.example.com'

It errors on doing `helm repo update`

Expected behavior

CI job runs as expected

Actual behavior

Error in before_script

Logs and/or screenshots

In the CI job I have the following output:

$ add_helm_repositories
[INFO] --- login to OCI-registry example: registry.example.com
Login Succeeded
Error: no repositories found. You must add one before updating
Cleaning up project directory and file based variables
ERROR: Job failed: command terminated with exit code 1

At this line it does a repo update regardless of if a non OCI registry is added:

https://gitlab.com/to-be-continuous/helm/-/blob/master/templates/gitlab-ci-helm.yml#L637

Context & Configuration

Link to a project, pipeline or job facing the bug: (please provide one if possible)

The issue was reproduced using:

  • Version of the template: 7.2.1
  • GitLab server(s): Self managed EE
  • GitLab runner(s): Kubernetes

Here is the .gitlab-ci.yml file:

variables:
  HELM_REPOS: 'example@oci://registry.example.com'

include:
  - component: gitlab.example.com/to-be-continuous/helm/gitlab-ci-helm@7.2.1
    inputs:
      chart-dir: helm
      package-args: package --dependency-update --version ${CI_COMMIT_TAG:-0.0.1} --app-version ${CI_COMMIT_TAG:-0.0.1}
      publish-on: tag