warnings=append(warnings,fmt.Sprintf("annotation %s is deprecated, please use %s instead",api.DeprecatedAnnotationTopologyAwareHints,api.AnnotationTopologyMode))
// IPv4 addresses with leading zeros CVE-2021-29923 are not valid in golang since 1.17
// This will also warn about possible future changes on the golang std library
// xref: https://issues.k8s.io/108074
ip,err:=netip.ParseAddr(address)
iferr!=nil{
return[]string{fmt.Sprintf("%s: IP address was accepted, but will be invalid in a future Kubernetes release: %v",fieldPath,err)}
}
// A Recommendation for IPv6 Address Text Representation
//
// "All of the above examples represent the same IPv6 address. This
// flexibility has caused many problems for operators, systems
// engineers, and customers.
// ..."
// https://datatracker.ietf.org/doc/rfc5952/
ifip.Is6()&&ip.String()!=address{
return[]string{fmt.Sprintf("%s: IPv6 address %q is not in RFC 5952 canonical format (%q), which may cause controller apply-loops",fieldPath,address,ip.String())}
// IPv4 addresses with leading zeros CVE-2021-29923 are not valid in golang since 1.17
// This will also warn about possible future changes on the golang std library
// xref: https://issues.k8s.io/108074
prefix,err:=netip.ParsePrefix(cidr)
iferr!=nil{
return[]string{fmt.Sprintf("%s: IP prefix was accepted, but will be invalid in a future Kubernetes release: %v",fieldPath,err)}
}
// A Recommendation for IPv6 Address Text Representation
//
// "All of the above examples represent the same IPv6 address. This
// flexibility has caused many problems for operators, systems
// engineers, and customers.
// ..."
// https://datatracker.ietf.org/doc/rfc5952/
ifprefix.Addr().Is6()&&prefix.String()!=cidr{
return[]string{fmt.Sprintf("%s: IPv6 prefix %q is not in RFC 5952 canonical format (%q), which may cause controller apply-loops",fieldPath,cidr,prefix.String())}