Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 70 for netutils (0.28 sec)

  1. cmd/kubeadm/app/apis/kubeadm/apiendpoint.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package kubeadm
    
    import (
    	"net"
    	"strconv"
    
    	netutils "k8s.io/utils/net"
    
    	"github.com/pkg/errors"
    )
    
    // APIEndpointFromString returns an APIEndpoint struct based on a "host:port" raw string.
    func APIEndpointFromString(apiEndpoint string) (APIEndpoint, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 20 08:42:09 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  2. pkg/proxy/util/endpoints.go

    */
    
    package util
    
    import (
    	"net"
    
    	"k8s.io/klog/v2"
    	netutils "k8s.io/utils/net"
    )
    
    // IPPart returns just the IP part of an IP or IP:port or endpoint string. If the IP
    // part is an IPv6 address enclosed in brackets (e.g. "[fd00:1::5]:9999"),
    // then the brackets are stripped as well.
    func IPPart(s string) string {
    	if ip := netutils.ParseIPSloppy(s); ip != nil {
    		// IP address without port
    		return s
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 20 11:57:43 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  3. cmd/kube-apiserver/app/options/validation.go

    		serviceIPRange, _, err := controlplaneapiserver.ServiceIPRange(extra.PrimaryServiceClusterIPRange)
    		if err != nil {
    			return []error{fmt.Errorf("error determining service IP ranges: %w", err)}
    		}
    		if netutils.IsIPv4CIDR(&serviceIPRange) != netutils.IsIPv4(generic.AdvertiseAddress) {
    			return []error{fmt.Errorf("service IP family %q must match public address family %q", extra.PrimaryServiceClusterIPRange.String(), generic.AdvertiseAddress.String())}
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:06 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  4. pkg/controller/nodeipam/ipam/test/utils.go

    	"k8s.io/kubernetes/pkg/controller/testutil"
    	netutils "k8s.io/utils/net"
    )
    
    const NodePollInterval = 10 * time.Millisecond
    
    var AlwaysReady = func() bool { return true }
    
    // MustParseCIDR returns the CIDR range parsed from s or panics if the string
    // cannot be parsed.
    func MustParseCIDR(s string) *net.IPNet {
    	_, ret, err := netutils.ParseCIDRSloppy(s)
    	if err != nil {
    		panic(err)
    	}
    	return ret
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Aug 06 00:10:39 UTC 2022
    - 2K bytes
    - Viewed (0)
  5. pkg/util/flag/flags.go

    	// Both IP and IP:port are valid.
    	// Attempt to parse into IP first.
    	if netutils.ParseIPSloppy(s) != nil {
    		*v.Val = s
    		return nil
    	}
    
    	// Can not parse into IP, now assume IP:port.
    	host, port, err := net.SplitHostPort(s)
    	if err != nil {
    		return fmt.Errorf("%q is not in a valid format (ip or ip:port): %v", s, err)
    	}
    	if netutils.ParseIPSloppy(host) == nil {
    		return fmt.Errorf("%q is not a valid IP address", host)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 19 03:30:46 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/server/options/serving_with_loopback_test.go

    package options
    
    import (
    	"net"
    	"testing"
    
    	"k8s.io/apiserver/pkg/server"
    	"k8s.io/client-go/rest"
    	netutils "k8s.io/utils/net"
    )
    
    func TestEmptyMainCert(t *testing.T) {
    	secureServingInfo := &server.SecureServingInfo{}
    	var loopbackClientConfig *rest.Config
    
    	s := (&SecureServingOptions{
    		BindAddress: netutils.ParseIPSloppy("127.0.0.1"),
    	}).WithLoopback()
    	ln, err := net.Listen("tcp", "127.0.0.1:0")
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 20 08:42:09 UTC 2021
    - 1.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/discovery/addresses_test.go

    limitations under the License.
    */
    
    package discovery
    
    import (
    	"net/http"
    	"reflect"
    	"testing"
    
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	utilnet "k8s.io/apimachinery/pkg/util/net"
    	netutils "k8s.io/utils/net"
    )
    
    func TestGetServerAddressByClientCIDRs(t *testing.T) {
    	publicAddressCIDRMap := []metav1.ServerAddressByClientCIDR{
    		{
    			ClientCIDR:    "0.0.0.0/0",
    			ServerAddress: "ExternalAddress",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 20 08:42:09 UTC 2021
    - 2.7K bytes
    - Viewed (0)
  8. pkg/proxy/util/nodeport_addresses.go

    		if (family == v1.IPv4Protocol) == netutils.IsIPv4CIDRString(str) {
    			npa.cidrStrings = append(npa.cidrStrings, str)
    		}
    	}
    	if len(npa.cidrStrings) == 0 {
    		if family == v1.IPv4Protocol {
    			npa.cidrStrings = []string{IPv4ZeroCIDR}
    		} else {
    			npa.cidrStrings = []string{IPv6ZeroCIDR}
    		}
    	}
    
    	// Now parse
    	for _, str := range npa.cidrStrings {
    		_, cidr, _ := netutils.ParseCIDRSloppy(str)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 18 13:25:06 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  9. pkg/controlplane/apiserver/config_test.go

    	"k8s.io/kubernetes/pkg/controlplane/apiserver/options"
    	generatedopenapi "k8s.io/kubernetes/pkg/generated/openapi"
    	netutils "k8s.io/utils/net"
    )
    
    func TestBuildGenericConfig(t *testing.T) {
    	opts := options.NewOptions()
    	s := (&apiserveroptions.SecureServingOptions{
    		BindAddress: netutils.ParseIPSloppy("127.0.0.1"),
    	}).WithLoopback()
    	ln, err := net.Listen("tcp", "127.0.0.1:0")
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 26 12:14:06 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  10. pkg/util/node/node.go

    	for _, addr := range node.Status.Addresses {
    		if addr.Type == v1.NodeInternalIP {
    			ip := netutils.ParseIPSloppy(addr.Address)
    			if ip != nil {
    				allIPs = append(allIPs, ip)
    			}
    		}
    	}
    	for _, addr := range node.Status.Addresses {
    		if addr.Type == v1.NodeExternalIP {
    			ip := netutils.ParseIPSloppy(addr.Address)
    			if ip != nil {
    				allIPs = append(allIPs, ip)
    			}
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 27 23:24:38 UTC 2023
    - 4.8K bytes
    - Viewed (0)
Back to top