Merge pull request #1984 from fluxcd/fix-bootstrap-path-check

Fix bootstrap path check
pull/1985/head
Stefan Prodan 3 years ago committed by GitHub
commit 8bb65719cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -159,6 +159,10 @@ func kustomizationPathDiffers(ctx context.Context, kube client.Client, objKey cl
return "", err return "", err
} }
normalizePath := func(p string) string { normalizePath := func(p string) string {
// remove the trailing '/' if the path is not './'
if len(p) > 2 {
p = strings.TrimSuffix(p, "/")
}
return fmt.Sprintf("./%s", strings.TrimPrefix(p, "./")) return fmt.Sprintf("./%s", strings.TrimPrefix(p, "./"))
} }
if normalizePath(path) == normalizePath(k.Spec.Path) { if normalizePath(path) == normalizePath(k.Spec.Path) {

Loading…
Cancel
Save