Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for formatURL (0.13 sec)

  1. pkg/probe/http/request.go

    	return req, nil
    }
    
    func userAgent(purpose string) string {
    	v := version.Get()
    	return fmt.Sprintf("kube-%s/%s.%s", purpose, v.Major, v.Minor)
    }
    
    // formatURL formats a URL from args.  For testability.
    func formatURL(scheme string, host string, port int, path string) *url.URL {
    	u, err := url.Parse(path)
    	// Something is busted with the path, but it's too late to reject it. Pass it along as is.
    	//
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 07:39:55 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/util/endpoint.go

    		return nil, "", errors.Errorf("invalid value `%s` given for api.advertiseAddress", localEndpoint.AdvertiseAddress)
    	}
    
    	return ip, bindPortString, nil
    }
    
    // formatURL takes a host and a port string and creates a net.URL using https scheme
    func formatURL(host, port string) *url.URL {
    	return &url.URL{
    		Scheme: "https",
    		Host:   net.JoinHostPort(host, port),
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jan 11 15:08:59 UTC 2022
    - 5.3K bytes
    - Viewed (0)
  3. pkg/registry/core/componentstatus/validator.go

    		server.Prober = httpprober.NewWithTLSConfig(server.TLSConfig, followNonLocalRedirects)
    	})
    
    	scheme := "http"
    	if server.EnableHTTPS {
    		scheme = "https"
    	}
    	url := utilnet.FormatURL(scheme, server.Addr, server.Port, server.Path)
    
    	req, err := httpprober.NewProbeRequest(url, nil)
    	if err != nil {
    		return probe.Unknown, "", fmt.Errorf("failed to construct probe request: %w", err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jul 20 13:08:41 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  4. pkg/probe/http/request_test.go

    		{"http", "localhost", 93, "?foo", "http://localhost:93?foo"},
    		{"https", "localhost", 93, "/path?bar", "https://localhost:93/path?bar"},
    	}
    	for _, test := range testCases {
    		url := formatURL(test.scheme, test.host, test.port, test.path)
    		if url.String() != test.result {
    			t.Errorf("Expected %s, got %s", test.result, url.String())
    		}
    	}
    }
    
    func Test_v1HeaderToHTTPHeader(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 16 05:05:36 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/net/http.go

    	case RoundTripperWrapper:
    		return TLSClientConfig(transport.WrappedRoundTripper())
    	default:
    		return nil, fmt.Errorf("unknown transport type: %T", transport)
    	}
    }
    
    func FormatURL(scheme string, host string, port int, path string) *url.URL {
    	return &url.URL{
    		Scheme: scheme,
    		Host:   net.JoinHostPort(host, strconv.Itoa(port)),
    		Path:   path,
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 05 00:08:58 UTC 2022
    - 20.8K bytes
    - Viewed (0)
Back to top