Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for IsValidIPAddress (0.54 sec)

  1. pkg/util/net/ip.go

    // limitations under the License.
    
    package net
    
    import (
    	"net"
    	"net/http"
    	"net/netip"
    
    	"istio.io/istio/pkg/log"
    )
    
    // IsValidIPAddress Tell whether the given IP address is valid or not
    func IsValidIPAddress(ip string) bool {
    	ipa, err := netip.ParseAddr(ip)
    	if err != nil {
    		return false
    	}
    	return ipa.IsValid()
    }
    
    // IsIPv6Address returns if ip is IPv6.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  2. pkg/util/net/ip_test.go

    			args: args{
    				ip: "188.188.188.1888",
    			},
    			want: false,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if got := IsValidIPAddress(tt.args.ip); got != tt.want {
    				t.Errorf("IsValidIPAddress() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestIsIPv6Address(t *testing.T) {
    	type args struct {
    		ip string
    	}
    	tests := []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 01 14:41:40 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  3. pilot/pkg/serviceregistry/serviceentry/conversion.go

    		if len(serviceEntry.Addresses) > 0 {
    			for _, address := range serviceEntry.Addresses {
    				// Check if address is an IP first because that is the most common case.
    				if netutil.IsValidIPAddress(address) {
    					hostAddresses = append(hostAddresses, &HostAddress{hostname, address})
    				} else if cidr, cidrErr := netip.ParsePrefix(address); cidrErr == nil {
    					newAddress := address
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 29 02:03:58 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  4. pkg/config/validation/agent/validation.go

    	if err != nil {
    		return fmt.Errorf("port (%s) is not a number: %v", p, err)
    	}
    	if err = ValidatePort(port); err != nil {
    		return err
    	}
    	if err = ValidateFQDN(hostname); err != nil {
    		if !netutil.IsValidIPAddress(hostname) {
    			return fmt.Errorf("%q is not a valid hostname or an IP address", hostname)
    		}
    	}
    
    	return nil
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 20:06:41 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  5. pilot/pkg/model/context.go

    	}
    	out.Type = NodeType(parts[0])
    
    	// Get all IP Addresses from Metadata
    	if hasValidIPAddresses(metadata.InstanceIPs) {
    		out.IPAddresses = metadata.InstanceIPs
    	} else if netutil.IsValidIPAddress(parts[1]) {
    		// Fall back, use IP from node id, it's only for backward-compatibility, IP should come from metadata
    		out.IPAddresses = append(out.IPAddresses, parts[1])
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jun 03 08:29:05 UTC 2024
    - 33.6K bytes
    - Viewed (0)
  6. pkg/config/validation/validation.go

    				}
    			}
    		}
    
    		allHostsValid := true
    		for _, virtualHost := range virtualService.Hosts {
    			if err := agent.ValidateWildcardDomain(virtualHost); err != nil {
    				if !netutil.IsValidIPAddress(virtualHost) {
    					errs = AppendValidation(errs, err)
    					allHostsValid = false
    				}
    			} else if appliesToMesh && virtualHost == "*" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jun 12 04:03:33 UTC 2024
    - 107.2K bytes
    - Viewed (0)
  7. istioctl/pkg/workload/workload.go

    			} else if len(ingress.Spec.ExternalIPs) > 0 {
    				ingressIP = ingress.Spec.ExternalIPs[0]
    			}
    			// TODO: add case where the load balancer is a DNS name
    		}
    	}
    
    	var hosts string
    	if netutil.IsValidIPAddress(ingressIP) {
    		hosts = fmt.Sprintf("%s %s\n", ingressIP, IstiodHost(istioNamespace, revision))
    	} else {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 20:06:41 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  8. pilot/pkg/xds/endpoints/endpoint_builder.go

    		// 2. ep.Address can be uds when EndpointPort = 0
    		if ep.Address != "" && ep.EndpointPort != 0 && !netutil.IsValidIPAddress(ep.Address) {
    			return false
    		}
    		// filter out endpoints that don't match the subset
    		if !b.subsetLabels.SubsetOf(ep.Labels) {
    			return false
    		}
    		return true
    	})
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Apr 28 02:18:19 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  9. pilot/pkg/networking/core/listener.go

    							// as service entries could have NONE resolution with label selectors for workload
    							// entries (which could technically have hostnames).
    							if !netutil.IsValidIPAddress(instance.Address) {
    								continue
    							}
    							// Skip build outbound listener to the node itself,
    							// as when app access itself by pod ip will not flow through this listener.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon May 06 04:44:06 UTC 2024
    - 55.1K bytes
    - Viewed (0)
Back to top