diff --git a/cmd/katenary/main.go b/cmd/katenary/main.go index 413b1ad..c1b4c5b 100644 --- a/cmd/katenary/main.go +++ b/cmd/katenary/main.go @@ -152,7 +152,7 @@ func generateConvertCommand() *cobra.Command { convertCmd.Flags().BoolVarP(&helmdepUpdate, "helm-update", "u", helmdepUpdate, "Update helm dependencies if helm is installed") convertCmd.Flags().StringSliceVarP(&profiles, "profile", "p", profiles, "Specify the profiles to use") convertCmd.Flags().StringVarP(&outputDir, "output-dir", "o", outputDir, "Specify the output directory") - convertCmd.Flags().StringSliceVarP(&dockerComposeFile, "compose-file", "c", cli.DefaultFileNames, "Specify an alternate compose files - can be specified multiple times or use coma to separate them") + convertCmd.Flags().StringSliceVarP(&dockerComposeFile, "compose-file", "c", cli.DefaultFileNames, "Specify an alternate compose files - can be specified multiple times or use coma to separate them.\nNote that overides files are also used whatever the files you specify here.\nThe overides files are:\n"+strings.Join(cli.DefaultOverrideFileNames, ", \n")+"\n") convertCmd.Flags().StringVarP(&givenAppVersion, "app-version", "a", "", "Specify the app version (in Chart.yaml)") convertCmd.Flags().StringVarP(&chartVersion, "chart-version", "v", chartVersion, "Specify the chart version (in Chart.yaml)") return convertCmd diff --git a/parser/main.go b/parser/main.go index 0507a9c..fe25920 100644 --- a/parser/main.go +++ b/parser/main.go @@ -6,10 +6,23 @@ import ( "github.com/compose-spec/compose-go/types" ) +func init() { + // prepend compose.katenary.yaml to the list of default override file names + cli.DefaultOverrideFileNames = append([]string{ + "compose.katenary.yml", + "compose.katenary.yaml", + }, cli.DefaultOverrideFileNames...) + cli.DefaultOverrideFileNames = append(cli.DefaultOverrideFileNames, + []string{ + "podman-compose.katenary.yml", + "podman-compose.katenary.yaml", + "podman-compose.yml", + "podman-compose.yaml", + }...) +} + // Parse compose files and return a project. The project is parsed with dotenv, osenv and profiles. func Parse(profiles []string, dockerComposeFile ...string) (*types.Project, error) { - cli.DefaultOverrideFileNames = append(cli.DefaultOverrideFileNames, "compose.katenary.yaml") - if len(dockerComposeFile) == 0 { cli.DefaultOverrideFileNames = append(cli.DefaultOverrideFileNames, dockerComposeFile...) }