Skip to content

Commit 979d7b7

Browse files
authored
fix: never prune the root kustomizations (#65)
1 parent d3b6888 commit 979d7b7

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

internal/deployment-repo/template_transformer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ func (t *TemplateTransformer) Transform(ctx context.Context, envName, targetDir
177177
ObjectMeta: metav1.ObjectMeta{
178178
Name: "bootstrap",
179179
Namespace: "default",
180+
Annotations: map[string]string{
181+
"kustomize.toolkit.fluxcd.io/prune": "disabled",
182+
},
180183
},
181184
Spec: fluxk.KustomizationSpec{
182185
Interval: metav1.Duration{Duration: 10 * time.Minute},

internal/deployment-repo/testdata/01/expected-repo/resources/fluxcd/flux-kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: kustomize.toolkit.fluxcd.io/v1
22
kind: Kustomization
33
metadata:
4+
annotations:
5+
kustomize.toolkit.fluxcd.io/prune: disabled
46
name: flux-system
57
namespace: flux-system
68
spec:

internal/deployment-repo/testdata/01/expected-repo/resources/root-kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: kustomize.toolkit.fluxcd.io/v1
22
kind: Kustomization
33
metadata:
4+
annotations:
5+
kustomize.toolkit.fluxcd.io/prune: disabled
46
name: bootstrap
57
namespace: default
68
spec:

internal/deployment-repo/testdata/01/templates/fluxcd/templates/resources/flux-kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apiVersion: kustomize.toolkit.fluxcd.io/v1
22
kind: Kustomization
33
metadata:
4+
annotations:
5+
kustomize.toolkit.fluxcd.io/prune: disabled
46
name: flux-system
57
namespace: flux-system
68
spec:

0 commit comments

Comments
 (0)