gitRepoUpdates Loop #1985
Replies: 2 comments 6 replies
-
This actually falls into #835. |
Beta Was this translation helpful? Give feedback.
-
I'm not completely clear on what you're trying to do. I can outline what the common case looks like as well as an alternative that seems it may be close to what you're describing... Commonly, a Warehouse subscribes to an image repo and a git repo. The former for images, obviously, and the latter for manifests (or something that renders as manifests, like a Helm chart or some manifests + Kustomize overlays). A new piece of Freight is created when either of those subscriptions detects something new. Since you're using Kustomize, I will focus on that. Typically a Stage subscribed directly to a Warehouse (or indirectly, via upstream Stages) is going to (essentially) check out the desired commit, run So imagining your Warehouse found commit X and image Y, those are "mashed together" at each Stage and written to someplace Stage-specific. This is the common pattern. Again, I am not entirely sure I've understood what you're trying to do, but it seems you are perhaps shooting for a slightly different pattern that essentially involves two pipelines, with one being very short: Pipeline 1: Subscribe only to new images. When one is detected, "promote it" with a Stage that only does the "kustomize edit set image" bit and writes it back to Pipeline 2: Subscribe only to git repo changes. When one is detected, promoted it using whatever promotion mechanisms are desired, but without worrying at all about the Does this sound like what you're trying to do? I believe this is already achievable like so: apiVersion: kargo.akuity.io/v1alpha1
kind: Project
metadata:
name: example
spec:
promotionPolicies:
- stage: image-promoter
autoPromotionEnabled: true
- stage: test
autoPromotionEnabled: true
# More promotion policies ...
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: image
namespace: example
spec:
subscriptions:
- image:
repoURL: nginx # Watch for new versions of this image
semverConstraint: ^1.24.0
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: image-promoter
namespace: example
spec:
subscriptions:
warehouse: image
promotionMechanisms:
gitRepoUpdates:
- repoURL: https://github.com/example/examples.git
readBranch: main
writeBranch: main # Forms no loop because the Warehouse doesn't also
kustomize: # subscribe to this
images:
- image: nginx
path: base # Run kustomize edit set image on this path
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
name: manifests
namespace: example
spec:
subscriptions:
- git:
repoURL: https://github.com/example/examples.git
---
apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
name: test
namespace: example
spec:
subscriptions:
warehouse: manifests
promotionMechanisms:
# Whatever you want to do here, such as force a particular Argo CD
# Application to refresh/sync ...
---
# More Stages downstream from test ... The one caveat to this is that the UI isn't great about Projects containing multiple Warehouses yet, although we hope to have that addressed in the upcoming v0.7.0 release. If that is a problem, a possible workaround is creating these two pipelines in separate Projects. Please let me know if this helps at all or if I have completely missed the mark. |
Beta Was this translation helpful? Give feedback.
-
In setting up my first pipelines, I seem to be running into a loop error that I'm not clear how to work around. I've configured a warehouse with image and git subscriptions. The first stage has a
gitRepoUpdates
promotion mechanism. I then have a number of stages that I'd like to subscribe to that first stage with aargoCDAppUpdates
promotion mechanism so they are updated whenever the image gets updated by first stage, OR when manifests change. I havent seen any discussion about it, but I imagine we want the auto sync mechanism in ArgoCD turned off if we want things to be synced viaargoCDAppUpdates
promotion. If that is the case, and we cant create freight with the image repo and manifests where the image gets updated, how can we auto apply manifest updates?I track the images in kustomization files in a specific directory, and have the git subscription configured with
includePaths
that don't include the image directory, but thegitRepoUpdates
still error that the commit would cause a loop (hitting this)Since stages can only subscribe to a single warehouse or multiple stage, it almost seems like I'd need to either
Beta Was this translation helpful? Give feedback.
All reactions