forked from red-hat-storage/odf-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
operator: add sub-command
rook restart
this commit add sub-command `odf operator rook restart` to restart the rook operator pod and related docs. Signed-off-by: subhamkrai <[email protected]>
- Loading branch information
1 parent
4fa67f3
commit 029d522
Showing
5 changed files
with
43 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package rook | ||
|
||
import ( | ||
"github.com/red-hat-storage/odf-cli/cmd/odf/root" | ||
"github.com/rook/kubectl-rook-ceph/pkg/k8sutil" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var restartCmd = &cobra.Command{ | ||
Use: "restart", | ||
Short: "Restart rook-ceph-operator pod", | ||
Args: cobra.NoArgs, | ||
Example: "odf operator rook restart", | ||
PreRun: func(cmd *cobra.Command, args []string) { | ||
// verify operator pod is running | ||
k8sutil.WaitForPodToRun(cmd.Context(), root.ClientSets.Kube, root.OperatorNamespace, "app=rook-ceph-operator") | ||
}, | ||
Run: func(cmd *cobra.Command, _ []string) { | ||
k8sutil.RestartDeployment(cmd.Context(), root.ClientSets.Kube, root.OperatorNamespace, "rook-ceph-operator") | ||
}, | ||
} |
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 |
---|---|---|
|
@@ -13,4 +13,5 @@ var RookCmd = &cobra.Command{ | |
|
||
func init() { | ||
RookCmd.AddCommand(setCmd) | ||
RookCmd.AddCommand(restartCmd) | ||
} |
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