Skip to content

Fix chart version extraction in the OCI publish workflow - #858

Merged
janhoy merged 1 commit into
apache:mainfrom
janhoy:fix-chart-version-extraction
Oct 24, 2026
Merged

janhoy merged 1 commit into
apache:mainfrom
janhoy:fix-chart-version-extraction

Conversation

@janhoy

@janhoy janhoy commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

The first real run published both charts correctly but then failed the verification step with:

Error: improper constraint: "v1beta1"

OPERATOR_VERSION had been extracted as "v1beta1" instead of "0.9.1". The awk expression matched on the first field, and awk strips leading whitespace when splitting fields, so an indented "version:" key matches just as readily as a top-level one.

Part of #813

The first real run published both charts correctly but then failed the
verification step with:

  Error: improper constraint: "v1beta1"

OPERATOR_VERSION had been extracted as "v1beta1" instead of "0.9.1". The awk
expression matched on the first field, and awk strips leading whitespace when
splitting fields, so an indented "version:" key matches just as readily as a
top-level one. The solr-operator Chart.yaml has four of them before the real
chart version: three "version: v1beta1" entries inside the artifacthub.io/crds
annotation, and the zookeeper-operator dependency's "version: 0.2.15".

Anchor the match to column 0, the same way propagate_version.sh does it, and
strip any surrounding quotes.

The solr chart was unaffected only by luck: its Chart.yaml carries no CRD
annotations, so its first "version:" is already the chart version.

The published artifacts were never wrong. 'helm push' reads the tag from
Chart.yaml itself, so both charts went to ghcr.io tagged 0.9.1 as intended;
only the post-push verification used the bad value.

Also assert that each extracted version agrees with its chart filename. The
byte-comparison later in the same step already assumes 'helm pull' writes
<chart>-<version>.tgz, so checking it up front turns a confusing downstream
failure into an explicit one.

Part of apache#813
@janhoy
janhoy merged commit 2dde4ae into apache:main Oct 24, 2026
1 check passed
@janhoy janhoy mentioned this pull request Oct 24, 2026
3 of 6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant