Skip to content

Commit

Permalink
feat(debug-pod): Improve command line
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Jan 21, 2025
1 parent 8f98601 commit f897625
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmd/cluster_debug_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ var clusterDebugPodCmd = &cobra.Command{
}

client := utils.GetQoveryClient(tokenType, token)
organizationId, err := usercontext.GetOrganizationContextResourceId(client, organizationName)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
if organizationId != "" {
organizationId, err = usercontext.GetOrganizationContextResourceId(client, organizationName)
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
panic("unreachable") // staticcheck false positive: https://staticcheck.io/docs/checks#SA5011
}
}

flavor := "REGULAR_PRIVILEGE"
Expand Down Expand Up @@ -65,7 +67,9 @@ var nodeSelector string

func init() {
clusterCmd.AddCommand(clusterDebugPodCmd)
clusterDebugPodCmd.Flags().StringVarP(&organizationId, "organization-id", "o", "", "Organization ID")
clusterDebugPodCmd.Flags().StringVarP(&clusterId, "cluster-id", "c", "", "Cluster ID")
clusterDebugPodCmd.Flags().StringVarP(&nodeSelector, "node-selector", "n", "", "Specify a node selector for the debug pod to be started on")
clusterDebugPodCmd.Flags().BoolVarP(&fullPriviledge, "full-privilege", "p", false, "Start a full privileged debug pod which has access to host machine. ")
_ = clusterDebugPodCmd.MarkFlagRequired("cluster-id")
}

0 comments on commit f897625

Please sign in to comment.