Skip to content

Commit e2ff30c

Browse files
committed
Annotate UpgradeJobHook to avoid blocking initial sync
Depending on bootstrap order, this component may try to sync itself before the upgrade controller custom resources are available. To allow a partial sync to succeed in that case, we annotate the `UpgradeJobHook` resource with ArgoCD sync option `SkipDryRunOnMissingResource=true`.
1 parent 06bc57c commit e2ff30c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

component/notifications.libsonnet

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ local hookScript = kube.ConfigMap('cleanup-upgrade-notification') + upgradeContr
193193
};
194194

195195
local ujh = kube._Object('managedupgrade.appuio.io/v1beta1', 'UpgradeJobHook', 'cleanup-upgrade-notification') + upgradeControllerNS {
196+
metadata+: {
197+
annotations+: {
198+
'argocd.argoproj.io/sync-options': 'SkipDryRunOnMissingResource=true',
199+
},
200+
},
196201
spec+: {
197202
selector: {
198203
matchLabels: {

tests/golden/upgrade-notification/openshift4-console/openshift4-console/31_upgrade_notification.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ metadata:
144144
apiVersion: managedupgrade.appuio.io/v1beta1
145145
kind: UpgradeJobHook
146146
metadata:
147-
annotations: {}
147+
annotations:
148+
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
148149
labels:
149150
name: cleanup-upgrade-notification
150151
name: cleanup-upgrade-notification

0 commit comments

Comments
 (0)