Skip to content

feat: add Argo CD version check and validation in pre-install hook #462

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ATGardner
Copy link
Contributor

make sure argo-cd is >=2.12 and <3

What

Why

Notes

Enhance the pre-install hook to include a version check for Argo CD.
This change introduces environment variables for Argo CD service discovery
and version validation, ensuring compatibility with the required version
constraint. Additionally, update the Dockerfile to install necessary
dependencies for the validation process.
@ATGardner ATGardner requested review from a team as code owners April 25, 2025 08:13
@ATGardner ATGardner self-assigned this Apr 25, 2025
args:
- cf helm validate --values /job_tmp/values.yaml --namespace ${NAMESPACE} --version ${VERSION} --hook --log-level debug
args:
- |
Copy link
Contributor

Choose a reason for hiding this comment

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

If you use VSCode I advise using YAML Embedded Languages languages extension and adding language comment - makes it easier on eyes.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a nice trick. i installed the extension, and added the comment.

Copy link
Contributor

@zarbis zarbis Apr 25, 2025

Choose a reason for hiding this comment

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

image

You can also run this code like so: cat argo-platform/merge-queue.yaml | yq '.steps.wait_for_previous_promotion.commands[0]' | bash. Although figuring out variables passed to the script is tricky.

that's a very handy trick, thanks.
@ATGardner
Copy link
Contributor Author

build fails because of the size of the new image.
i added nodejs + npm, just so i can install the global package of "semver". i now checked on my computer - that bumped the image size from 294MB to 1.06GB.
is there some simpler (smaller) way to make a semver range check? i can do it all in bash. it is managable for hard-coded ">=2.12 <3", but for a more generic range-check string it will quickly become a pain.

@zarbis
Copy link
Contributor

zarbis commented Apr 25, 2025

build fails because of the size of the new image. i added nodejs + npm, just so i can install the global package of "semver". i now checked on my computer - that bumped the image size from 294MB to 1.06GB. is there some simpler (smaller) way to make a semver range check? i can do it all in bash. it is managable for hard-coded ">=2.12 <3", but for a more generic range-check string it will quickly become a pain.

Check this out. I use it for this very repo's lifecycle.

@ATGardner
Copy link
Contributor Author

build fails because of the size of the new image. i added nodejs + npm, just so i can install the global package of "semver". i now checked on my computer - that bumped the image size from 294MB to 1.06GB. is there some simpler (smaller) way to make a semver range check? i can do it all in bash. it is managable for hard-coded ">=2.12 <3", but for a more generic range-check string it will quickly become a pain.

Check this out. I use it for this very repo's lifecycle.

thanks. I'll give it a go

Replace the semver command with semver-cli for version validation in the
pre-install hook. This change ensures compatibility with the latest
versioning standards and improves the reliability of version checks.
@ATGardner
Copy link
Contributor Author

ATGardner commented Apr 26, 2025

i switched over to use the semver-cli. on my machine, the image is now 300MB, which seems fine to me.
but ci still fails with

error: failed to solve: ResourceExhausted: failed to prepare sha256:127f85cd6ab879a998cb8f434ea30441d104e611c3641ddda966f6911edc9ee5 as k6bvh2yxdcq99isg5xdan8kwz: copying of parent failed: failed to copy files: write /home/user/.local/share/buildkit/runc-native/snapshots/snapshots/new-1944281478/usr/local/go/test/fixedbugs/bug245.go: copy_file_range: no space left on device

i suspect this is not directly related to the image size, but maybe to some actual problem we may have in the cluster.

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.

2 participants