Skip to content

feat: set custom repository and use selectors on argocd applications #2286

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 5 commits into
base: main
Choose a base branch
from

Conversation

merll
Copy link
Contributor

@merll merll commented Jun 26, 2025

📌 Summary

This PR adds two features to the otomi apply command:

  • There are two environment variables, APPS_REPO_URL and APPS_REVISION, which allow configuring the repoURL and targetRevision of ArgoCD application manifests when using otomi apply-as-apps or otomi apply --tekton. This way, feature branches can be pushed to other locations than the public GitHub repo for experimental purposes.
  • otomi apply --tekton supports selectors, e.g. by file or name, for selectively configuring the ArgoCD applications.

These two come in useful when testing a new version of an app, without pushing all incremental changes to GitHub. Also, using the selectors, it does not keep re-enabling apl-operator, reverting any potential changes sent from a local Otomi CLI. Application upgrades can be tested on top of different releases, e.g. main and the previous release, without creating a separate feature branch for each combination.

Example, which only updates a single app with a new chart (provided that the Core repo was mirrored to the cluster):

APPS_REPO_URL=https://gitea.mycluster.dev-akamai-apl.net/otomi/core.git APPS_REVISION=testing-chart-branch otomi apply -l pkg=testing-chart --tekton

🔍 Reviewer Notes

These changes are for development use. Without setting any environment variables or selectors, they should not affect the behavior of the apl-operator.

🧹 Checklist

  • Code is readable, maintainable, and robust.
  • Unit tests added/updated

@merll merll requested a review from j-zimnowoda June 26, 2025 07:47
Copy link
Contributor

@CasLubbers CasLubbers left a comment

Choose a reason for hiding this comment

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

One comment. Code looks good to me

@merll
Copy link
Contributor Author

merll commented Jun 26, 2025

I realized that using the selectors on apply with --tekton is now exactly the same behavior as apply-as-apps. I thought of reverting that part, but I did not find it intuitive that the --tekton flag ignores selectors and applies all apps, and without the flag it respects them. Either way, we should probably clean that up soon, and make a clear separation between apply and apply-as-apps.

@CasLubbers
Copy link
Contributor

I realized that using the selectors on apply with --tekton is now exactly the same behavior as apply-as-apps. I thought of reverting that part, but I did not find it intuitive that the --tekton flag ignores selectors and applies all apps, and without the flag it respects them. Either way, we should probably clean that up soon, and make a clear separation between apply and apply-as-apps.

It's not exactly the same right? In the apply we also update the deployment state in the configmap and make sure that some k8s resources are there.
I was more thinking of splitting up the apply command into an Install command and an Apply command. There we could have better separation of concerns and also make the commands testable.

@CasLubbers CasLubbers self-assigned this Jun 27, 2025
@j-zimnowoda j-zimnowoda changed the title ci: set custom repository and use selectors on argocd applications feat: set custom repository and use selectors on argocd applications Jun 27, 2025
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