Adding support for --profile cmd option

This commit is contained in:
axel7083
2023-09-17 17:41:05 +02:00
parent 708b222ed5
commit a7c63a650c
6 changed files with 16 additions and 4 deletions
+4
View File
@@ -46,6 +46,7 @@ var (
ConvertDeploymentConfig bool
ConvertReplicas int
ConvertController string
ConvertProfiles []string
ConvertPushImage bool
ConvertNamespace string
ConvertPushImageRegistry string
@@ -115,6 +116,7 @@ var convertCmd = &cobra.Command{
IsReplicaSetFlag: cmd.Flags().Lookup("replicas").Changed,
IsDeploymentConfigFlag: cmd.Flags().Lookup("deployment-config").Changed,
YAMLIndent: ConvertYAMLIndent,
Profiles: ConvertProfiles,
WithKomposeAnnotation: WithKomposeAnnotation,
MultipleContainerMode: MultipleContainerMode,
ServiceGroupMode: ServiceGroupMode,
@@ -199,6 +201,8 @@ func init() {
convertCmd.Flags().IntVar(&ConvertYAMLIndent, "indent", 2, "Spaces length to indent generated yaml files")
convertCmd.Flags().StringArrayVar(&ConvertProfiles, "profile", []string{}, `Specify the profile to use, can use multiple.`)
// In order to 'separate' both OpenShift and Kubernetes only flags. A custom help page is created
customHelp := `Usage:{{if .Runnable}}
{{if .HasAvailableFlags}}{{appendIfNotPresent .UseLine "[flags]"}}{{else}}{{.UseLine}}{{end}}{{end}}{{if .HasAvailableSubCommands}}