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

Fix bootstrap path check
This commit is contained in:
Stefan Prodan 2021-10-22 11:43:53 +03:00 committed by GitHub
commit 8bb65719cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,6 +159,10 @@ func kustomizationPathDiffers(ctx context.Context, kube client.Client, objKey cl
return "", err
}
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, "./"))
}
if normalizePath(path) == normalizePath(k.Spec.Path) {