Skip to content

update argocd updater/test to use new flags#103

Open
shuffmintel wants to merge 2 commits into
mainfrom
update-argocd-targets
Open

update argocd updater/test to use new flags#103
shuffmintel wants to merge 2 commits into
mainfrom
update-argocd-targets

Conversation

@shuffmintel

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread modules/argocd/Makefile Outdated
Comment thread modules/argocd/Makefile
Comment on lines +6 to +9
dev_dir = rendered/environments/aws.dev
qa_dir = rendered/environments/aws.qa
logs_dir = rendered/environments/aws.logs
prod_dir = rendered/environments/aws.prod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be good to filter on app and env the same way make k8s/tanka/generate does it (using tk env list --names). In fact, we could probably pull that out into a "list with filters" common script.

Using that, you wouldn't need to filter by app in argocd-image-updater-tester; you could just pass in a list of directories:

@bin/argocd-image-updater-tester --dirs "$$(list_with_filters.sh --app '$(app)' --env '$(env)' | paste -d, -)"

Comment thread modules/argocd/Makefile

## Test argocd-image-updater annotations
updater/test: check-prereq-variables
updater/test: check-prereq-variables get-dirs

@nabadger nabadger Jul 14, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this module should sit under k8s/argocd which is then more consistent with our other helpers.

I also think updater is a bit too generic so would suggest image-updater-tester (using the app name as a reference)

So you would end up with

make k8s/argocd/image-updater-tester/...

Comment thread modules/argocd/Makefile
@rm -d bin

check-prereq-variables:
@[ "${GITLAB_SECRET}" ] || ( echo -e "ERROR: GITLAB_SECRET environment variable is not defined. Set the variable before running.\nexport GITLAB_SECRET=\"<gitlab_username>:<gitlab_token>\"\nhttps://argocd-image-updater.readthedocs.io/en/stable/basics/authentication/#using-an-environment-variable"; exit 1 )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a little painful (creating/exporting this var). Would it not be better to bundle this as a docker image instead - that would typically mean we don't have to re-auth each time since.

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