From d79bedf2bc9b157b60389f590c7498243be6e53b Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Tue, 2 Mar 2021 11:11:29 +0100 Subject: [PATCH] Use path with '/' slashes in created Kustomization This fixes a bug on Windows where the safe relative path would contain '\' slashes, which are not compatible with the controller. Signed-off-by: Hidde Beydals --- cmd/flux/create_kustomization.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/flux/create_kustomization.go b/cmd/flux/create_kustomization.go index 3f53528a..f5ca3593 100644 --- a/cmd/flux/create_kustomization.go +++ b/cmd/flux/create_kustomization.go @@ -19,6 +19,7 @@ package main import ( "context" "fmt" + "path/filepath" "strings" "time" @@ -142,7 +143,7 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error { Interval: metav1.Duration{ Duration: createArgs.interval, }, - Path: kustomizationArgs.path.String(), + Path: filepath.ToSlash(kustomizationArgs.path.String()), Prune: kustomizationArgs.prune, SourceRef: kustomizev1.CrossNamespaceSourceReference{ Kind: kustomizationArgs.source.Kind,