From 9a153d79db009782a2b3d13b01c6647247e1791c Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Wed, 18 Oct 2023 10:06:51 +0200 Subject: [PATCH] Set `SkipDryRunOnMissingResource=true` for `KeepalivedGroup` resources This fixes the initial deployment of the component. Without the annotation ArgoCD can't validate the `KeepalivedGroup` resources before applying the manifests, which in turn means that the CRD won't ever be available. --- component/main.jsonnet | 3 +++ .../openshift4-keepalived/20_keepalived_groups.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/component/main.jsonnet b/component/main.jsonnet index 80ee8d2..b2a38e3 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -55,6 +55,9 @@ local keepalived_groups = std.filter( kube._Object('redhatcop.redhat.io/v1alpha1', 'KeepalivedGroup', formated_name) { metadata+: { namespace: params.namespace, + annotations+: { + 'argocd.argoproj.io/sync-options': 'SkipDryRunOnMissingResource=true', + }, }, spec+: { image: image, diff --git a/tests/golden/defaults/openshift4-keepalived/openshift4-keepalived/20_keepalived_groups.yaml b/tests/golden/defaults/openshift4-keepalived/openshift4-keepalived/20_keepalived_groups.yaml index 4f18183..5c48481 100644 --- a/tests/golden/defaults/openshift4-keepalived/openshift4-keepalived/20_keepalived_groups.yaml +++ b/tests/golden/defaults/openshift4-keepalived/openshift4-keepalived/20_keepalived_groups.yaml @@ -1,7 +1,8 @@ apiVersion: redhatcop.redhat.io/v1alpha1 kind: KeepalivedGroup metadata: - annotations: {} + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true labels: name: group-1 name: group-1 @@ -18,7 +19,8 @@ spec: apiVersion: redhatcop.redhat.io/v1alpha1 kind: KeepalivedGroup metadata: - annotations: {} + annotations: + argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true labels: name: group-2 name: group-2