Merge pull request #5071 from milas/diff-kustomization-recursive-remote

fix: skip remote Kustomizations on recursive diff
pull/5038/head^2
Stefan Prodan 2 months ago committed by GitHub
commit f42a17de54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -146,14 +146,18 @@ func (b *Builder) diff() (string, bool, error) {
} }
if !kustomizationsEqual(k, b.kustomization) { if !kustomizationsEqual(k, b.kustomization) {
subOutput, subCreatedOrDrifted, err := b.kustomizationDiff(k) if k.Spec.KubeConfig != nil {
if err != nil { output.WriteString(writeString(fmt.Sprintf("⚠️ %s skipped: diff not supported for remote clusters\n", ssautil.FmtUnstructured(obj)), bunt.Orange))
diffErrs = append(diffErrs, err) } else {
} subOutput, subCreatedOrDrifted, err := b.kustomizationDiff(k)
if subCreatedOrDrifted { if err != nil {
createdOrDrifted = true diffErrs = append(diffErrs, err)
output.WriteString(bunt.Sprint(fmt.Sprintf("📁 %s changed\n", ssautil.FmtUnstructured(obj)))) }
output.WriteString(subOutput) if subCreatedOrDrifted {
createdOrDrifted = true
output.WriteString(bunt.Sprint(fmt.Sprintf("📁 %s changed\n", ssautil.FmtUnstructured(obj))))
output.WriteString(subOutput)
}
} }
// finished with Kustomization diff // finished with Kustomization diff

Loading…
Cancel
Save