Skip to content

clusterctl: provider version gets lower case on client.Init() #12233

@taras3bor

Description

@taras3bor

What steps did you take and what happened?

Create addon provider (e.g. customname) and name its version with upper case, like 2.7.8-DEV-SNAPSHOT.
Locate your provider files in corresponding folder (with upper case in path).

Example of clusterctl.yaml:

providers:
  - name: "customname"
  url: "/tmp/clusterctl3683652889/data/clusterctl/providers/addon-customname/2.7.8-DEV-SNAPSHOT/addon-components.yaml"
  type: "AddonProvider"

When trying to call client.Init(ctx,options) the error will return:
failed to get provider components for the "customname:2.7.8-DEV-SNAPSHOT" provider: failed to read "addon-components.yaml" from provider's repository "addon-customname": failed to read file "/tmp/clusterctl2619187872/data/clusterctl/providers/addon-customname/2.7.8-dev-snapshot/addon-components.yaml" from local release 2.7.8-dev-snapshot: stat /tmp/clusterctl2619187872/data/clusterctl/providers/addon-customname/2.7.8-dev-snapshot/addon-components.yaml: no such file or directory

What did you expect to happen?

Call of client.Init(ctx,options) should succeed, because file addon-components.yaml valid and located at /tmp/clusterctl2619187872/data/clusterctl/providers/addon-customname/2.7.8-DEV-SNAPSHOT/addon-components.yaml

If change version from 2.7.8-DEV-SNAPSHOT to 2.7.8-dev-snapshot (also in clusterctl.yaml and change location of addon-components.yaml) call Init() would succeed and provider would be installed with no problem.

Cluster API version

v1.8.12

Kubernetes version

No response

Anything else you would like to add?

According to https://semver.org/ version 2.7.8-DEV-SNAPSHOT is a valid semver (link to RegExp from semver.org)

It seems only provider name should be lower cased, without version. Could fix it, if suitable.

Label(s) to be applied

/kind bug
One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Metadata

Metadata

Assignees

Labels

area/clusterctlIssues or PRs related to clusterctlkind/bugCategorizes issue or PR as related to a bug.priority/backlogHigher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions