-
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.
Signed-off-by: bishal7679 <[email protected]>
- Loading branch information
1 parent
50c5f86
commit 113cb2e
Showing
5 changed files
with
184 additions
and
2 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,27 @@ | ||
/* | ||
Copyright © 2023 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package delete | ||
|
||
import ( | ||
"github.com/bishal7679/ksapify/apis/api" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// deleteObjectAllCmd represents the deleteObjectAll command | ||
var deleteObjectAllCmd = &cobra.Command{ | ||
Use: "all", | ||
Short: "Use to delete all k8s object", | ||
Long: `It is used to delete all objects of a namespace inside the Cluster. For example: | ||
ksapify delete all <use available flags>`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
api.OutsideClusterConfig() | ||
api.DeleteAllObject(GetClusterns) | ||
}, | ||
} | ||
|
||
func init() { | ||
deleteObjectAllCmd.Flags().StringVarP(&GetClusterns, "namespace", "n", "", "Namespace name") | ||
DeleteobjectCmd.AddCommand(deleteObjectAllCmd) | ||
} |
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,29 @@ | ||
/* | ||
Copyright © 2023 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package delete | ||
|
||
import ( | ||
"github.com/bishal7679/ksapify/apis/api" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// deleteObjectServiceCmd represents the deleteObjectService command | ||
var deleteObjectServiceCmd = &cobra.Command{ | ||
Use: "service", | ||
Short: "Use to delete a Service", | ||
Long: `It is used to delete a service inside the Cluster. For example: | ||
ksapify delete service <use available flags>`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
api.OutsideClusterConfig() | ||
api.DeleteService(GetClusterns, Name) | ||
}, | ||
} | ||
|
||
func init() { | ||
deleteObjectServiceCmd.Flags().StringVarP(&GetClusterns, "namespace", "n", "", "Namespace name") | ||
deleteObjectServiceCmd.Flags().StringVarP(&Name, "name", "N", "", "Service name") | ||
DeleteobjectCmd.AddCommand(deleteObjectServiceCmd) | ||
deleteObjectServiceCmd.MarkFlagRequired("name") | ||
} |
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