Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 56 for parseAddrs (0.21 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/library/ip_test.go

    	} else {
    		t.Fatal("expected result must not be nil")
    	}
    }
    
    func TestIP(t *testing.T) {
    	ipv4Addr, _ := netip.ParseAddr("192.168.0.1")
    	int4 := types.Int(4)
    
    	ipv6Addr, _ := netip.ParseAddr("2001:db8::68")
    	int6 := types.Int(6)
    
    	trueVal := types.Bool(true)
    	falseVal := types.Bool(false)
    
    	cases := []struct {
    		name              string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:07 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  2. pilot/pkg/util/network/ip.go

    // are valid IPv6 address, for all other cases it returns false.
    func AllIPv6(ipAddrs []string) bool {
    	for i := 0; i < len(ipAddrs); i++ {
    		addr, err := netip.ParseAddr(ipAddrs[i])
    		if err != nil {
    			// Should not happen, invalid IP in proxy's IPAddresses slice should have been caught earlier,
    			// skip it to prevent a panic.
    			continue
    		}
    		if addr.Is4() {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Dec 21 21:27:21 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  3. operator/pkg/validate/validate_values_test.go

    				`global.proxy.excludeIPRanges netip.ParsePrefix("4.4.0.0/34"): prefix length out of range`,
    				`global.proxy.includeIPRanges netip.ParsePrefix("1.1.0.256/16"): ParseAddr("1.1.0.256"): IPv4 field has value >255`,
    				`global.proxy.includeIPRanges netip.ParsePrefix("2.2.0.257/16"): ParseAddr("2.2.0.257"): IPv4 field has value >255`,
    			}),
    		},
    		{
    			desc: "BadIPMalformed",
    			yamlStr: `
    global:
      proxy:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 31 13:43:12 UTC 2024
    - 6K bytes
    - Viewed (0)
  4. src/net/netip/netip_test.go

    				t.Fatal(err)
    			}
    			if got != got2 {
    				t.Errorf("ParseAddr(%q) got 2 different results: %#v, %#v", test.in, got, got2)
    			}
    
    			// Check that ParseAddr(ip.String()) is the identity function.
    			s := got.String()
    			got3, err := ParseAddr(s)
    			if err != nil {
    				t.Fatal(err)
    			}
    			if got != got3 {
    				t.Errorf("ParseAddr(%q) != ParseAddr(ParseIP(%q).String()). Got %#v, want %#v", test.in, test.in, got3, got)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:10:01 UTC 2024
    - 54.3K bytes
    - Viewed (0)
  5. pkg/test/framework/components/istio/util.go

    				nodePort = svcPort.NodePort
    				break
    			}
    		}
    		if nodePort == 0 {
    			return nil, false, fmt.Errorf("no port %d found in service: %s/%s", port, ns, svcName)
    		}
    
    		ipAddr, err := netip.ParseAddr(ip)
    		if err != nil {
    			return nil, false, err
    		}
    		return []any{netip.AddrPortFrom(ipAddr, uint16(nodePort))}, true, nil
    	}
    
    	// Otherwise, get the load balancer IP.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 29 17:13:34 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  6. operator/pkg/validate/validate_test.go

    			yamlStr: `
    values:
      global:
        proxy:
          includeIPRanges: "1.1.0.300/16,2.2.0.0/16"
    `,
    			wantErrs: makeErrors([]string{`global.proxy.includeIPRanges netip.ParsePrefix("1.1.0.300/16"): ParseAddr("1.1.0.300"): IPv4 field has value >255`}),
    		},
    		{
    			desc: "EmptyValuesIP",
    			yamlStr: `
    values:
      global:
        proxy:
          includeIPRanges: ""
    `,
    		},
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jun 25 11:44:31 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  7. pilot/pkg/serviceregistry/kube/controller/ambient/helpers.go

    			// TODO: look up the HBONE port instead of hardcoding it
    			HboneMtlsPort: 15008,
    		}
    	}
    	return nil
    }
    
    func (a *index) toNetworkAddress(vip string) (*workloadapi.NetworkAddress, error) {
    	ip, err := netip.ParseAddr(vip)
    	if err != nil {
    		return nil, fmt.Errorf("parse %v: %v", vip, err)
    	}
    	return &workloadapi.NetworkAddress{
    		Network: a.Network(vip, make(labels.Instance, 0)).String(),
    		Address: ip.AsSlice(),
    	}, nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Mar 22 20:35:23 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  8. src/net/netip/fuzz_test.go

    		f.Add(seed)
    	}
    
    	f.Fuzz(func(t *testing.T, s string) {
    		ip, _ := ParseAddr(s)
    		checkStringParseRoundTrip(t, ip, ParseAddr)
    		checkEncoding(t, ip)
    
    		// Check that we match the net's IP parser, modulo zones.
    		if !strings.Contains(s, "%") {
    			stdip := net.ParseIP(s)
    			if !ip.IsValid() != (stdip == nil) {
    				t.Errorf("ParseAddr zero != net.ParseIP nil: ip=%q stdip=%q", ip, stdip)
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 20 23:46:23 UTC 2021
    - 10.5K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/cel/library/cidr_test.go

    		t.Fatal("expected result must not be nil")
    	}
    }
    
    func TestCIDR(t *testing.T) {
    	ipv4CIDR, _ := netip.ParsePrefix("192.168.0.0/24")
    	ipv4Addr, _ := netip.ParseAddr("192.168.0.0")
    
    	ipv6CIDR, _ := netip.ParsePrefix("2001:db8::/32")
    	ipv6Addr, _ := netip.ParseAddr("2001:db8::")
    
    	trueVal := types.Bool(true)
    	falseVal := types.Bool(false)
    
    	cases := []struct {
    		name              string
    		expr              string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:09 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  10. src/net/netip/netip.go

    }
    
    // MustParseAddr calls [ParseAddr](s) and panics on error.
    // It is intended for use in tests with hard-coded strings.
    func MustParseAddr(s string) Addr {
    	ip, err := ParseAddr(s)
    	if err != nil {
    		panic(err)
    	}
    	return ip
    }
    
    type parseAddrError struct {
    	in  string // the string given to ParseAddr
    	msg string // an explanation of the parse failure
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 17:10:01 UTC 2024
    - 43.2K bytes
    - Viewed (0)
Back to top