From 4e2b1baa625e8ee031aa81de22eb9b30b6c10fbd Mon Sep 17 00:00:00 2001 From: iwilltry42 Date: Mon, 18 Jan 2021 15:52:16 +0100 Subject: [PATCH] add warning, if someone mounts a file at the default registries.yaml location, while they also use a different kind of registry spec --- cmd/cluster/clusterCreate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/cluster/clusterCreate.go b/cmd/cluster/clusterCreate.go index ffd57713..adbef273 100644 --- a/cmd/cluster/clusterCreate.go +++ b/cmd/cluster/clusterCreate.go @@ -26,6 +26,7 @@ import ( "fmt" "os" "runtime" + "strings" "time" "github.com/spf13/cobra" @@ -278,6 +279,10 @@ func parseCreateClusterCmd(cmd *cobra.Command, args []string, cliConfig *conf.Si log.Fatalln(err) } + if strings.Contains(volume, k3d.DefaultRegistriesFilePath) && (cliConfig.Registries.Create || cliConfig.Registries.Config != "" || len(cliConfig.Registries.Use) != 0) { + log.Warnf("Seems like you're mounting a file at '%s' while also using a referenced registries config or k3d-managed registries: Your mounted file will probably be overwritten!", k3d.DefaultRegistriesFilePath) + } + // create new entry or append filter to existing entry if _, exists := volumeFilterMap[volume]; exists { volumeFilterMap[volume] = append(volumeFilterMap[volume], filters...)