Skip to content

Commit fe5085c

Browse files
authored
feat: add sync verification (redhat-appstudio#524)
1 parent e3ef1f5 commit fe5085c

5 files changed

Lines changed: 16 additions & 52 deletions

File tree

argo-cd-apps/base/internal/kargo/appset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ spec:
1313
template:
1414
metadata:
1515
name: kargo-{{nameNormalized}}
16+
annotations:
17+
kargo.akuity.io/authorized-stage: kargo-infra-common:ring-1-staging,kargo-infra-common:ring-2-production
1618
spec:
1719
project: default
1820
source:

argo-cd-apps/base/internal/rover-group-sync/appset.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ spec:
1212
template:
1313
metadata:
1414
name: rover-group-sync
15+
annotations:
16+
kargo.akuity.io/authorized-stage: kargo-infra-common:ring-1-staging,kargo-infra-common:ring-2-production
1517
spec:
1618
project: default
1719
source:

argo-cd-apps/overlays/internal-staging/dummy-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ spec:
1111
template:
1212
metadata:
1313
name: dummy-deployment-{{nameNormalized}}
14+
annotations:
15+
kargo.akuity.io/authorized-stage: kargo-infra-common:ring-1-staging
1416
spec:
1517
project: default
1618
source:

components/kargo/internal-production/projects/kargo-infra-common/base/stage-ring-1-staging.yaml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ spec:
3030
value: https://github.com/redhat-appstudio/infra-common-deployments.git
3131
- name: component
3232
value: ${{ ctx.targetFreight.origin.name }}
33-
# - name: argocdApiUrl
34-
# value: https://argocd-server.argocd-local.svc.cluster.local
3533
steps:
3634
- uses: git-clone
3735
as: clone
@@ -89,31 +87,12 @@ spec:
8987
config:
9088
repoURL: ${{ vars.repoURL }}
9189
prNumber: ${{ outputs['open-pr'].pr.id }}
92-
# TODO: Re-enable once ArgoCD API access is in place (shard controller + token)
93-
# Workaround for argocd-wait race condition (https://github.com/akuity/kargo/issues/6357)
94-
# Credit: @cdemarco-drw
95-
# TODO: Replace with native argocd-wait desiredRevision parameter when upstream implements it
96-
# - uses: http
97-
# as: wait-for-argocd-revision
98-
# retry:
99-
# timeout: 15m
100-
# config:
101-
# method: GET
102-
# url: ${{ vars.argocdApiUrl }}/api/v1/applications/${{ vars.component }}-in-cluster?appNamespace=argocd-local
103-
# headers:
104-
# - name: Authorization
105-
# value: Bearer ${{ secret('kargo-argocd-token').token }}
106-
# successExpression: |
107-
# response.status == 200 &&
108-
# response.body?.status?.sync?.status == 'Synced' &&
109-
# response.body?.status?.sync?.revision == '${{ outputs['wait-for-pr'].commit }}'
110-
# failureExpression: |
111-
# response.body?.status?.health?.status == 'Degraded' ||
112-
# response.body?.status?.operationState?.phase in ['Failed', 'Error']
113-
# timeout: 60s
114-
- uses: argocd-wait
115-
as: argocd-wait
90+
- uses: argocd-update
91+
as: argocd-update
11692
config:
11793
apps:
11894
- name: ${{ vars.component }}-in-cluster
11995
namespace: argocd-local
96+
sources:
97+
- repoURL: ${{ vars.repoURL }}
98+
desiredRevision: ${{ outputs['wait-for-pr'].commit }}

components/kargo/internal-production/projects/kargo-infra-common/base/stage-ring-2-production.yaml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ spec:
2626
value: https://github.com/redhat-appstudio/infra-common-deployments.git
2727
- name: component
2828
value: ${{ ctx.targetFreight.origin.name }}
29-
# - name: argocdApiUrl
30-
# value: https://argocd-server.argocd-local.svc.cluster.local
3129
steps:
3230
- uses: git-clone
3331
as: clone
@@ -79,31 +77,12 @@ spec:
7977
config:
8078
repoURL: ${{ vars.repoURL }}
8179
prNumber: ${{ outputs['open-pr'].pr.id }}
82-
# TODO: Re-enable once ArgoCD API access is in place (shard controller + token)
83-
# Workaround for argocd-wait race condition (https://github.com/akuity/kargo/issues/6357)
84-
# Credit: @cdemarco-drw
85-
# TODO: Replace with native argocd-wait desiredRevision parameter when upstream implements it
86-
# - uses: http
87-
# as: wait-for-argocd-revision
88-
# retry:
89-
# timeout: 15m
90-
# config:
91-
# method: GET
92-
# url: ${{ vars.argocdApiUrl }}/api/v1/applications/${{ vars.component }}-in-cluster?appNamespace=argocd-local
93-
# headers:
94-
# - name: Authorization
95-
# value: Bearer ${{ secret('kargo-argocd-token').token }}
96-
# successExpression: |
97-
# response.status == 200 &&
98-
# response.body?.status?.sync?.status == 'Synced' &&
99-
# response.body?.status?.sync?.revision == '${{ outputs['wait-for-pr'].commit }}'
100-
# failureExpression: |
101-
# response.body?.status?.health?.status == 'Degraded' ||
102-
# response.body?.status?.operationState?.phase in ['Failed', 'Error']
103-
# timeout: 60s
104-
- uses: argocd-wait
105-
as: argocd-wait
80+
- uses: argocd-update
81+
as: argocd-update
10682
config:
10783
apps:
10884
- name: ${{ vars.component }}-in-cluster
10985
namespace: argocd-local
86+
sources:
87+
- repoURL: ${{ vars.repoURL }}
88+
desiredRevision: ${{ outputs['wait-for-pr'].commit }}

0 commit comments

Comments
 (0)