Skip to content

Commit 813a225

Browse files
committed
add backward compatible create_cr command
Signed-off-by: Akihiko Kuroda <[email protected]>
1 parent 3e482b1 commit 813a225

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

internal/commands/create_cr.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,13 @@ func sanitizeName(name string) string {
193193

194194
return newName
195195
}
196+
197+
198+
// DeprecatedCreateCommand deprecated create command
199+
func DeprecatedCreateCrCommand(args0 string, options *CommandOptions) error {
200+
createcrCmd := &CreateCrCommand{
201+
BaseCommand: NewBaseCommand(options),
202+
yamlFile: args0,
203+
}
204+
return createcrCmd.Run()
205+
}

src/commands.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,21 @@ var deprecatedCreateCmd = &cobra.Command{
407407
},
408408
}
409409

410+
// Deprecated CreateCr commands - agent/MCPtool
411+
var deprecatedCreateCrCmd = &cobra.Command{
412+
Use: "create-cr",
413+
Short: "*** Deprecated *** Create-cr",
414+
Long: `*** Deprecated *** Create-cr: Use curomresource create yaml_file.`,
415+
Aliases: []string{"create"},
416+
Args: cobra.ExactArgs(1),
417+
Example: ` maestro agent/tool create-cr yaml_file.`,
418+
RunE: func(cmd *cobra.Command, args []string) error {
419+
fmt.Println("***Deprecated Create: Use agent or tool create.***")
420+
options := commands.NewCommandOptions(cmd)
421+
return commands.DeprecatedCreateCrCommand(args[0], options)
422+
},
423+
}
424+
410425
// Deprecated Run commands - workflow
411426
var deprecatedRunCmd = &cobra.Command{
412427
Use: "run",

src/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ A command-line interface for working with Maestro configurations.`,
127127
rootCmd.AddCommand(customResourceCmd)
128128
rootCmd.AddCommand(metaAgentCmd)
129129
rootCmd.AddCommand(deprecatedCreateCmd)
130+
rootCmd.AddCommand(deprecatedCreateCrCmd)
130131
rootCmd.AddCommand(deprecatedRunCmd)
131132
rootCmd.AddCommand(deprecatedDeployCmd)
132133
rootCmd.AddCommand(deprecatedServeCmd)

0 commit comments

Comments
 (0)