Skip to content

Commit

Permalink
Merge pull request #141 from projectsyn/fix/crd-argo-sync-options
Browse files Browse the repository at this point in the history
Add ArgoCD sync server-side apply for CRDs
  • Loading branch information
haasad authored Jun 27, 2024
2 parents b68d188 + 34076fe commit f6c1837
Show file tree
Hide file tree
Showing 3 changed files with 2,656 additions and 1,216 deletions.
4 changes: 2 additions & 2 deletions class/backup-k8up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ parameters:
input_type: jsonnet
output_path: apps/
- input_paths:
- backup-k8up/crds/${backup_k8up:images:k8up:tag}/
- backup-k8up/component/crds.jsonnet
output_path: ${_instance}
input_type: copy
input_type: jsonnet
output_type: yaml
- output_path: ${_instance}/01_k8up_helmchart
input_type: helm
Expand Down
25 changes: 25 additions & 0 deletions component/crds.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local prometheus = import 'lib/prometheus.libsonnet';
local inv = kap.inventory();
local params = inv.parameters.backup_k8up;

local load_crds(name) =
std.parseJson(kap.yaml_load_stream(
'dependencies/backup-k8up/crds/%s/%s.yaml' % [
params.images.k8up.tag,
name,
]
));

local syncOptionAnnotation = {
metadata+: {
annotations+: {
'argocd.argoproj.io/sync-options': 'ServerSideApply=true',
},
},
};

local crds = [ crd + syncOptionAnnotation for crd in load_crds('02_k8up_crds') ];

{ '02_k8up_crds': crds }
Loading

0 comments on commit f6c1837

Please sign in to comment.