Showing 333 of 526 total issues
Function resizeTtyTo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func resizeTtyTo(ctx context.Context, apiClient client.ContainerAPIClient, id string, height, width uint, isExec bool) error {
Function disconnectByKubeConfig
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func disconnectByKubeConfig(ctx context.Context, svr *Server, kubeconfigBytes string, ns string, jump *rpc.SshJump) error {
Function transportTunClient
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func transportTunClient(ctx context.Context, tunInbound <-chan *DataElem, tunOutbound chan<- *DataElem, packetConn net.PacketConn, remoteAddr net.Addr) error {
Function getDHCPServerClient
has 5 return statements (exceeds 4 allowed). Open
Open
func getDHCPServerClient(ctx context.Context, namespace string) (rpc.DHCPClient, error) {
cert, ok := os.LookupEnv(config.TLSCertKey)
if !ok {
return nil, fmt.Errorf("can not get %s from env", config.TLSCertKey)
}
Function ParseAndGet
has 5 return statements (exceeds 4 allowed). Open
Open
func ParseAndGet(localFile, remoteAddr string, aliasName string) ([]Config, error) {
var content []byte
var err error
var path string
if localFile != "" {
Method ConnectOptions.InitClient
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *ConnectOptions) InitClient(f cmdutil.Factory) (err error) {
c.factory = f
if c.config, err = c.factory.ToRESTConfig(); err != nil {
return
}
Function GetAPIServerFromKubeConfigBytes
has 5 return statements (exceeds 4 allowed). Open
Open
func GetAPIServerFromKubeConfigBytes(kubeconfigBytes []byte) *net.IPNet {
kubeConfig, err := clientcmd.RESTConfigFromKubeConfig(kubeconfigBytes)
if err != nil {
return nil
}
Function GetVolume
has 5 return statements (exceeds 4 allowed). Open
Open
func GetVolume(ctx context.Context, f util.Factory, ns, podName string) (map[string][]mount.Mount, error) {
clientSet, err := f.KubernetesClientSet()
if err != nil {
return nil, err
}
Function quit
has 5 return statements (exceeds 4 allowed). Open
Open
func quit(ctx context.Context, isSudo bool) error {
cli := daemon.GetClient(isSudo)
if cli == nil {
return nil
}
Method ConnectOptions.LeaveProxyResources
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *ConnectOptions) LeaveProxyResources(ctx context.Context) (err error) {
if c == nil || c.clientset == nil {
return
}
Method CloneOptions.setEnv
has 5 return statements (exceeds 4 allowed). Open
Open
func (d *CloneOptions) setEnv(u *unstructured.Unstructured) error {
temp, path, err := util.GetPodTemplateSpecPath(u)
if err != nil {
return err
}
Function NeedsUpgrade
has 5 return statements (exceeds 4 allowed). Open
Open
func NeedsUpgrade(ctx context.Context, client *http.Client, version string) (url string, latestVersion string, upgrade bool, err error) {
latestVersion, url, err = util.GetManifest(client, runtime.GOOS, runtime.GOARCH)
if err != nil {
v := "https://github.com/kubenetworks/kubevpn/raw/master/plugins/stable.txt"
var stream []byte
Function GetNsForListPodAndSvc
has 5 return statements (exceeds 4 allowed). Open
Open
func GetNsForListPodAndSvc(ctx context.Context, clientset *kubernetes.Clientset, nsList []string) (podNs string, svcNs string, err error) {
for _, ns := range nsList {
log.Debugf("List namepsace %s pods", ns)
_, err = clientset.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{Limit: 1})
if apierrors.IsForbidden(err) {
Function CreateFolder
has 5 return statements (exceeds 4 allowed). Open
Open
func CreateFolder(ctx context.Context, cli *client.Client, id string, src string, target string) (string, error) {
lstat, err := os.Lstat(src)
if err != nil {
return "", err
}
Function CopyVolumeIntoContainer
has 5 return statements (exceeds 4 allowed). Open
Open
func CopyVolumeIntoContainer(ctx context.Context, volume []mount.Mount, cli *client.Client, id string) error {
// copy volume into container
for _, v := range volume {
target, err := CreateFolder(ctx, cli, id, v.Source, v.Target)
if err != nil {
Function runLogsWaitRunning
has 5 return statements (exceeds 4 allowed). Open
Open
func runLogsWaitRunning(ctx context.Context, dockerCli command.Cli, id string) error {
c, err := dockerCli.Client().ContainerInspect(ctx, id)
if err != nil {
return err
}
Function NewOnAddresses
has 5 return statements (exceeds 4 allowed). Open
Open
func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) {
if len(addresses) == 0 {
return nil, errors.New("you must specify at least 1 address")
}
parsedAddresses, err := parseAddresses(addresses)
Function cmdConfigAdd
has 5 return statements (exceeds 4 allowed). Open
Open
func cmdConfigAdd(f cmdutil.Factory) *cobra.Command {
var sshConf = &pkgssh.SshConfig{}
cmd := &cobra.Command{
Use: "add",
Short: i18n.T("Proxy kubeconfig"),
Method ConnectOptions.PreCheckResource
has 5 return statements (exceeds 4 allowed). Open
Open
func (c *ConnectOptions) PreCheckResource() error {
if len(c.Workloads) == 0 {
return nil
}
Function parsePorts
has 5 return statements (exceeds 4 allowed). Open
Open
func parsePorts(ports []string) ([]ForwardedPort, error) {
var forwards []ForwardedPort
for _, portString := range ports {
parts := strings.Split(portString, ":")
var localString, remoteString string