mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-07 16:27:27 +00:00
Merge pull request #5071 from milas/diff-kustomization-recursive-remote
fix: skip remote Kustomizations on recursive diff
This commit is contained in:
commit
f42a17de54
1 changed files with 12 additions and 8 deletions
|
|
@ -146,14 +146,18 @@ func (b *Builder) diff() (string, bool, error) {
|
|||
}
|
||||
|
||||
if !kustomizationsEqual(k, b.kustomization) {
|
||||
subOutput, subCreatedOrDrifted, err := b.kustomizationDiff(k)
|
||||
if err != nil {
|
||||
diffErrs = append(diffErrs, err)
|
||||
}
|
||||
if subCreatedOrDrifted {
|
||||
createdOrDrifted = true
|
||||
output.WriteString(bunt.Sprint(fmt.Sprintf("📁 %s changed\n", ssautil.FmtUnstructured(obj))))
|
||||
output.WriteString(subOutput)
|
||||
if k.Spec.KubeConfig != nil {
|
||||
output.WriteString(writeString(fmt.Sprintf("⚠️ %s skipped: diff not supported for remote clusters\n", ssautil.FmtUnstructured(obj)), bunt.Orange))
|
||||
} else {
|
||||
subOutput, subCreatedOrDrifted, err := b.kustomizationDiff(k)
|
||||
if err != nil {
|
||||
diffErrs = append(diffErrs, err)
|
||||
}
|
||||
if subCreatedOrDrifted {
|
||||
createdOrDrifted = true
|
||||
output.WriteString(bunt.Sprint(fmt.Sprintf("📁 %s changed\n", ssautil.FmtUnstructured(obj))))
|
||||
output.WriteString(subOutput)
|
||||
}
|
||||
}
|
||||
|
||||
// finished with Kustomization diff
|
||||
|
|
|
|||
Loading…
Reference in a new issue