-
Notifications
You must be signed in to change notification settings - Fork 2
/
composition.yaml
126 lines (125 loc) · 5.35 KB
/
composition.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: xflux.gitops.platform.upbound.io
labels:
type: gitops
spec:
writeConnectionSecretsToNamespace: upbound-system
compositeTypeRef:
apiVersion: gitops.platform.upbound.io/v1alpha1
kind: XFlux
mode: Pipeline
pipeline:
- step: patch-and-transform
functionRef:
name: crossplane-contrib-function-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
kind: Resources
patchSets:
- name: Common
patches:
- fromFieldPath: metadata.labels
toFieldPath: metadata.labels
type: FromCompositeFieldPath
- fromFieldPath: metadata.annotations
toFieldPath: metadata.annotations
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.providerConfigName
toFieldPath: spec.providerConfigRef.name
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.deletionPolicy
toFieldPath: spec.deletionPolicy
type: FromCompositeFieldPath
resources:
- name: releaseFlux
base:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
spec:
forProvider:
chart:
name: flux2
namespace: flux-system
values:
imageAutomationController:
create: false
imageReflectionController:
create: false
patches:
- type: PatchSet
patchSetName: Common
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.operators.flux.version
toFieldPath: spec.forProvider.chart.version
- type: CombineFromComposite
combine:
strategy: string
string:
fmt: https://github.com/fluxcd-community/helm-charts/releases/download/flux2-%[1]s/flux2-%[1]s.tgz
variables:
- fromFieldPath: spec.parameters.operators.flux.version
toFieldPath: spec.forProvider.chart.url
- name: syncFlux
base:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
spec:
forProvider:
chart:
name: flux2-sync
repository: https://fluxcd-community.github.io/helm-charts
namespace: flux-system
values:
gitRepository:
spec:
gitImplementation: go-git
kustomization:
spec:
sourceRef:
kind: GitRepository
patches:
- type: PatchSet
patchSetName: Common
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.operators.flux-sync.version
toFieldPath: spec.forProvider.chart.version
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.providerConfigName
toFieldPath: metadata.annotations[crossplane.io/external-name]
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.timeout
toFieldPath: spec.forProvider.values.gitRepository.spec.timeout
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.interval
toFieldPath: spec.forProvider.values.gitRepository.spec.interval
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.interval
toFieldPath: spec.forProvider.values.kustomization.spec.interval
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.ref.name
toFieldPath: spec.forProvider.values.gitRepository.spec.ref.name
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.url
toFieldPath: spec.forProvider.values.gitRepository.spec.url
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.source.git.path
toFieldPath: spec.forProvider.values.kustomization.spec.path
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.kubeConfigSecretRef.name
toFieldPath: spec.forProvider.values.kustomization.spec.kubeConfig.secretRef.name
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.kubeConfigSecretRef.key
toFieldPath: spec.forProvider.values.kustomization.spec.kubeConfig.secretRef.key
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.providerConfigName
toFieldPath: spec.forProvider.values.gitRepository.spec.ref.branch
transforms:
- type: match
match:
fallbackValue: null
patterns:
- type: regexp
regexp: .*
result: ""