Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart version bump fix #726

Closed

Conversation

RafalKorepta
Copy link
Contributor

@RafalKorepta RafalKorepta commented Sep 15, 2023

Align all appVersion string with artifacthub.io/images annotation.

Fix operator values.yaml to work with bump_chart_version.sh script.
Currently nightly build is failing with the following error:

2023/09/15 01:26:17 Error querying repository tags: unable to open repository 'docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator': invalid reference: invalid repository

The values.yaml file for operator has 2 repository values which confuses bump_chart_version.sh script.

The docker-tag-list program receives in the REPO variable the following content:

docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator

This change overcome this issue.

P.S. New version of the Operator will not use configurator container.

REF
https://github.com/redpanda-data/helm-charts/actions/runs/6192749166/job/16813278284#step:6:7

Make new replacement of any occurrence of old version into new version in Chart.yaml file.

Copy link
Contributor

@alejandroEsc alejandroEsc left a comment

Choose a reason for hiding this comment

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

A few questions, not big.

@@ -34,9 +34,9 @@ annotations:
url: https://helm.sh/docs/intro/install/
artifacthub.io/images: |
- name: redpanda-operator
image: docker.redpanda.com/redpandadata/redpanda-operator:v23.2.5
Copy link
Contributor

Choose a reason for hiding this comment

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

should we use 23.2.8 instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to merge this PR to run nightly and create PR from that run.

sed -i "s/^appVersion: .*$/appVersion: ${LATEST}/" "${CHARTFILE}"
sed -i "s/${APPVERSION}/${LATEST}/" "${CHARTFILE}"
Copy link
Contributor

Choose a reason for hiding this comment

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

probably will need an extra blank line here,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does shell need empty line at the end of the file?

@@ -48,7 +48,7 @@ spec:
- --metrics-bind-address=127.0.0.1:8080
- --leader-elect
- --configurator-tag={{ include "configurator.tag" . }}
- --configurator-base-image={{ .Values.configurator.repository }}
- --configurator-base-image={{ .Values.configurator.containerRegistry }}
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering that, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I highly recommend reading my commit message. I will put the whole reasoning into PR cover letter

operator: Change configurator container registry values yaml
Currently nightly build is failing with the following error:

2023/09/15 01:26:17 Error querying repository tags: unable to open repository 'docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator': invalid reference: invalid repository


The values.yaml file for operator has 2 repository values which confuses `bump_chart_version.sh` script.

The `docker-tag-list` program receives in the REPO variable the following content:

docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator


This change overcome this issue.

P.S. New version of the Operator will not use configurator container.

REF
https://github.com/redpanda-data/helm-charts/actions/runs/6192749166/job/16813278284#step:6:7

sed -i "s/^appVersion: .*$/appVersion: ${LATEST}/" "${CHARTFILE}"
sed -i "s/${APPVERSION}/${LATEST}/" "${CHARTFILE}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I was concerned that there could be a possibility that $APPVERSION might match some other string, like if we start adding release notes to the artifacthub metadata. It's also not quoting the dots so they'll be wildcards in this match.

I was thinking about maybe using yq (or gojq) to do this, roughly like:

IMAGES=$(yq -r '.annotations["artifacthub.io/images"]' charts/console/Chart.yaml)
NEWIMAGES=$(yq -c --arg v $LATEST '(. | select(.name == "redpanda") | .image) |= "docker.redpanda.com/redpandadata/console:"+$v' <<< $IMAGES)
yq -Y --argjson v $NEWIMAGES '.annotations["artifacthub.io/images"] = $v' charts/console/Chart.yaml > temp
mv temp charts/console/Chart.yaml

Copy link
Contributor

@joejulian joejulian left a comment

Choose a reason for hiding this comment

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

blocking on the breaking change

@@ -24,7 +24,7 @@ image:

configurator:
# configurator.repository -- Repository that Redpanda configurator image is available
repository: docker.redpanda.com/redpandadata/configurator
containerRegistry: docker.redpanda.com/redpandadata/configurator
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change. Is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not that proficient in AWK to get the correct repository (container registry to be specific) from helm values yaml only if it comes from specific place. That place in values.yaml is not the same across different helm charts. The comment as far as see is different.

Currently nightly build is failing with the following error:
```
2023/09/15 01:26:17 Error querying repository tags: unable to open repository 'docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator': invalid reference: invalid repository
```

The values.yaml file for operator has 2 repository values which confuses `bump_chart_version.sh` script.

The `docker-tag-list` program receives in the REPO variable the following content:
```
docker.redpanda.com/redpandadata/redpanda-operator
docker.redpanda.com/redpandadata/configurator
```

This change overcome this issue.

P.S. New version of the Operator will not use configurator container.

REF
https://github.com/redpanda-data/helm-charts/actions/runs/6192749166/job/16813278284#step:6:7
@RafalKorepta
Copy link
Contributor Author

The #842 fixed operator issue

@RafalKorepta RafalKorepta deleted the rk/fix-chart-version-bump branch November 28, 2023 13:36
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.

3 participants