Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ValidateIPSubnet (0.29 sec)

  1. pkg/config/validation/agent/validation.go

    			}
    		}
    	}
    	errs = AppendErrors(errs, validateSidecarOrGatewayHostnamePart(parts[1], isGateway))
    	return
    }
    
    // ValidateIPSubnet checks that a string is in "CIDR notation" or "Dot-decimal notation"
    func ValidateIPSubnet(subnet string) error {
    	// We expect a string in "CIDR notation" or "Dot-decimal notation"
    	// E.g., a.b.c.d/xx form or just a.b.c.d or 2001:1::1/64
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 20:06:41 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  2. pkg/config/validation/agent/validation_test.go

    			ok:     true,
    		},
    		{
    			name:   "invalid ipv6 subnet",
    			subnet: "2001:1::1/132",
    			ok:     false,
    		},
    	}
    
    	for _, tt := range tests {
    		if err := ValidateIPSubnet(tt.subnet); err != nil {
    			if tt.ok {
    				t.Errorf("test: \"%s\" expected to succeed but failed with error: %+v", tt.name, err)
    			}
    		} else {
    			if !tt.ok {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 20:06:41 UTC 2024
    - 39.1K bytes
    - Viewed (0)
Back to top