feat(plugin): set DefaultIngressContainerName to empty
This commit is contained in:
parent
afd1311f85
commit
b2808c9ff7
2 changed files with 7 additions and 3 deletions
|
@ -32,7 +32,11 @@ import (
|
|||
// PodExecString takes a pod and a command, uses kubectl exec to run the command in the pod
|
||||
// and returns stdout as a string
|
||||
func PodExecString(flags *genericclioptions.ConfigFlags, pod *apiv1.Pod, container string, args []string) (string, error) {
|
||||
args = append([]string{"exec", "-n", pod.Namespace, "-c", container, pod.Name}, args...)
|
||||
params := []string{"exec", "-n", pod.Namespace, pod.Name}
|
||||
if len(container) > 0 {
|
||||
params = append(params, "-c", container)
|
||||
}
|
||||
args = append(params, args...)
|
||||
return ExecToString(flags, args)
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import (
|
|||
const (
|
||||
DefaultIngressDeploymentName = "ingress-nginx-controller"
|
||||
DefaultIngressServiceName = "ingress-nginx-controller"
|
||||
DefaultIngressContainerName = "controller"
|
||||
DefaultIngressContainerName = ""
|
||||
)
|
||||
|
||||
// IssuePrefix is the github url that we can append an issue number to to link to it
|
||||
|
@ -131,7 +131,7 @@ func AddSelectorFlag(cmd *cobra.Command) *string {
|
|||
// AddContainerFlag adds a --container flag to a cobra command
|
||||
func AddContainerFlag(cmd *cobra.Command) *string {
|
||||
v := ""
|
||||
cmd.Flags().StringVar(&v, "container", DefaultIngressContainerName, "The name of the ingress-nginx controller container")
|
||||
cmd.Flags().StringVarP(&v, "container", "c", DefaultIngressContainerName, "The name of the ingress-nginx controller container")
|
||||
return &v
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue