-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: yaroslavborbat <[email protected]>
- Loading branch information
1 parent
5c4ad95
commit f910cc7
Showing
9 changed files
with
125 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package lifecycle | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
"golang.org/x/text/cases" | ||
"golang.org/x/text/language" | ||
"k8s.io/client-go/tools/clientcmd" | ||
|
||
"github.com/deckhouse/deckhouse-cli/internal/virtualization/templates" | ||
) | ||
|
||
func NewMigrateCommand(clientConfig clientcmd.ClientConfig) *cobra.Command { | ||
lifecycle := NewLifecycle(Migrate, clientConfig) | ||
migrate := string(Migrate) | ||
cmd := &cobra.Command{ | ||
Use: migrate + " (VirtualMachine)", | ||
Short: cases.Title(language.English).String(migrate) + " a virtual machine.", | ||
Example: lifecycle.Usage(), | ||
Args: templates.ExactArgs(migrate, 1), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
return lifecycle.Run(args) | ||
}, | ||
} | ||
AddCommandlineArgs(cmd.Flags(), &lifecycle.opts) | ||
cmd.SetUsageTemplate(templates.UsageTemplate()) | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.