-
Notifications
You must be signed in to change notification settings - Fork 36
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: Utkarsh Bhatt <[email protected]>
- Loading branch information
1 parent
baa384e
commit 3a2b4e7
Showing
7 changed files
with
76 additions
and
5 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 |
---|---|---|
|
@@ -14,7 +14,6 @@ import ( | |
|
||
type cmdRemoteImport struct { | ||
common *CmdControl | ||
remote *cmdRemote | ||
localName string | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ import ( | |
|
||
type cmdRemoteList struct { | ||
common *CmdControl | ||
remote *cmdRemote | ||
json bool | ||
} | ||
|
||
|
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,42 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/canonical/microceph/microceph/client" | ||
"github.com/canonical/microcluster/microcluster" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type cmdRemoteRemove struct { | ||
common *CmdControl | ||
} | ||
|
||
func (c *cmdRemoteRemove) Command() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "remove <Name>", | ||
Short: "Remove configured remote", | ||
RunE: c.Run, | ||
} | ||
|
||
return cmd | ||
} | ||
|
||
func (c *cmdRemoteRemove) Run(cmd *cobra.Command, args []string) error { | ||
if len(args) != 1 { | ||
return cmd.Help() | ||
} | ||
|
||
m, err := microcluster.App(microcluster.Args{StateDir: c.common.FlagStateDir, Verbose: c.common.FlagLogVerbose, Debug: c.common.FlagLogDebug}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
cli, err := m.LocalClient() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// send remote remove request | ||
return client.SendRemoteRemoveRequest(context.Background(), cli, args[0]) | ||
} |
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